def map_qubits(self, qubit_map: dict[TKey, TKeyNew]) -> cirq.PauliString[TKeyNew]:
        """Replaces every qubit `q` in `self.qubits` with `qubit_map[q]`.

        Args:
            qubit_map: A map from qubits in the pauli string to new qubits.

        Returns:
            A new `PauliString` with remapped qubits.

        Raises:
            ValueError: If the map does not contain an entry for all qubits in the pauli string.
        """
        if not set(self.qubits) <= qubit_map.keys():
            raise ValueError(
                "qubit_map must have a key for every qubit in the pauli strings' qubits. "
                f"keys: {qubit_map.keys()} pauli string qubits: {self.qubits}"
            )
        new_qubit_pauli_map = {qubit_map[qubit]: pauli for qubit, pauli in self.items()}
        return PauliString(qubit_pauli_map=new_qubit_pauli_map, coefficient=self._coefficient)
Replaces every qubit `q` in `self.qubits` with `qubit_map[q]`.

        Args:
            qubit_map: A map from qubits in the pauli string to new qubits.

        Returns:
            A new `PauliString` with remapped qubits.

        Raises:
            ValueError: If the map does not contain an entry for all qubits in the pauli string.
        
cirq-core/cirq/ops/pauli_string.py