Channels – Simulating realistic quantum channels

class squanch.channels.QChannel(from_agent, to_agent, length=0.0, errors=())[source]

Bases: object

Base class for a quantum channel connecting two agents

__init__(from_agent, to_agent, length=0.0, errors=())[source]

Instantiate the quantum channel

Parameters:
  • from_agent (Agent) – sending agent
  • to_agent (Agent) – receiving agent
  • length (float) – length of quantum channel in km; default: 0.0km
  • errors (QError[]) – list of error models to apply to qubits in this channel; default: [] (no errors)
__weakref__

list of weak references to the object (if defined)

get()[source]

Retrieve a qubit by reference from the channel queue, applying errors upon retrieval

Returns:tuple: (the qubit with errors applied (possibly None), receival time)
put(qubit)[source]

Serialize and push qubit into the channel queue

Parameters:qubit (Qubit) – the qubit to send
class squanch.channels.CChannel(from_agent, to_agent, length=0.0)[source]

Bases: object

Base class for a classical channel connecting two agents

__init__(from_agent, to_agent, length=0.0)[source]

Instantiate the quantum channel

Parameters:
  • from_agent (Agent) – sending agent
  • to_agent (Agent) – receiving agent
  • length (float) – length of fiber optic line in km; default: 0.0km
__weakref__

list of weak references to the object (if defined)

get()[source]

Retrieve a classical object form the queue

Returns:tuple: (the object, receival time)
put(thing)[source]

Serialize and push a serializable object into the channel queue

Parameters:thing (any) – the qubit to send
class squanch.channels.FiberOpticQChannel(from_agent, to_agent, length=0.0)[source]

Bases: squanch.channels.QChannel

Represents a fiber optic line with attenuation errors

__init__(from_agent, to_agent, length=0.0)[source]

Instantiate the simulated fiber optic quantum channel

Parameters:
  • from_agent (Agent) – sending agent
  • to_agent (Agent) – receiving agent
  • length (float) – length of fiber optic channel in km; default: 0.0km