def create_tomography_circuits(circuit, qreg, creg, tomoset):
if not isinstance(circuit, QuantumCircuit):<EOL><INDENT>raise QiskitError('<STR_LIT>')<EOL><DEDENT>dics = tomoset['<STR_LIT>']<EOL>labels = tomography_circuit_names(tomoset, circuit.name)<EOL>tomography_circuits = []<EOL>for label, conf in zip(labels, dics):<EOL><INDENT>tmp = circuit<EOL>if '<STR_LIT>' in conf:<EOL><INDENT>prep = QuantumCircuit(qreg, creg, name='<STR_LIT>')<EOL>for qubit, op in conf['<STR_LIT>'].items():<EOL><INDENT>tomoset['<STR_LIT>'].prep_gate(prep, qreg[qubit], op)<EOL>prep.barrier(qreg[qubit])<EOL><DEDENT>tmp = prep + tmp<EOL><DEDENT>meas = QuantumCircuit(qreg, creg, name='<STR_LIT>')<EOL>for qubit, op in conf['<STR_LIT>'].items():<EOL><INDENT>meas.barrier(qreg[qubit])<EOL>tomoset['<STR_LIT>'].meas_gate(meas, qreg[qubit], op)<EOL>meas.measure(qreg[qubit], creg[qubit])<EOL><DEDENT>tmp = tmp + meas<EOL>tmp.name = label<EOL>tomography_circuits.append(tmp)<EOL><DEDENT>logger.info('<STR_LIT>', circuit.name)<EOL>return tomography_circuits<EOL>
Add tomography measurement circuits to a QuantumProgram.

The quantum program must contain a circuit 'name', which is treated as a
state preparation circuit for state tomography, or as teh circuit being
measured for process tomography. This function then appends the circuit
with a set of measurements specified by the input `tomography_set`,
optionally it also prepends the circuit with state preparation circuits if
they are specified in the `tomography_set`.

For n-qubit tomography with a tomographically complete set of preparations
and measurements this results in $4^n 3^n$ circuits being added to the
quantum program.

Args:
    circuit (QuantumCircuit): The circuit to be appended with tomography
                              state preparation and/or measurements.
    qreg (QuantumRegister): the quantum register containing qubits to be
                            measured.
    creg (ClassicalRegister): the classical register containing bits to
                              store measurement outcomes.
    tomoset (tomography_set): the dict of tomography configurations.

Returns:
    list: A list of quantum tomography circuits for the input circuit.

Raises:
    QiskitError: if circuit is not a valid QuantumCircuit

Example:
    For a tomography set specifying state tomography of qubit-0 prepared
    by a circuit 'circ' this would return:
    ```
    ['circ_meas_X(0)', 'circ_meas_Y(0)', 'circ_meas_Z(0)']
    ```
    For process tomography of the same circuit with preparation in the
    SIC-POVM basis it would return:
    ```
    [
        'circ_prep_S0(0)_meas_X(0)', 'circ_prep_S0(0)_meas_Y(0)',
        'circ_prep_S0(0)_meas_Z(0)', 'circ_prep_S1(0)_meas_X(0)',
        'circ_prep_S1(0)_meas_Y(0)', 'circ_prep_S1(0)_meas_Z(0)',
        'circ_prep_S2(0)_meas_X(0)', 'circ_prep_S2(0)_meas_Y(0)',
        'circ_prep_S2(0)_meas_Z(0)', 'circ_prep_S3(0)_meas_X(0)',
        'circ_prep_S3(0)_meas_Y(0)', 'circ_prep_S3(0)_meas_Z(0)'
    ]
    ```