I am trying to implement a full adder with minimum of 8 qubits to add two 4 bit integers. Integer 1 will be added on q[0-3] while integer 2 will be added on q[4-7]. The output will be measured on q[0-3].
So far I created a full adder to be measured on 2 states but I am having trouble manipulating this code to measure on 4 states. Below is qiskit code:
qc = QuantumCircuit(8,2)
AND gate1 implementation
qc.ccx(0,1,3)
OR gate1 implementation
qc.cx(0,4)
qc.cx(1,4)
OR gate2 implementation
qc.cx(2,5)
qc.cx(4,5)
AND gate2 implementation
qc.ccx(2,4,6)
OR gate implementation
qc.x(3)
qc.x(6)
qc.ccx(3,6,7)
qc.x(7)