def __init__(
        self,
        pauli_string: ps.PauliString,
        qubits: Sequence[cirq.Qid] | None = None,
        *,
        exponent_neg: cirq.TParamVal = 1,
        exponent_pos: cirq.TParamVal = 0,
    ) -> None:
        """Initializes the operation.

        Args:
            pauli_string: The PauliString defining the positive and negative
                eigenspaces that will be independently phased.
            qubits: The qubits upon which the PauliStringPhasor acts. This
                must be a superset of the qubits of `pauli_string`.
                If None, it will use the qubits from `pauli_string`
                The `pauli_string` contains only the non-identity component
                of the phasor, while the qubits supplied here and not in
                `pauli_string` are acted upon by identity. The order of
                these qubits must match the order in `pauli_string`.
            exponent_neg: How much to phase vectors in the negative eigenspace,
                in the form of the t in (-1)**t = exp(i pi t).
            exponent_pos: How much to phase vectors in the positive eigenspace,
                in the form of the t in (-1)**t = exp(i pi t).

        Raises:
            ValueError: If coefficient is not 1 or -1 or the qubits of
                `pauli_string` are not a subset of `qubits`.
        """
        if qubits is not None:
            it = iter(qubits)
            if any(not any(q0 == q1 for q1 in it) for q0 in pauli_string.qubits):
                raise ValueError(
                    f"PauliStringPhasor's pauli string qubits ({pauli_string.qubits}) "
                    f"are not an ordered subset of the explicit qubits ({qubits})."
                )
        else:
            qubits = pauli_string.qubits
        # Use qubits below instead of `qubits or pauli_string.qubits`
        gate = PauliStringPhasorGate(
            pauli_string.dense(qubits), exponent_neg=exponent_neg, exponent_pos=exponent_pos
        )
        super().__init__(gate, qubits)
        self._pauli_string = gate.dense_pauli_string.on(*self.qubits)
Initializes the operation.

        Args:
            pauli_string: The PauliString defining the positive and negative
                eigenspaces that will be independently phased.
            qubits: The qubits upon which the PauliStringPhasor acts. This
                must be a superset of the qubits of `pauli_string`.
                If None, it will use the qubits from `pauli_string`
                The `pauli_string` contains only the non-identity component
                of the phasor, while the qubits supplied here and not in
                `pauli_string` are acted upon by identity. The order of
                these qubits must match the order in `pauli_string`.
            exponent_neg: How much to phase vectors in the negative eigenspace,
                in the form of the t in (-1)**t = exp(i pi t).
            exponent_pos: How much to phase vectors in the positive eigenspace,
                in the form of the t in (-1)**t = exp(i pi t).

        Raises:
            ValueError: If coefficient is not 1 or -1 or the qubits of
                `pauli_string` are not a subset of `qubits`.
        
cirq-core/cirq/ops/pauli_string_phasor.py