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

prr

125e6

0 … 4e10 Hz

Repetition rate. The emission interval is 1/prr.

wl

1550e-9

200e-9 … 1680e-9 m

Centre wavelength of the emitted light.

lwidth

1

unchecked

Linewidth - the standard deviation of pulse-to-pulse wavelength variation. Used two ways - see below.

mu_photons

0.1

0 … 1

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

  1. Timing. Pulses are emitted at a steady interval \(T_{\text{rep}} = 1/\texttt{prr}\). For example, at 125 MHz, \(T_{\text{rep}} = 8\) ns.

  2. 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!}\]
  3. 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)\]
  4. 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

  1. Drag Laser from the component tray onto the bench.

  2. Wire its output into the rest of your circuit (e.g. a Beam Splitter or wave plate).

  3. Click the component to open its properties and set frequency, wavelength, linewidth, and mean photon number for your scenario.

  4. 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 raises TypeError.

set_sender(sender=None, port=None)

Always raises TypeError - a laser has no input port.

Useful attributes

Attribute

Meaning

total_photon_emited

Non-empty pulses handed to the output channel.

my_dict

Histogram {photon_number: cycles} over every cycle, including the empty ones (key 0). A quick way to check the Poisson statistics.

counter

Cycle index; used to build photon uID strings such as L1_437.

stopEmiting

Set by stop_emiting().