quchip.results.measurement

Captured physical field statistics and inexpensive IQ receiver processing.

Classes

VNAMeasurement(ports, input, frequencies, ...)

Physical means and spectra captured before you choose a receiver.

VNAMeasurementSamples(ports, input, axes, ...)

Synthetic Gaussian IQ draws with sample, sweep, then output axes.

VNAMeasurementStatistics(ports, input, axes, ...)

Integrated output means and full covariance of (I0,Q0,I1,Q1,...).

class quchip.results.measurement.VNAMeasurementSamples(ports, input, axes, incident, values, receiver, distribution='Gaussian field-moment approximation')[source]

Bases: object

Synthetic Gaussian IQ draws with sample, sweep, then output axes.

Variables:
  • ports (tuple of str) – Output labels in the final array axis.

  • input (str) – Driven input label.

  • axes (tuple) – Named sweep-axis metadata.

  • incident (array_like) – Incident complex field in 1/sqrt(ns).

  • values (array_like) – Sampled complex fields with leading shot and final output axes.

  • receiver (IQReceiver) – Receiver used to integrate the physical spectra.

  • distribution (str) – Sampling approximation.

ports: tuple[str, ...]
input: str
axes: tuple[tuple[str, Any], ...]
incident: Any
values: Any
receiver: IQReceiver
distribution: str = 'Gaussian field-moment approximation'
field(output)[source]

Return sampled complex fields in 1/sqrt(ns).

Parameters:

output (port object or str) – Output plane to select.

ratio(output)[source]

Return sampled output/input ratios, undefined for zero input.

Parameters:

output (port object or str) – Output plane to select.

class quchip.results.measurement.VNAMeasurementStatistics(ports, input, axes, incident, values, iq_covariance, receiver, contributions)[source]

Bases: object

Integrated output means and full covariance of (I0,Q0,I1,Q1,...).

Variables:
  • ports (tuple of str) – Output labels in covariance order.

  • input (str) – Driven input label.

  • axes (tuple) – Named sweep-axis metadata.

  • incident (array_like) – Incident complex field in 1/sqrt(ns).

  • values (array_like) – Integrated complex output means.

  • iq_covariance (array_like) – Full real IQ covariance with two axes per output.

  • receiver (IQReceiver) – Receiver used for integration.

  • contributions (mapping) – Named integrated covariance contributions.

ports: tuple[str, ...]
input: str
axes: tuple[tuple[str, Any], ...]
incident: Any
values: Any
iq_covariance: Any
receiver: IQReceiver
contributions: Mapping[str, Any]
mean(output)[source]

Return the integrated complex mean at an output.

Parameters:

output (port object or str) – Output plane to select.

covariance(output, other=None)[source]

Return a 2x2 IQ covariance or cross-output covariance block.

Parameters:
  • output (port object or str) – First output plane.

  • other (port object, str, or None, optional) – Second output plane. None selects output.

noise_contributions(output)[source]

Return integrated source covariance blocks, with detector vacuum.

Parameters:

output (port object or str) – Output plane to select.

sample(count, *, seed=None, key=None)[source]

Draw joint Gaussian IQ samples without a physical solver run.

Use seed for NumPy draws or an explicit JAX random key. The covariance includes anomalous/cross-output second moments but does not specify higher-order non-Gaussian photon statistics.

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

  • seed (int or None, optional) – NumPy random seed.

  • key (jax.Array or None, optional) – JAX random key. Do not use it together with seed.

calibrate(factors)[source]

Multiply output fields and covariance axes by calibration factors.

Parameters:

factors (mapping) – Complex amplitude factor keyed by output plane. Outputs that are not in the mapping use one.

class quchip.results.measurement.VNAMeasurement(ports, input, frequencies, amplitudes, axes, shape, diagnostics, values, incident, noise_frequencies, noise_components, output_delays, parameters, modes, mode_amplitudes, photon_numbers, mode_frequencies, conventions=('b=I+jQ, engineering e^{+jωt}, j=i. Frequencies in GHz, time in ns.', 'Physical normal-order spectra; detector vacuum added by the receiver', 'Independent stationary experiments across sweep points', 'Gaussian sampling uses second moments, not full photon statistics'))[source]

Bases: MeanFieldResponseResult

Physical means and spectra captured before you choose a receiver.

noise_components maps physical source labels to (white covariance, excess spectral covariance). The excess spectral covariance has an offset-frequency axis before its two IQ axes. Device-generated excess includes input-system correlations and can be negative. It is not an independent random source.

Variables:
  • ports (tuple of str) – Captured output labels.

  • input (str) – Driven input label.

  • values (array_like) – Complex output means with the output axis last.

  • incident (array_like) – Incident complex field in 1/sqrt(ns).

  • amplitudes (frequencies,) – Probe frequencies in GHz and incident amplitudes.

  • shape (tuple of int) – Broadcast sweep shape.

  • axes (tuple) – Named sweep-axis metadata.

  • diagnostics (mapping) – Captured solve diagnostics.

  • noise_frequencies (array_like) – Two-sided offsets in GHz.

  • noise_components (mapping) – Named white and excess IQ covariance spectra.

  • output_delays (array_like) – Output reference-plane delays in ns.

  • parameters (tuple of mapping) – Bound parameters for each sweep point.

  • modes (tuple of str) – Captured internal Fock-mode labels.

  • photon_numbers (mode_amplitudes,) – Internal stationary means and occupations.

  • mode_frequencies (array_like) – Internal stationary-frame frequencies in GHz.

  • conventions (tuple of str) – Units and statistical conventions.

noise_frequencies: Any
noise_components: Mapping[str, tuple[Any, Any]]
output_delays: Any
parameters: tuple[Mapping[str, Any], ...]
modes: tuple[str, ...]
mode_amplitudes: Any
photon_numbers: Any
mode_frequencies: Any
conventions: tuple[str, ...] = ('b=I+jQ, engineering e^{+jωt}, j=i. Frequencies in GHz, time in ns.', 'Physical normal-order spectra; detector vacuum added by the receiver', 'Independent stationary experiments across sweep points', 'Gaussian sampling uses second moments, not full photon statistics')
mode_amplitude(mode)[source]

Return captured <a> in the mode’s stationary frame, in sqrt(photons).

Use mode_frequency(mode) for that frame’s frequency in GHz. The value is the internal field with the full declared wiring included. The returned array follows the measurement’s sweep axes.

Parameters:

mode (device object or str) – Captured Fock mode.

photon_number(mode)[source]

Return captured <a†a>, with coherent and incoherent occupation.

Available for authored Fock modes and nonlinear modes. The general solver keeps the declared basis projection and truncation. Receiver integration and calibration do not change this occupation.

Parameters:

mode (device object or str) – Captured Fock mode.

mode_frequency(mode)[source]

Return a mode’s captured stationary frame frequency in GHz.

Parameters:

mode (device object or str) – Captured Fock mode.

noise_contributions(output)[source]

Return physical IQ spectral contributions at the captured offsets.

Parameters:

output (port object or str) – Output plane to select.

noise_spectrum(output, *, unit='quanta')[source]

Return physical output noise in quanta, W/Hz, or dBm/Hz.

The final axis is noise_frequencies relative to each probe carrier. This normally ordered spectrum does not include coherent signal and receiver vacuum. Power units use hf times occupation at the absolute sideband frequency and require positive physical frequencies. No solve is run.

Parameters:
  • output (port object or str) – Output plane to select.

  • unit ({"quanta", "W/Hz", "dBm/Hz"}, default="quanta") – Spectral-density unit.

statistics(*, receiver)[source]

Integrate captured spectra and detector vacuum without a solver call.

Parameters:

receiver (IQReceiver) – Boxcar receiver and optional digital transfer.

sample(count, *, receiver, seed=None, key=None)[source]

Integrate for a receiver and draw samples from the captured moments.

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

  • receiver (IQReceiver) – Boxcar receiver and optional digital transfer.

  • seed (int or None, optional) – NumPy random seed.

  • key (jax.Array or None, optional) – JAX random key. Do not use it together with seed.