I have a version of the following circuit set up.

from qiskit import QuantumCircuit

circuit.initialize(initial_state0, 0)
initial_state1=[1, 0]

I have seen that I can use StateTomography by coding the following

from qiskit_experiments.library import StateTomography   
from qiskit.providers.aer import Aer
backend = Aer.get_backend('qasm_simulator')

# QST Experiment
qstexp1 = StateTomography(circuit)
qstdata1 = qstexp1.run(backend, seed_simulation=1000).block_for_results()

# Print results
for result in qstdata1.analysis_results():

By using the coding above I am able to see how this tomography can be used to approximate the state of the entire system with fidelity being a comparison to the state of the circuit, but my goal is to use Quantum State Tomography (QST) on only $q_1$ and use the fidelity to compare this to $q_0$.

I have seen in the tutorial on Qiskit that I can run the tomography on parallel subsystems, but I'm not sure how to extend this to my goal described above. Any help would be greatly appreciated!

(Previous edit removed as I resolved that issue independently)


1 Answer 1


In the tutorial, tomography on parallel subsystems assumes that subsystems are independent. From your post, I deduce you are interested in something different, i.e., performing tomography of one state after a single circuit has been executed on several qubits. To this purpose, just modify your code using qstexp1 = StateTomography(circuit, measurement_qubits=[1]). In this way, you will obtain the density matrix of $q_1$. Analytically, such a matrix can be obtained as the partial trace with respect to the density matrix of whole output state -- $I/2$, in your example. Indeed, your result will be (about) $I/2$, as expected.

  • 1
    $\begingroup$ I thought that these measurement_qubits would be the answer to this, but I didn't know I needed to list them in []! Thank you for your help! $\endgroup$
    – PGibbon
    Commented Jan 17, 2023 at 13:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.