I am working on a simple quantum circuit identity. I proved it on paper with the tensor product, but i'm having trouble showing that with qiskit. I know I need to measure them somehow but i don't know how. Can someone help? :)

enter image description here

  • $\begingroup$ Do you mean proving circuit equivalence? Neither of those circuits is the identity circuit. $\endgroup$
    – orlp
    Apr 18 '20 at 0:03

You can check whether the unitary matrices are equivalent.

def circuits_equivalent(a, b):
    au = Operator(a)
    bu = Operator(b)
    return au.dim == bu.dim and np.allclose(au.data, bu.data)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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