I have a 30 qubit system and I need to do quantum tomography on a subsystem of 2 of its qubit. How can I do this in Cirq?


2 Answers 2


State tomography is implemented in Cirq as

    sampler: 'cirq.Sampler',
    qubits: Sequence['cirq.Qid'],
    circuit: 'cirq.Circuit',
    repetitions: int = 1000,
    prerotations: Optional[Sequence[Tuple[float, float]]] = None,



cirq.experiments.state_tomography(cirq.DensityMatrixSimulator(noise=noise_model), qubits=..., circuit=...)
New contributor
Noureldin Yosri is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • $\begingroup$ Thanks for this. But does this specifically select n out of the whole qubits from the output and do the QST? Suppose I have 30 qubits and I just need to do QST on 3 of it. $\endgroup$
    – Ceasar
    May 24 at 15:51
  • $\begingroup$ Hi, I have tried this code and it's not running, basically, cirq.experiments.state_tomography(cirq.DensityMatrixSimulator(noise=cirq.ConstantQubitNoiseModel(cirq.depolarize(0.01))), qubits, circuit) $\endgroup$
    – Ceasar
    May 25 at 0:18
  • $\begingroup$ cirq.experiments.state_tomography(cirq.DensityMatrixSimulator(noise=cirq.ConstantQubitNoiseModel(cirq.depolarize(0.01))), q, circuit) This is not running in Google Colab $\endgroup$
    – Ceasar
    May 25 at 0:19

You only need to do State Tomography on the 2 qubits. But take in mind that, when you perform that, you trace out the other qubits, and are taken as ancilla.

  • $\begingroup$ Could you help me with the cirq code? $\endgroup$
    – Ceasar
    May 18 at 3:42

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.