def __pauli_prep_gates(circuit, qreg, op):
    '\n    Add state preparation gates to a circuit.\n    '
    (bas, proj) = op
    if (bas not in ['X', 'Y', 'Z']):
        raise QiskitError("There's no X, Y or Z basis for this Pauli preparation")
    if (bas == 'X'):
        if (proj == 1):
            circuit.u2(np.pi, np.pi, qreg)
        else:
            circuit.u2(0.0, np.pi, qreg)
    elif (bas == 'Y'):
        if (proj == 1):
            circuit.u2(((- 0.5) * np.pi), np.pi, qreg)
        else:
            circuit.u2((0.5 * np.pi), np.pi, qreg)
    elif ((bas == 'Z') and (proj == 1)):
        circuit.u3(np.pi, 0.0, np.pi, qreg)
Add state preparation gates to a circuit.
def __pauli_prep_gates(circuit, qreg, op):
    '\n    \n    '
    (bas, proj) = op
    if (bas not in ['X', 'Y', 'Z']):
        raise QiskitError("There's no X, Y or Z basis for this Pauli preparation")
    if (bas == 'X'):
        if (proj == 1):
            circuit.u2(np.pi, np.pi, qreg)
        else:
            circuit.u2(0.0, np.pi, qreg)
    elif (bas == 'Y'):
        if (proj == 1):
            circuit.u2(((- 0.5) * np.pi), np.pi, qreg)
        else:
            circuit.u2((0.5 * np.pi), np.pi, qreg)
    elif ((bas == 'Z') and (proj == 1)):
        circuit.u3(np.pi, 0.0, np.pi, qreg)