0
$\begingroup$

I want to apply the projector $|0\rangle\langle 0|$ onto a previously prepared state $|\psi_1\rangle$ in qiskit. I have already initialized a quantum circuit (with two registers) into $|\psi_1\rangle$, but I don't know how to apply a gate that projects one of the registers into $|0\rangle$.

How can I create a projector operator to obtain this? I want to run this program in QASM Simulator (and later in a real device).

$\endgroup$
1

1 Answer 1

1
$\begingroup$

Projecting a state to $|0\rangle\langle 0|$ with probability 1 is equivalent to initialization (indeed, this is why it’s called “projective measurement”), so you can simply call reset (see here: https://qiskit.org/documentation/stubs/qiskit.circuit.QuantumCircuit.reset.html )

$\endgroup$

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.