comnum.Photodiode#

class comnum.Photodiode(*, responsivity=Ellipsis, temperature_k=Ellipsis, dark_current_a=Ellipsis, load_ohm=Ellipsis, bandwidth_hz=Ellipsis, n_taps=Ellipsis, filter_kind=Ellipsis, shot_noise=Ellipsis, thermal_noise=Ellipsis, bandwidth_limitation=Ellipsis, ideal=Ellipsis)#

A PIN photodiode (OptiCommPy photodiode): responsivity, shot noise 2q(I + I_d)B, thermal noise 4k_BTB/R_L, and a low-pass FIR of bandwidth B.

Every attribute is readable and writable; ideal=True gives R|E|² without noise nor filter.

Parameters:
  • responsivity (float) – responsivity (A/W).

  • temperature_k (float) – temperature (K).

  • dark_current_a (float) – dark current (A).

  • load_ohm (float) – load resistance (Ω).

  • bandwidth_hz (float) – electrical bandwidth B (Hz).

  • n_taps (int) – taps of the bandwidth-limiting filter (made odd).

  • filter_kind (str) – the filter, "rect" or "gauss" (see low_pass_fir).

  • shot_noise (bool) – add shot noise.

  • thermal_noise (bool) – add thermal noise.

  • bandwidth_limitation (bool) – filter to the bandwidth.

  • ideal (bool) – ideal square-law detection (overrides the three flags above).

Raises:

ValueError – for an invalid parameter (the message names it).

detect(e, fs, rng)#

Photocurrent of an optical field (one polarisation).

Parameters:
  • e (array_like) – the field (√W).

  • fs (float) – sampling rate (Hz).

  • rng (Rng) – the generator of the noises.

Returns:

the photocurrent (A, float64).

Return type:

numpy.ndarray

Raises:

ValueError – if the detector is not ideal and fs < 2B.

detect_power(p, fs, rng)#

Photocurrent of an optical power.

Parameters:
  • p (array_like) – the optical power of every sample (W).

  • fs (float) – sampling rate (Hz).

  • rng (Rng) – the generator of the noises.

Returns:

the photocurrent (A, float64).

Return type:

numpy.ndarray

Raises:

ValueError – for an invalid parameter or input (the message names it).

bandwidth_hz#

Electrical bandwidth B (Hz) (read and write).

Type:

float

bandwidth_limitation#

Filter to the bandwidth (read and write).

Type:

bool

dark_current_a#

Dark current (A) (read and write).

Type:

float

filter_kind#

The filter, "rect" or "gauss" (read and write; a name is checked when it is assigned).

Type:

str

ideal#

Ideal square-law detection (overrides the three flags above) (read and write).

Type:

bool

load_ohm#

Load resistance (Ω) (read and write).

Type:

float

n_taps#

Taps of the bandwidth-limiting filter (made odd) (read and write).

Type:

int

responsivity#

Responsivity (A/W) (read and write).

Type:

float

shot_noise#

Add shot noise (read and write).

Type:

bool

temperature_k#

Temperature (K) (read and write).

Type:

float

thermal_noise#

Add thermal noise (read and write).

Type:

bool