Channels overview
Channels in Anuqarana are used to establish communication links between different nodes in a network. Quantum communication is supported through Optical Fibre and Free Space channel models.
In AnuQarana, channels are not passive pointers: a channel is an active object that owns the propagation delay, rolls the loss, and delivers to the far end. Components and nodes are never wired directly to each other - every connection goes through a channel.
The channels
Class |
Carries |
Model |
|---|---|---|
|
photons |
Optical fibre. Delay from the core refractive index; loss from an attenuation coefficient in dB/km; optional depolarisation. |
|
photons |
Free-space link. Delay at \(c\); loss as a flat probability. |
Both quantum channels derive from an internal QuantumChannel base, which in
turn derives from Component. The base class is private - instantiating it
from outside the QNS package raises ImportError. Use the two
concrete classes.
Quantum Channel
The Quantum Channel is used to transmit quantum information, such as photons carrying quantum states, between nodes. Two physical implementations are available, differing in how they model delay and loss:
Model |
Carries |
Behaviour |
|---|---|---|
Optical Fibre |
photons |
Delay from the core refractive index; loss from an attenuation coefficient in dB/km; optional depolarisation. |
Free Space |
photons |
Delay at the speed of light in vacuum; loss as a flat probability. |
See Quantum channels for configuration parameters, delay and loss models, and how to choose between the two implementations.
The wiring contract
Every quantum channel exposes the same connection method, which stores
self.source and self.destination and then registers the channel on
both ends by calling set_receiver on the source component and
set_sender on the destination component.
Negative or None port numbers raise TypeError from
connect_channel; port numbers the component does not have raise
TypeError from the component’s own set_receiver / set_sender.
Either way a mis-wired circuit fails at build time rather than silently
dropping photons at run time.
Warning
A channel connects exactly one source port to one destination port.
Calling connect_channel twice on the same channel object silently
overwrites the first link. Create one channel object per optical link;
that is why example circuits declare several channel objects (QC1…
QC5) separately rather than reusing one.
The transport contract
Every quantum channel implements a transmit routine that runs as a Timeline
generator. It is started by the upstream component, never by user code.
Inside, the shape is always: wait out the propagation delay, decide whether
the photon survives, then deliver.
The delivery call passes the channel itself as its first argument. That is how a two-input component works out which port a photon arrived on, by comparing against its registered senders.
Delay and loss at a glance
Channel |
Delay |
Survival probability |
|---|---|---|
.QuantumOpticalChannel` |
|
|
.QuantumFreespaceChannel` |
|
|
c is taken as 3e8 m/s throughout. Fibre length is in metres and
alpha in dB/km, which is why the constructor divides alpha by 1000.
Every channel also exposes self.delay, an alias for its computed
propagation time. This is useful when matching interferometer arms, since the
combined delay of one arm should equal the combined delay of the other.
Loss inside a component versus loss in a channel
The two are modelled differently and it is worth keeping them straight:
Channel loss is a coin flip. A random draw against the transmittance decides whether the photon continues. A photon lost in a fibre never reaches the far end, so no state update happens at all and nothing downstream ever sees it.
Component loss is amplitude. A linear polarizer shrinks the state’s norm; the photon handle keeps travelling and the missing norm is cashed in as a “no photon” outcome at the detector.