def __init__(
        self,
        pauli_mask: Iterable[cirq.PAULI_GATE_LIKE] | np.ndarray,
        *,
        coefficient: cirq.TParamValComplex = 1,
    ):
        """Initializes a new dense pauli string.

        Args:
            pauli_mask: A specification of the Pauli gates to use. This argument
                can be a string like "IXYYZ", or a numeric list like
                [0, 1, 3, 2] with I=0, X=1, Y=2, Z=3=X|Y.

                The internal representation is a 1-dimensional uint8 numpy array
                containing numeric values. If such a numpy array is given, and
                the pauli string is mutable, the argument will be used directly
                instead of being copied.
            coefficient: A complex number. Usually +1, -1, 1j, or -1j but other
                values are supported.
        """
        self._pauli_mask = _as_pauli_mask(pauli_mask)
        self._coefficient: complex | sympy.Expr = (
            coefficient if isinstance(coefficient, sympy.Expr) else complex(coefficient)
        )
        if type(self) != MutableDensePauliString:
            self._pauli_mask = np.copy(self.pauli_mask)
            self._pauli_mask.flags.writeable = False
Initializes a new dense pauli string.

        Args:
            pauli_mask: A specification of the Pauli gates to use. This argument
                can be a string like "IXYYZ", or a numeric list like
                [0, 1, 3, 2] with I=0, X=1, Y=2, Z=3=X|Y.

                The internal representation is a 1-dimensional uint8 numpy array
                containing numeric values. If such a numpy array is given, and
                the pauli string is mutable, the argument will be used directly
                instead of being copied.
            coefficient: A complex number. Usually +1, -1, 1j, or -1j but other
                values are supported.
        
cirq-core/cirq/ops/dense_pauli_string.py