def build_wigner_circuits(circuit, phis, thetas, qubits, qreg, creg):
    'Create the circuits to rotate to points in phase space\n    Args:\n        circuit (QuantumCircuit): The circuit to be appended with tomography\n                                  state preparation and/or measurements.\n        phis (np.matrix[[complex]]): phis\n        thetas (np.matrix[[complex]]): thetas\n        qubits (list[int]): a list of the qubit indexes of qreg to be measured.\n        qreg (QuantumRegister): the quantum register containing qubits to be\n                                measured.\n        creg (ClassicalRegister): the classical register containing bits to\n                                    store measurement outcomes.\n\n    Returns:\n        list: A list of names of the added wigner function circuits.\n\n    Raises:\n        QiskitError: if circuit is not a valid QuantumCircuit.\n    '
    if (not isinstance(circuit, QuantumCircuit)):
        raise QiskitError('Input circuit must be a QuantumCircuit object')
    tomography_circuits = []
    points = len(phis[0])
    for point in range(points):
        label = '_wigner_phase_point'
        label += str(point)
        tmp_circ = QuantumCircuit(qreg, creg, name=label)
        for (qubit, _) in enumerate(qubits):
            tmp_circ.u3(thetas[qubit][point], 0, phis[qubit][point], qreg[qubits[qubit]])
            tmp_circ.measure(qreg[qubits[qubit]], creg[qubits[qubit]])
        tmp_circ = (circuit + tmp_circ)
        tmp_circ.name = (circuit.name + label)
        tomography_circuits.append(tmp_circ)
    logger.info('>> Created Wigner function circuits for "%s"', circuit.name)
    return tomography_circuits
Create the circuits to rotate to points in phase space
Args:
    circuit (QuantumCircuit): The circuit to be appended with tomography
                              state preparation and/or measurements.
    phis (np.matrix[[complex]]): phis
    thetas (np.matrix[[complex]]): thetas
    qubits (list[int]): a list of the qubit indexes of qreg to be measured.
    qreg (QuantumRegister): the quantum register containing qubits to be
                            measured.
    creg (ClassicalRegister): the classical register containing bits to
                                store measurement outcomes.

Returns:
    list: A list of names of the added wigner function circuits.

Raises:
    QiskitError: if circuit is not a valid QuantumCircuit.
def build_wigner_circuits(circuit, phis, thetas, qubits, qreg, creg):
    'Create the circuits to rotate to points in phase space\n    Args:\n        circuit (QuantumCircuit): The circuit to be appended with tomography\n                                  state preparation and/or measurements.\n        phis (np.matrix[[complex]]): phis\n        thetas (np.matrix[[complex]]): thetas\n        qubits (list[int]): a list of the qubit indexes of qreg to be measured.\n        qreg (QuantumRegister): the quantum register containing qubits to be\n                                measured.\n        creg (ClassicalRegister): the classical register containing bits to\n                                    store measurement outcomes.\n\n    Returns:\n        list: A list of names of the added wigner function circuits.\n\n    Raises:\n        QiskitError: if circuit is not a valid QuantumCircuit.\n    '
    if (not isinstance(circuit, QuantumCircuit)):
        raise QiskitError('Input circuit must be a QuantumCircuit object')
    tomography_circuits = []
    points = len(phis[0])
    for point in range(points):
        label = '_wigner_phase_point'
        label += str(point)
        tmp_circ = QuantumCircuit(qreg, creg, name=label)
        for (qubit, _) in enumerate(qubits):
            tmp_circ.u3(thetas[qubit][point], 0, phis[qubit][point], qreg[qubits[qubit]])
            tmp_circ.measure(qreg[qubits[qubit]], creg[qubits[qubit]])
        tmp_circ = (circuit + tmp_circ)
        tmp_circ.name = (circuit.name + label)
        tomography_circuits.append(tmp_circ)
    logger.info('>> Created Wigner function circuits for "%s"', circuit.name)
    return tomography_circuits