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).
I wonder if, in general, one can customize those orange boxes in some way and if that works in the real hardware.
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])
Within the circuit composer, you can find the reset method as well with the $|0rangle$ symbol:
Correct answer by KAJ226 on April 20, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP