TransWikia.com

Applying a projector to a qubit in a qiskit circuit

Quantum Computing Asked by danuzco on April 20, 2021

I’d like to be able to apply $|0 rangle langle 0|$ to project a qubit to the state $|0 rangle$ in the middle of qiskit circuit (see, for example, the attached circuit).

enter image description here

I wonder if, in general, one can customize those orange boxes in some way and if that works in the real hardware.

One Answer

I hope this is what you are looking for.


Within IBM hardware, there is a new option called "reset" that allows you to reset a certain qubit back to the state $|0rangle$. For instance,

from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit
qreg_q = QuantumRegister(3, 'q')
creg_c = ClassicalRegister(3, 'c')
circuit = QuantumCircuit(qreg_q, creg_c)
circuit.x(qreg_q[0])
circuit.h(qreg_q[2])
circuit.cswap(qreg_q[2], qreg_q[0], qreg_q[1])
circuit.h(qreg_q[2])
circuit.reset(qreg_q[1])

enter image description here

Within the circuit composer, you can find the reset method as well with the $|0rangle$ symbol:

enter image description here

Correct answer by KAJ226 on April 20, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP