Photon

Model for single photon.

This module defines the Photon class for tracking individual photons. Photons may be encoded directly with polarization or time bin schemes, or may herald the encoded state of single atom memories.

class src.components.photon.Photon(name: str, timeline: Timeline, wavelength=0, location=None, encoding_type={'bases': [((1 + 0j, 0j), (0j, 1 + 0j)), ((0.7071067811865476 + 0j, 0.7071067811865476 + 0j), (- 0.7071067811865476 + 0j, 0.7071067811865476 + 0j))], 'name': 'polarization'}, quantum_state=None, use_qm=False)

Class for a single photon.

name

label for photon instance.

Type:

str

wavelength

wavelength of photon (in nm).

Type:

float

location

current location of photon.

Type:

Entity

encoding_type

encoding type of photon (as defined in encoding module).

Type:

Dict[str, Any]

quantum_state

quantum state of photon. If use_qm is false, this will be a QuantumState object. Otherwise, it will be an integer key for the quantum manager.

Type:

Union[int, Tuple[complex]]

is_null

defines whether photon is real or a “ghost” photon (not detectable but used in memory encoding).

Type:

bool

loss

similarly defined for memory encoding, used to track loss and improve performance. Does not need to be utilized for all encoding schemes.

Type:

float

use_qm

determines if photon stores state locally (False) or uses timeline quantum manager (True).

Type:

bool

Note: the loss attribute is currently specifically used for the “single_atom” encoding scheme. This encoding scheme also removes the local timeline reference and sets the quantum state to the local key. This is to both facilitate parallel execution and improve the performance of overall simulation.

combine_state(photon)

Method to combine quantum states of photons (see QuantumState module).

This method does not modify the current state of the photon, but combines the internal quantum state object. This ensures that two photons share a quantum state object describing a product space.

static measure(basis, photon: Photon, rng: Generator)

Method to measure a photon (see QuantumState module).

Parameters:
  • basis (List[List[complex]]) – basis (given as lists of complex coefficients) with which to measure the photon.

  • photon (Photon) – photon to measure.

  • rng (Generator) – PRNG to use for measurement results.

Returns:

0/1 value giving result of measurement in given basis.

Return type:

int

static measure_multiple(basis, photons: List[Photon], rng: Generator)

Method to measure 2 entangled photons (see FreeQuantumState module).

Parameters:
  • basis (List[List[complex]]) – basis (given as lists of complex coefficients) with which to measure the photons.

  • photons (List[Photon]) – list of 2 photons to measure.

  • rng (Generator) – PRNG to use for measurement results.

Returns:

0-3 value giving the result of measurement in given basis.

Return type:

int

random_noise(rng: Generator)

Method to add random noise to photon’s state (see QuantumState module).