quchip.engine.routes¶
Choose how stationary and static calculations solve, and record the reason.
A stationary calculation solves on one of three kinds of space. A passive
linear chip, or a conserving chip under an infinitesimal probe, keeps its mode
or one-excitation equations. A conserving chip under a finite drive keeps the
product labels with total excitation N <= K. Every other calculation uses
the backend’s stationary Liouvillian on the product space, or on the retained
labels of an excitation cutoff. Static queries diagonalize the blocks of a
conserving chip or of an excitation cutoff, and otherwise the full static
model.
Functions
|
Return the name of a backend's array library. |
|
Raise |
|
Return the sentence that explains an automatic cutoff |
|
Return the largest change |
|
Return the record of a solve with the backend's stationary Liouvillian. |
|
Return the sector model of a stationary workflow, or |
|
Return a workflow's capabilities, and raise when the chip's excitation cutoff is outside them. |
|
Return the diagnostics entries of a solve on the sectors |
|
Return the record of a solve on the sectors |
|
Return how static dressed queries diagonalize a chip. |
|
Warn which truncation an automatic route kept and what its check found. |
|
Return why neither the harmonic nor the vacuum response gives a chip's small-signal matrix. |
Classes
|
Comparison of an automatic cutoff |
|
The numerical route of one stationary or static calculation and the reason for it. |
|
What one public workflow supports. |
- class quchip.engine.routes.SolveRoute(name, reason, dimension, arrays, _peak_bytes=None)[source]¶
Bases:
objectThe numerical route of one stationary or static calculation and the reason for it.
- Variables:
name (str) –
"linear_response"for passive-linear mode equations,"vacuum_response"for the vacuum and one-excitation states under a weak probe,"conditional_response"for a frozen dressed reference,"sector_stationary"for the excitation sectorsN <= K, and"stationary_resolvent"for the backend’s stationary Liouvillian on the product space or on the retained labels of an excitation cutoff. Static queries use"sector_eigensystem"or"full_eigensystem".reason (str) – Why the planner chose the route.
dimension (int) – Number of modes or states that the route solves on.
arrays (str) – Array library of the solve,
"numpy"or"jax".peak_bytes (int or None) – Estimated peak memory of the solve, calculated on request.
Nonemeans that the route has no estimate.
- class quchip.engine.routes.Workflow(name, cutoff, sectors)[source]¶
Bases:
objectWhat one public workflow supports.
- Variables:
name (str) – Public name of the workflow in messages.
cutoff (bool) – Whether the workflow runs under an
ExcitationCutoff.sectors (bool) – Whether the planner can solve the workflow on excitation sectors. The sector route needs concrete values, because it solves on host NumPy arrays; traced values use the backend’s Liouvillian.
- quchip.engine.routes.require_workflow(chip, name)[source]¶
Return a workflow’s capabilities, and raise when the chip’s excitation cutoff is outside them.
- quchip.engine.routes.plan_sectors(chip, workflow, *, labels, inputs=(), modes=(), frequencies=(), options=None, concrete=True)[source]¶
Return the sector model of a stationary workflow, or
Nonefor the backend’s Liouvillian, and why.A chip with an excitation cutoff, or a chip with more than
AUTOMATIC_SECTOR_STATESproduct states, solves on sectors when its static model conserves the total excitationNand its channels and inputs keep that structure. Solver options select the backend’s Liouvillian.- Parameters:
chip (Chip) – Chip at one parameter point.
workflow (Workflow) – Calling workflow.
labels (tuple of str) – Output ports that the workflow reads.
modes (tuple of str) – Fock modes whose observables the workflow reads.
frequencies (sequence) – Carrier frequency of each coherent input in GHz.
options (dict or None) – Stationary solver options.
concrete (bool) – Whether the frequencies and amplitudes of the inputs are concrete.
- quchip.engine.routes.weak_probe_reason(chip, labels)[source]¶
Return why neither the harmonic nor the vacuum response gives a chip’s small-signal matrix.
- quchip.engine.routes.cutoff_reason(cutoff, check)[source]¶
Return the sentence that explains an automatic cutoff
K.
- quchip.engine.routes.sector_route(model, cutoff, reason, *, solved=True)[source]¶
Return the record of a solve on the sectors
N <= cutoff.solved=Falserecords a result that needed no stationary solve, which has no memory estimate.
- quchip.engine.routes.sector_diagnostics(model, cutoff, solve, reason, choice, check)[source]¶
Return the diagnostics entries of a solve on the sectors
N <= cutoff.- Parameters:
model (SectorProbeModel) – Sector model of the solve.
cutoff (int) – Kept cutoff
K.solve (SectorSolve) – The stationary solve on
N <= K.reason (str) – Why the planner chose the sector route.
choice ({"explicit", "automatic"}) – Whether
Kcomes from the chip’s excitation cutoff or from the comparison withK + 1.check (CutoffCheck or None) – The comparison of an automatic
K.
- quchip.engine.routes.liouvillian_route(backend, engine_result, reason)[source]¶
Return the record of a solve with the backend’s stationary Liouvillian.
- quchip.engine.routes.static_route(chip, structure)[source]¶
Return how static dressed queries diagonalize a chip.
- Parameters:
chip (Chip) – Chip whose static model is queried.
structure (ExcitationStructure) – Excitation structure of that static model.
- class quchip.engine.routes.CutoffCheck(status, compared_with, change, states)[source]¶
Bases:
objectComparison of an automatic cutoff
KwithK + 1over a whole grid.- Variables:
- quchip.engine.routes.automatic_cutoff(maximum, solve, change, *, fits, states, complete=None)[source]¶
Raise
KfromFIRST_CUTOFFuntilN <= K + 1changes the results by at most the tolerance.This is a convergence check, not an error bound.
- Parameters:
maximum (int) – Largest total of the chip, where the sectors hold every label.
solve (callable) –
solve(K, lower)returns the results onN <= K, starting from the resultslowerat a smaller cutoff, or fromNone.change (callable) –
change(lower, upper)returns the largest relative change.fits (callable) –
fits(K)says whether a solve onN <= Kfits in memory.states (callable) –
states(K)returns the number of labels withN <= K.complete (callable, optional) –
complete(K, results)completes results that a comparison solved in part, whenKbecomes the kept cutoff.
- Returns:
The kept cutoff, its results, and the check, which is
Nonewhen the kept cutoff holds every label.- Return type: