quchip.results.trajectories¶
Native trajectories with captured model context and lazy analysis views.
Classes
|
Jump events of a stochastic solve, in one layout on both backends. |
|
Diffusive measurement currents of a stochastic solve, in one layout on both backends. |
|
Keep a native stochastic result with its storage and weights unchanged. |
- class quchip.results.trajectories.MeasurementRecords(values, channels, edges, sampling, efficiencies, phases, heterodyne)[source]¶
Bases:
objectDiffusive measurement currents of a stochastic solve, in one layout on both backends.
A monitored channel with collapse operator L, efficiency η and phase φ records the current
2 Re⟨c⟩ + ξon each interval, in 1/sqrt(ns), withc = √η e^(−iφ) L. Here L includes the square root of its rate. The homodyne noise ξ has variance 1/Δt. A QuTiP heterodyne solve records the quadratures2 Re⟨c⟩ + ξ_Xand2 Im⟨c⟩ + ξ_Y, and each noise has variance 2/Δt. The values keep this native normalization and the native sampling of the signal on each interval.- Variables:
values (array_like) – Current of each run, channel and interval, with shape
(runs, channels, intervals). A QuTiP heterodyne solve adds a quadrature axis of length 2 before the intervals.channels (tuple of str or None) – Channel of each row, as
TrajectoryResult.monitor_labelsgives them. None when a traced efficiency leaves the native order unknown.edges (array_like, shape (intervals + 1,)) – Interval edges in ns: the save times of the solve.
sampling ({"start", "middle", "end", "mean"}) – Signal sample of each interval. QuTiP takes the signal at the start or the end of an interval, or the mean of both, as its option
store_measurementselects, and adds the noise increment divided by Δt. Dynamiqs divides the increment of the integrated record by Δt, so the signal is its mean over the interval.efficiencies (tuple) – Efficiency η of each row.
phases (tuple) – Phase φ of each row, in rad, relative to the integration frame.
- class quchip.results.trajectories.ClickRecords(times, channels, weights, no_click_weight, full)[source]¶
Bases:
objectJump events of a stochastic solve, in one layout on both backends.
An ensemble mean over runs is the weighted sum
Σ_r w_r x_r, plus the no-click run with its weightno_click_weightwhen the native sampling solves that run apart: QuTiPimproved_samplingand the dynamiqsEvent(smart_sampling=True). The weights then sum to1 − no_click_weight.- Variables:
times (tuple of array_like) – Click times of each run in ns, in increasing order.
channels (tuple of tuple of str) – Channel of each click, from
TrajectoryResult.channel_labels.weights (array_like, shape (runs,)) – Sampling weight of each run.
no_click_weight (float) – Weight of the no-click run that the native sampling solves apart, or 0.
full (array_like of bool, shape (runs,)) – Whether a run filled its dynamiqs
nmaxclickbuffer. Its evolution may stop before the end of the solve. QuTiP has no buffer.
- class quchip.results.trajectories.TrajectoryResult(native, problem, *, label_targets=None)[source]¶
Bases:
SimulationResultKeep a native stochastic result with its storage and weights unchanged.
- Parameters:
native (object) – QuTiP or Dynamiqs stochastic result, including seeds/keys and records.
problem (SolveProblem) – Captured model, observables, channel order, and integration frame.
label_targets (LabelTargets or None, optional) – Snapshot of the solve’s chip that prepares label targets.
- Variables:
native (object) – Unmodified native result, with native record conventions and event padding.
times (array_like, shape (T,)) – Requested save times in ns.
channel_labels (tuple of str) – Unique resolved channel keys in native jump-operator order.
monitor_labels (tuple of str or None) – Native record channel order for an explicit selection, or None when unknown.
- run(index)[source]¶
Return the analysis of one kept conditional trajectory.
- Parameters:
index (int) – Zero-based trajectory index of a run that native storage keeps.
- records()[source]¶
Return the diffusive measurement currents of every kept run.
QuTiP keeps them with the native option
store_measurement.result.nativekeeps the unmodified native fields.