0

As we knew that a qubit have the capacity to store two bit at a time. I am curious to add two bits using single qubit. I try a lot but failed, please give some hints if someone know.

Code:

from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit
from numpy import pi

qreg_q = QuantumRegister(2, 'q')
creg_c = ClassicalRegister(2, 'c')
circuit = QuantumCircuit(qreg_q, creg_c)

circuit.x(qreg_q[0])
circuit.measure(qreg_q[0], creg_c[0])
circuit.measure(qreg_q[1], creg_c[0])
circuit.x(qreg_q[1])

Circuit Diagram:

enter image description here

MattDMo
  • 100,794
  • 21
  • 241
  • 231

0 Answers0