quchip.engine.truncation¶
Captured physical cutoff checks, sampled without storing state histories.
Functions
|
Rows defining a captured cutoff projector in the local solver basis. |
Fastest nonzero frame band in local cutoff reconstruction, in GHz. |
|
|
Reconstruct boundary populations in the physical frame, independent of readout LO. |
|
Capture boundary selections and bases, with no work that grows with the space. |
|
Report the maximum sampled boundary population of each device in a solved result. |
|
Lower captured cutoff projectors through the ordinary frame-band machinery. |
|
Use sampled traces or derive them from a kept full history without a rerun. |
|
Compact rows of the retained totals that a generator change can move above the cutoff. |
|
Return a request collecting physical cutoff populations without saving states. |
Classes
|
|
|
- class quchip.engine.truncation.BoundaryCheck(label: str, boundary: quchip.devices.spaces.TruncationBoundary, basis: Any, energy: bool = False)[source]¶
Bases:
object- boundary: TruncationBoundary¶
- class quchip.engine.truncation.TruncationPlan(checks: tuple[quchip.engine.truncation.BoundaryCheck, ...], unavailable: tuple[str, ...], dims: tuple[int, ...], labels: tuple[str, ...], frame_frequencies: dict[str, Any], operators: tuple[Any, ...] = (), metadata: tuple[quchip.engine.observables.BandMeta, ...] = (), sampled: bool = False, space: Any = None, excitation: tuple[int, tuple[int, ...]] | None = None)[source]¶
Bases:
object- checks: tuple[BoundaryCheck, ...]¶
- quchip.engine.truncation.capture_truncation(chip, engine_result)[source]¶
Capture boundary selections and bases, with no work that grows with the space.
- quchip.engine.truncation.excitation_rows(plan)[source]¶
Compact rows of the retained totals that a generator change can move above the cutoff.
- quchip.engine.truncation.boundary_rows(check, xp)[source]¶
Rows defining a captured cutoff projector in the local solver basis.
- quchip.engine.truncation.boundary_sampling_frequency(plan)[source]¶
Fastest nonzero frame band in local cutoff reconstruction, in GHz.
- quchip.engine.truncation.compile_truncation(plan, backend)[source]¶
Lower captured cutoff projectors through the ordinary frame-band machinery.
- quchip.engine.truncation.with_truncation(problem)[source]¶
Return a request collecting physical cutoff populations without saving states.
- Parameters:
problem (SolveProblem or SolveBatch) – Captured request or parameter batch. Its existing time grid is kept. Samples can miss excursions between save times and do not prove convergence.
- Returns:
Request with additional diagnostic observables. No solve occurs.
- Return type:
- quchip.engine.truncation.boundary_traces(plan, values, times, backend)[source]¶
Reconstruct boundary populations in the physical frame, independent of readout LO.
The traces follow
plan.checks. An excitation cutoff with known boundary sectors adds their population as the last trace.
- quchip.engine.truncation.evaluate_boundaries(result)[source]¶
Use sampled traces or derive them from a kept full history without a rerun.
- quchip.engine.truncation.check_truncation(result, *, threshold=0.001)[source]¶
Report the maximum sampled boundary population of each device in a solved result.
Each device model declares the levels at its cutoff, and a basis with fewer retained than native levels adds its highest retained energy level. The check reads these populations from the saved states, or from the samples that
with_truncation()adds to a request, and warns for each value abovethreshold. This warning heuristic can miss excursions between samples, and it is not an error bound. To confirm convergence, increase the applicable cutoff and compare observables. Native arrays stay differentiable. Warning thresholds are evaluated only for concrete results.Under an
ExcitationCutoff, the report also holds the policy as a key. Its value is the maximum population in the retained sectors that a Hamiltonian term, drive, or jump can move above the cutoff. To check convergence, compare observables at a largermax_total.- Parameters:
result (SimulationResult, TrajectoryResult, or PartitionedSimulationResult) – Time-domain result built by quchip. It needs saved states (
states="all"orstates="final") or the samples of a request prepared withwith_truncation(). A final state alone covers only the final time. A trajectory result needs each run’s states or samples.threshold (float, default=1e-3) – Maximum accepted boundary population.
- Returns:
For a
SimulationResult, the maximum population at each device label, and at theExcitationCutoffpolicy if one applies. For aTrajectoryResult,runsholds the report of each run,deterministicthe report of each no-click run, andmaximumthe largest value of each key over both. For aPartitionedSimulationResult, the reports of the components merge into one per-device report.- Return type:
- Raises:
TypeError – If
resultis not one of these result types.RuntimeError – If the result holds neither saved states nor diagnostic samples.
ValueError – If
thresholdis negative or not finite.