def dense(self, qubits: Sequence[TKey]) -> cirq.DensePauliString:
        """Returns a `cirq.DensePauliString` version of this Pauli string.

        This method satisfies the invariant `P.dense(qubits).on(*qubits) == P`.

        Args:
            qubits: The implicit sequence of qubits used by the dense pauli
                string. Specifically, if the returned dense Pauli string was
                applied to these qubits (via its `on` method) then the result
                would be a Pauli string equivalent to the receiving Pauli
                string.

        Returns:
            A `cirq.DensePauliString` instance `D` such that `D.on(*qubits)`
            equals the receiving `cirq.PauliString` instance `P`.

        Raises:
            ValueError: If the number of qubits is too small.
        """

        if not self.keys() <= set(qubits):
            raise ValueError('not self.keys() <= set(qubits)')
        pauli_mask = [self.get(q, identity.I) for q in qubits]
        return dense_pauli_string.DensePauliString(pauli_mask, coefficient=self.coefficient)
Returns a `cirq.DensePauliString` version of this Pauli string.

        This method satisfies the invariant `P.dense(qubits).on(*qubits) == P`.

        Args:
            qubits: The implicit sequence of qubits used by the dense pauli
                string. Specifically, if the returned dense Pauli string was
                applied to these qubits (via its `on` method) then the result
                would be a Pauli string equivalent to the receiving Pauli
                string.

        Returns:
            A `cirq.DensePauliString` instance `D` such that `D.on(*qubits)`
            equals the receiving `cirq.PauliString` instance `P`.

        Raises:
            ValueError: If the number of qubits is too small.
        
cirq-core/cirq/ops/pauli_string.py