# How to do quantum tomography on a subsystem of 2 of 30 qubits in cirq?

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?

State tomography is implemented in Cirq as

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


https://github.com/quantumlib/Cirq/blob/3b975b093afa80969731af85002634a6f2ce8270/cirq-core/cirq/experiments/n_qubit_tomography.py#L132-L160

e.g.

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.
• 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. May 24 at 15:51
• 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) May 25 at 0:18
• cirq.experiments.state_tomography(cirq.DensityMatrixSimulator(noise=cirq.ConstantQubitNoiseModel(cirq.depolarize(0.01))), q, circuit) This is not running in Google Colab 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.

• Could you help me with the cirq code? May 18 at 3:42