def matrix(self, projector_qids: Iterable[raw_types.Qid] | None = None) -> csr_matrix:
        """Returns the matrix of self in computational basis of qubits.

        Args:
            projector_qids: Ordered collection of qubits that determine the subspace in which the
                matrix representation of the ProjectorSum is to be computed. Qbits absent from
                self.qubits are acted on by the identity. Defaults to the qubits of the
                projector_dict.

        Returns:
            A sparse matrix that is the projection in the specified basis.
        """
        return sum(
            coeff * _projector_string_from_projector_dict(vec).matrix(projector_qids)
            for vec, coeff in self._linear_dict.items()
        )
Returns the matrix of self in computational basis of qubits.

        Args:
            projector_qids: Ordered collection of qubits that determine the subspace in which the
                matrix representation of the ProjectorSum is to be computed. Qbits absent from
                self.qubits are acted on by the identity. Defaults to the qubits of the
                projector_dict.

        Returns:
            A sparse matrix that is the projection in the specified basis.
        
cirq-core/cirq/ops/linear_combinations.py