qiskit/quantum_info/operators/pauli.py
def pauli_single(cls, num_qubits, index, pauli_label):
        """
        Generate single qubit pauli at index with pauli_label with length num_qubits.

        Args:
            num_qubits (int): the length of pauli
            index (int): the qubit index to insert the single qubii
            pauli_label (str): pauli

        Returns:
            Pauli: single qubit pauli
        """
        tmp = Pauli.from_label(pauli_label)
        z = np.zeros(num_qubits, dtype=np.bool)
        x = np.zeros(num_qubits, dtype=np.bool)

        z[index] = tmp.z[0]
        x[index] = tmp.x[0]

        return cls(z, x)
def pauli_single(cls, num_qubits, index, pauli_label):
        tmp = Pauli.from_label(pauli_label)
        z = np.zeros(num_qubits, dtype=np.bool)
        x = np.zeros(num_qubits, dtype=np.bool)

        z[index] = tmp.z[0]
        x[index] = tmp.x[0]

        return cls(z, x)
def pauli_single ( cls , num_qubits , index , pauli_label ) : tmp = Pauli . from_label ( pauli_label ) z = np . zeros ( num_qubits , dtype = np . bool ) x = np . zeros ( num_qubits , dtype = np . bool ) z [ index ] = tmp . z [ 0 ] x [ index ] = tmp . x [ 0 ] return cls ( z , x )
Generate single qubit pauli at index with pauli_label with length num_qubits.

        Args:
            num_qubits (int): the length of pauli
            index (int): the qubit index to insert the single qubii
            pauli_label (str): pauli

        Returns:
            Pauli: single qubit pauli
Generate single qubit pauli at index with pauli_label with length num_qubits .