0
$\begingroup$

How to print the stabilizers for a given circuit using Cirq (just like in Qiskit)?

For example, if I have the following cluster state and make a circuit using Cirq. I give the circuit as input, and I should have the output as: {+XZII, +ZXZI, +IZXZ, +IIZX}

4 node cluster state

$\endgroup$

1 Answer 1

0
$\begingroup$

This should work, though there might be some better UX on top of it that I'm not aware of.

a,b,c,d = cirq.LineQubit.range(4)

circuit = cirq.Circuit(cirq.H.on_each([a,b,c,d]),
                       cirq.CZ(a,b),
                       cirq.CZ(b,c),
                       cirq.CZ(c,d)
                       )
t = cirq.CliffordTableau(4)
state = cirq.CliffordTableauSimulationState(t, qubits=[a,b,c,d])
for op in circuit.all_operations():
  cirq.act_on(op, state)

print(t)
$\endgroup$
1
  • $\begingroup$ Thanks for the help. It is really working with any given circuit $\endgroup$ Oct 15, 2022 at 14:17

Your Answer

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

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