

from qiskit import *

from channel_class import Channel

n_master = 2  # two qubits, the one on alice side
n_channel = 2
n_slave = 1 # two quantum channels and one qubit on bobs side
slave_offset = n_master

channel = Channel(slave_offset, 5000, remote_port = 5001)

#create a Quantum circuit
circ = QuantumCircuit(n_master + n_channel + n_slave)

## Master, Oracle
circ.rx(0.234,0 + channel._offset)
circ.rz(0.54,0 + channel._offset)
circ.ry(0.94,0 + channel._offset)
circ.rx(0.1,0 + channel._offset)

## Creating Entaglement now on Bobs side
circ.h(1+channel._offset)
circ.cx(1+channel._offset,4+channel._offset)

## Master, teleportation protocol
circ.cx(0 + channel._offset, 1  + channel._offset)
circ.h(0 + channel._offset)

## Write the result on the communication qubits, this should be done with classical communication at some point
circ.cx(0 + channel._offset, 2  + channel._offset)
circ.cx(1 + channel._offset, 3  + channel._offset)


## Alice sends here qubits to Bob
channel.send(circ,[1])  ## TODO: remove

## The circuit how it looks on Alice side
circ.draw()