Laser
A pulsed, weak-coherent photon source available on the Virtual Bench.
Description
The Laser models a weak coherent, pulsed, attenuated source. It fires at a fixed pulse repetition rate, and the number of photons in each pulse is random, following a Poisson distribution rather than always emitting exactly one photon - the standard weak-coherent-pulse model used for QKD sources. Every pulse leaves the source horizontally polarized by default.
Note
Because pulses follow a Poisson distribution, most pulses at low brightness settings contain zero photons (vacuum), a smaller fraction contain exactly one photon, and rarer pulses contain two or more. This mirrors how real weak-coherent-pulse sources behave, and is important for interpreting detector counts (see SPAD Detector).
from QNS.components import Laser
L1 = Laser("L1", tl.env, sm, prr=125e6, wl=1550e-9,
lwidth=1, mu_photons=0.1)
Constructor
Laser(uID, env, stateManager, prr=125e6, wl=1550e-9,
lwidth=1, mu_photons=0.1)
Parameter |
Default |
Valid range |
Meaning |
|---|---|---|---|
|
|
|
Repetition rate. The emission interval is |
|
|
|
Centre wavelength of the emitted light. |
|
|
unchecked |
Linewidth - the standard deviation of pulse-to-pulse wavelength variation. Used two ways - see below. |
|
|
|
Mean photon number \(\mu\) per pulse. |
Out-of-range values raise ValueError at construction. env and
stateManager are required and raise ValueError if None.
Ports: 0 inputs, 1 output (port 0). Calling set_sender raises
TypeError - a laser has nothing upstream of it.
How it works
Timing. Pulses are emitted at a steady interval \(T_{\text{rep}} = 1/\texttt{prr}\). For example, at 125 MHz, \(T_{\text{rep}} = 8\) ns.
Photon number. For each pulse, the number of photons \(n\) is drawn from a Poisson distribution with mean \(\mu = \texttt{mu\_photons}\):
\[P(n) = \frac{\mu^{n} e^{-\mu}}{n!}\]Wavelength. Each pulse’s wavelength is drawn around the centre wavelength using the linewidth as a spread:
\[\lambda_p = \lambda_0 + \texttt{lwidth} \cdot X, \qquad X \sim \mathcal{N}(0, 1)\]Polarization. Every emitted pulse starts in the horizontal state:
\[\begin{split}\lvert H \rangle = \begin{pmatrix} 1 \\ 0 \end{pmatrix}\end{split}\]
Important
Nothing is emitted at all if the output port is unconnected: emission is
guarded by if self.receiver.
Using it on the Virtual Bench
Drag Laser from the component tray onto the bench.
Wire its output into the rest of your circuit (e.g. a Beam Splitter or wave plate).
Click the component to open its properties and set frequency, wavelength, linewidth, and mean photon number for your scenario.
Click Run to simulate the circuit.
Note
Keep mu_photons well below 1 (e.g. the default 0.1) to stay in
the single-photon-dominated regime typical of quantum photonic
experiments - higher values produce more multi-photon pulses.
Methods
- emit()
The Timeline emission generator. Started by
Timeline.run.
- stop_emiting()
Sets
stopEmiting = True; the emission loop exits at the top of its next cycle. Useful for shutting a source down partway through a run.
- set_receiver(receiver=None, port=None)
Port must be
0; anything else raisesTypeError.
- set_sender(sender=None, port=None)
Always raises
TypeError- a laser has no input port.
Useful attributes
Attribute |
Meaning |
|---|---|
|
Non-empty pulses handed to the output channel. |
|
Histogram |
|
Cycle index; used to build photon |
|
Set by |