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
$\begingroup$
$\endgroup$
5
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,
)
e.g.
cirq.experiments.state_tomography(cirq.DensityMatrixSimulator(noise=noise_model), qubits=..., circuit=...)
-
$\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$– CeasarCommented 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$– CeasarCommented 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$– CeasarCommented May 25 at 0:19 -
$\begingroup$ I'm guessing that
q
above stands for one qubit, right? ... the method expects a list of qubits so[q]
should fix your issue ``` >> cirq.experiments.state_tomography(cirq.DensityMatrixSimulator(noise=cirq.ConstantQubitNoiseModel(cirq.depolarize(0.01))), [q], circuit) <cirq.experiments.qubit_characterizations.TomographyResult at 0x7e331c4329e0> ``` $\endgroup$ Commented May 31 at 16:52 -
$\begingroup$ Hi, this one is actually giving me negative eigenvalues for the density matrix which shoud'nt happen as as the desnity matrix is positive semi-definite $\endgroup$– CeasarCommented Jun 27 at 1:17
$\begingroup$
$\endgroup$
1
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.