I am trying to create a Distributed Quantum Fourier transform using Non Local Cnot gates with the help of this paper [quant-ph/0402148] Generalized GHZ States and Distributed Quantum Computing
I am having issues while doing this p = self.program
p += H(0)
p += CNOT(0,1)
self.qsend(alice.name, [0])
self.qsend(bob.name, [1])
class Alice(Agent):
‘’‘Alice sends superdense-encoded cbits’‘’
def run(self):
p = self.program
qCharlie = self.qrecv(charlie.name)
a = qCharlie[0]
bit1 = self.cmem[0]
bit2 = self.cmem[1]
if bit2 == 1: p += X(a)
if bit1 == 1: p += Z(a)
self.qsend(bob.name, [a])
class Bob(Agent):
‘’’
Bob reconstructs Alice’s classical bits
‘’’
def run(self):
p = self.program
Get qubits from Alice and Charlie
qAlice = self.qrecv(alice.name)
qCharlie = self.qrecv(charlie.name)
a = qAlice[0]
c = qCharlie[0]
p += CNOT(a,c)
p += H(a)
p += MEASURE(a, ro[0])
p += MEASURE(c, ro[1])
p = Program()
p += H(2)
Create classical memory
ro = p.declare(‘ro’, ‘BIT’, 3)
Create Alice, Bob, and Charlie.
alice = Alice(p, qubits=[2])
bob = Bob(p, name=‘bob’)
charlie = Charlie(p, qubits=[0,1])
Connect agents
QConnect(alice, bob, charlie)
CConnect(alice, bob)
Run simulation
Simulation(alice, bob, charlie).run()
qvm = QVMConnection()
May I know how to write the code for that