quchip.results.terminal¶
Projective measurements of saved states and calibrated detector responses.
Functions
|
Project kept states with captured basis maps and existing result coordinates. |
Classes
|
Calibrate one complex IQ distribution per ordered physical outcome. |
|
Capture only field references and downstream mixing, without quantum operators. |
|
Born probabilities in a captured local product measurement basis. |
|
Independent measurement shots, with indices that select the ordered outcome tuples. |
- class quchip.results.terminal.IQReadout(means, iq_covariance, contributions=None)[source]¶
Bases:
objectCalibrate one complex IQ distribution per ordered physical outcome.
means has shape (outcomes,). iq_covariance is (2,2) or (outcomes,2,2) in the same signal units squared. They are complete conditional detector distributions, so do not add apparatus noise that the calibration already includes. Covariances must be positive definite. Wiring-derived readouts use fields in 1/sqrt(ns) and keep their integrated noise contributions. Means and IQ covariances follow the VNA engineering convention.
- Variables:
means (array_like) – Complex conditional means, one per physical outcome.
iq_covariance (array_like) – Covariance with shape
(outcomes, 2, 2).contributions (mapping or None) – Optional named integrated noise contributions.
- classmethod from_wiring(chip, output, *, means, frequency, receiver, noise_frequencies=None)[source]¶
Build an IQ detector from wiring and conditional coherent fields.
Use the same boundary-field units and vacuum assumptions as SimulationResult.iq_readout(). This method captures the chip’s current wiring, whereas the result method uses the wiring that the simulation kept.
- Parameters:
chip (Chip) – Chip whose current output wiring is captured.
output (port object or str) – Output reference plane.
means (array_like or mapping) – Engineering-convention conditional Markov-boundary fields in
1/sqrt(ns). A mapping gives multiple boundary channels.frequency (scalar) – Carrier frequency in GHz.
receiver (IQReceiver) – Boxcar receiver and optional digital transfer.
noise_frequencies (array_like or None, optional) – Two-sided offsets in GHz.
Noneuses the standard grid.
- class quchip.results.terminal.ReadoutWiring(fields, exposed, graph, array_module)[source]¶
Bases:
objectCapture only field references and downstream mixing, without quantum operators.
- fields: tuple[FieldChannel, ...]¶
- graph: Any¶
- array_module: Any¶
- class quchip.results.terminal.StateSamples(devices, outcomes, axes, physical_indices, indices, iq=None)[source]¶
Bases:
objectIndependent measurement shots, with indices that select the ordered outcome tuples.
physical_indices are Born draws. indices also includes assignment errors, if requested. iq is present only for a conditional IQ readout. Sweep axes follow the leading shot axis. No conditional state is returned.
- Variables:
- class quchip.results.terminal.StateMeasurement(devices, outcomes, probabilities, axes=())[source]¶
Bases:
objectBorn probabilities in a captured local product measurement basis.
- Variables:
- recorded_probabilities(assignment)[source]¶
Apply
A[recorded, physical]to the Born probabilities.- Parameters:
assignment (array_like) – Column-stochastic
(recorded, physical)assignment matrix.
- sample(count, *, seed=None, key=None, assignment=None, readout=None)[source]¶
Draw Born outcomes, and optionally record assignment errors or conditional IQ.
Assignment and IQ are separate detector models. IQ samples stay unclassified, and quchip does not infer a threshold or assignment matrix from them. Discrete labels are not differentiable. Use an explicit key under JAX.
- Parameters:
count (int) – Positive number of independent shots.
seed (int or None, optional) – NumPy random seed.
key (jax.Array or None, optional) – JAX random key. Do not use with
seed.assignment (array_like or None, optional) – Column-stochastic
(recorded, physical)assignment matrix.readout (IQReadout or None, optional) – Conditional IQ calibration for each physical outcome.