0
$\begingroup$

I noticed a strange behavior as I tried to familiarize myself with Qiskit's stabilizer functionalities:

import qiskit

qc = qiskit.QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
qc.h(1)
qc.cz(0, 1)
qc.y(0)
qc.cz(0, 1)
cliff = qiskit.quantum_info.Clifford(qc)

Next, I compute two state vectors; once directly from qc and once from cliff.

from qiskit.quantum_info import Statevector
sv = Statevector.from_instruction(qc)
svcl = Statevector.from_instruction(cliff)

I'd expect that those two state vectors would be the same, however:

print(sv)
Statevector([0.-0.5j, 0.+0.5j, 0.-0.5j, 0.-0.5j],
            dims=(2, 2))

and

print(svcl)
Statevector([-0.35355339+0.35355339j,  0.35355339-0.35355339j,
             -0.35355339+0.35355339j, -0.35355339+0.35355339j],
            dims=(2, 2))

Am I missing something?

$\endgroup$
1
  • $\begingroup$ The two vectors differ by just a global phase factor. $\endgroup$
    – Guangliang
    May 17, 2023 at 21:18

1 Answer 1

1
$\begingroup$

The difference in behavior arises from how Statevector.from_instruction() treats a QuantumCircuit object (by simulating the circuit) versus a Clifford object (by assuming it represents a unitary operator). If you want to obtain the state vector resulting from simulating a circuit, you should use Statevector.from_instruction(qc) directly on the QuantumCircuit object.

$\endgroup$

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.