quchip.results.receiver

Shared heterodyne receiver integration and random sampling.

Functions

gaussian_samples(mean, covariance, count, *)

Draw correlated real Gaussian vectors.

integrate_noise(values, noise_frequencies, ...)

Integrate normal spectra and detector vacuum, and return covariance, budget, and DC gain.

noise_grid([frequencies])

Validate or construct the two-sided spectral offset grid in GHz.

validate_samples(count, seed, key, values)

Validate Gaussian-shot arguments and choose NumPy or JAX arithmetic.

Classes

IQReceiver(integration_time[, transfer, ...])

Configure ideal heterodyne detection after a physical measurement.

class quchip.results.receiver.IQReceiver(integration_time, transfer=None, tolerance=0.02)[source]

Bases: object

Configure ideal heterodyne detection after a physical measurement.

Parameters:
  • integration_time (scalar) – Positive boxcar duration in ns. White detector and field noise scale as 1 / integration_time.

  • transfer (callable or None, optional) – Digital complex amplitude transfer function of offset frequency in GHz, which must be supported on the captured spectral grid. Its value at zero also scales the mean field. It does not change the simulated chip or its physical noise sources.

  • tolerance (float, default=0.02) – Relative convergence and spectral-support tolerance, with 0 < tolerance < 1.

Notes

The receiver integrates the captured two-sided normally ordered spectrum with the sinc-squared boxcar response and adds detector vacuum with covariance 1 / (2 * integration_time) per IQ quadrature. See Caves, Phys. Rev. D 26, 1817 (1982), doi:10.1103/PhysRevD.26.1817, for the phase-preserving amplifier noise convention.

integration_time: Any
transfer: Callable[[Any], Any] | None = None
tolerance: float = 0.02
quchip.results.receiver.validate_samples(count, seed, key, values)[source]

Validate Gaussian-shot arguments and choose NumPy or JAX arithmetic.

Parameters:
  • count (int) – Positive number of draws.

  • seed (int or None) – NumPy generator seed. Do not pass together with key.

  • key (jax.Array or None) – Explicit JAX PRNG key, required to sample traced values.

  • values (object) – Mean and covariance values used to infer the array namespace.

Returns:

NumPy-like namespace selected for the draw.

Return type:

module

quchip.results.receiver.gaussian_samples(mean, covariance, count, *, seed=None, key=None)[source]

Draw correlated real Gaussian vectors.

Parameters:
  • mean (array_like) – Mean with shape (..., n).

  • covariance (array_like) – Positive-definite covariance with shape (..., n, n).

  • count (int) – Number of draws.

  • seed (optional) – Use seed for NumPy or key for JAX. Do not pass both.

  • key (optional) – Use seed for NumPy or key for JAX. Do not pass both.

Returns:

Samples with shape (count, ..., n) in the input array namespace.

Return type:

array

quchip.results.receiver.noise_grid(frequencies=None)[source]

Validate or construct the two-sided spectral offset grid in GHz.

Parameters:

frequencies (1-D array_like or None, optional) – Strictly increasing, finite, symmetric offsets that contain zero. With None, return the default grid spanning -0.1 to +0.1 GHz.

Returns:

Validated offsets in GHz.

Return type:

numpy.ndarray

quchip.results.receiver.integrate_noise(values, noise_frequencies, noise_components, output_delays, receiver)[source]

Integrate normal spectra and detector vacuum, and return covariance, budget, and DC gain.

Captured IQ spectra and the receiver transfer use the engineering convention.