def matrix(self) -> np.ndarray:
        """Reconstructs matrix of self from underlying Pauli sum exponentials.

        Raises:
            ValueError: if exponent is parameterized.
        """
        if protocols.is_parameterized(self._exponent):
            raise ValueError("Exponent should not parameterized.")
        ret = np.ones(1)
        for pauli_string_exp in self:
            ret = np.kron(ret, protocols.unitary(pauli_string_exp))
        return ret
Reconstructs matrix of self from underlying Pauli sum exponentials.

        Raises:
            ValueError: if exponent is parameterized.
        
cirq-core/cirq/ops/pauli_sum_exponential.py