Pennylane Distributed Quantum Fourier transform

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(, [0])
self.qsend(, [1])
class Alice(Agent):
‘’‘Alice sends superdense-encoded cbits’‘’
def run(self):
p = self.program
qCharlie = self.qrecv(
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(, [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(
qCharlie = self.qrecv(
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

Hey @Abby!

Welcome to the forum! :tada:

It’s hard to say what’s going on with the code that you provided. However, if you’re looking for tools you can use to implement QFT algorithms, there is a QFT module in PennyLane: qml.fourier. There’s a lot to read there, so what you’re looking for might be there!

On top of that, there are a couple demos/tutorials that you might find helpful:

Let me know if this helps! :grin:

1 Like

I am working to built a distributed quantum Fourier transform using Non local Cnot gates
The package is netquil

I just wanted to know that can we continue without this package only using pennylane
Or do we need to do something else or different approach
Based on this arxiv paper

The image of the circuit is given above

Hi @Abby,

I guess it depends on what you want to do. I cannot say for sure whether or not PennyLane will be enough.