quchip.engine.ir¶
IR types shared by engine responsibilities and backends.
This module is the contract between the engine and its backends. It defines four families of immutable, JAX-pytree-friendly types:
Signal Program AST: the subclasses of
SignalNode(Constant,EnvelopeRef,Window,Shift,Scale,PolarScale,Add,Multiply,Conjugate,RealPart,Carrier). They describe, purely functionally, a time-dependent scalar coefficientf(t) : ℝ → ℂ. Every sweepable leaf (envelope parameters, amplitudes, phases, and carrier frequencies) is a pytree leaf, so the whole program is differentiable through JAX.CanonicalOperator: backend-free operator storage in dense / CSR / DIA layouts plus subsystem metadata. Backends convert to and from this format.Resolved open-system physics:
ResolvedSLHplus solve-applied Hamiltonian terms inEngineResult.Solve requests:
SolveProblemandSolveBatch, the frozen hand-offs to backends. The chip owns thebackendselection. Do not putbackendinoptions.
A note on 2π: engine assembly scales every operator here by 2π. Carrier frequencies are stored in angular units (rad/ns). IR consumers (backends, analyses) must not re-apply 2π.
Functions
|
Rewrite signal into |
|
Evaluate a signal program at time(s) t (ns); xp defaults to NumPy. |
|
Return the |
|
Return absolute window edges, and keep native values and batch axes. |
|
Recursively simplify a signal program by canceling exact opposing carrier pairs. |
Classes
|
|
|
One solve-bound incident field, kept outside input-free SLH. |
|
Backend-free operator with explicit dense/CSR/DIA payload and subsystem metadata. |
|
Oscillating carrier |
|
One band of a carrier-normalized signal: |
|
Internal signal leaf backed by a public component-owned coefficient. |
|
Frequency response on adjacent excitation-sector coherences. |
|
Coherent field operation scheduled on an external SLH exposure. |
|
Backend-neutral Lindblad channel, optionally exposed as a port. |
|
|
|
|
|
Drive operation scheduled on a device or a modulable coupling. |
|
Advisory record for a Hamiltonian term elided by an approximation. |
|
Time-dependent Hamiltonian contribution |
|
Backend-neutral resolved physics passed to backends. |
|
Reference to a pulse envelope evaluated at local time. |
|
Resolved static and time-dependent Hamiltonian contributions. |
|
Captured chip physics and pre-embedded bands for homogeneous drive sweeps. |
|
Imaginary quadrature of a complex analytic signal. |
|
Passive-linear input-output request handed to a backend. |
|
|
|
Scale child by |
|
|
|
Resolved per-device frame information. |
|
Immutable, input-free normal form for resolved Markovian physics. |
|
One resolved Markov channel and its boundary accessibility. |
|
Mark a |
|
Multiply child by a complex scalar |
|
Time-shift child by |
Base class for signal-program AST nodes. |
|
|
Pointwise power of a scalar signal program. |
|
Explicit solve problems sharing one dispatch owner and sweep shape. |
|
Immutable simulation request handed from the chip pipeline to a backend. |
|
Time-independent Hamiltonian contribution. |
|
Immutable static Lindblad request handed from a chip to its backend. |
|
Gate child to |
- class quchip.engine.ir.SignalNode[source]¶
Bases:
objectBase class for signal-program AST nodes.
A node describes a time-dependent scalar
f(t) : ℝ → ℂ. Subclasses:are
@dataclass(frozen=True). Every dataclass field is a JAX pytree child. Defining a subclass registers it automatically, so any sweepable field is differentiable.name the fields that hold child nodes (or tuples of child nodes) in
_signal_child_fields. This attribute supplies generic traversal (signal_children()) and rewriting (rebuild_children()).implement
evaluate(), the pointwise semantics of the node.override
bands()when (and only when) the node interacts withCarrierleaves. The default treats any carrier-free subtree as a single zero-frequency band, which is exact for every envelope-like node.
- rebuild_children(transform)[source]¶
Reconstruct this node with transform applied to each child.
Non-child fields are preserved; nodes without children pass through unchanged.
- Parameters:
transform (callable) – Function applied to every direct signal child.
- evaluate(t, *, xp)[source]¶
Evaluate the node in a selected array namespace.
- Parameters:
t (scalar or array_like) – Evaluation times in ns.
xp (module) – NumPy-like array namespace.
- bands()[source]¶
Rewrite this subtree into carrier-normalized bands.
By default, a carrier-free subtree is exactly one zero-frequency band whose envelope is the subtree itself. Nodes whose subtrees can contain
Carrierleaves must override this with their carrier algebra (seedecompose_carrier_bands()).
- class quchip.engine.ir.Constant(value: 'complex')[source]¶
Bases:
SignalNode
- class quchip.engine.ir.EnvelopeRef(envelope)[source]¶
Bases:
SignalNodeReference to a pulse envelope evaluated at local time.
- class quchip.engine.ir.CoefficientRef(coefficient)[source]¶
Bases:
SignalNodeInternal signal leaf backed by a public component-owned coefficient.
- coefficient: TimeCoefficient¶
- class quchip.engine.ir.Window(child, start, stop)[source]¶
Bases:
SignalNodeGate child to
[start, stop]; zero outside.- child: SignalNode¶
- class quchip.engine.ir.Shift(child, delta_t)[source]¶
Bases:
SignalNodeTime-shift child by
delta_t:child(t - delta_t).- child: SignalNode¶
- class quchip.engine.ir.Scale(child, factor)[source]¶
Bases:
SignalNodeMultiply child by a complex scalar
factor.- child: SignalNode¶
- class quchip.engine.ir.PolarScale(child, amplitude, theta)[source]¶
Bases:
SignalNodeScale child by
amplitude * exp(i * theta)(both are pytree leaves).- child: SignalNode¶
- class quchip.engine.ir.Add(children: 'tuple[SignalNode, ...]')[source]¶
Bases:
SignalNode- children: tuple[SignalNode, ...]¶
- class quchip.engine.ir.Multiply(children: 'tuple[SignalNode, ...]')[source]¶
Bases:
SignalNode- children: tuple[SignalNode, ...]¶
- class quchip.engine.ir.Conjugate(child: 'SignalNode')[source]¶
Bases:
SignalNode- child: SignalNode¶
- class quchip.engine.ir.RealPart(child: 'SignalNode')[source]¶
Bases:
SignalNode- child: SignalNode¶
- class quchip.engine.ir.ImagPart(child)[source]¶
Bases:
SignalNodeImaginary quadrature of a complex analytic signal.
- child: SignalNode¶
- class quchip.engine.ir.SignalPower(child, exponent)[source]¶
Bases:
SignalNodePointwise power of a scalar signal program.
- child: SignalNode¶
- evaluate(t, *, xp)[source]¶
Evaluate the node in a selected array namespace.
- Parameters:
t (scalar or array_like) – Evaluation times in ns.
xp (module) – NumPy-like array namespace.
- bands()[source]¶
Rewrite this subtree into carrier-normalized bands.
By default, a carrier-free subtree is exactly one zero-frequency band whose envelope is the subtree itself. Nodes whose subtrees can contain
Carrierleaves must override this with their carrier algebra (seedecompose_carrier_bands()).
- class quchip.engine.ir.Carrier(freq, sign=-1)[source]¶
Bases:
SignalNodeOscillating carrier
exp(sign · i · freq · t).freqis in angular units (rad/ns). The defaultsign = -1matches the rotating-frame decomposition convention (Scully & Zubairy, Quantum Optics, §5). In this convention, a raising-type band on a+Δdetuning rotates asexp(−iΔt). Both fields are registered as pytree children.freqcan be traced, butsignis semantically a static±1, so do not map over it.- Variables:
freq (scalar) – Angular carrier frequency in rad/ns.
sign ({-1, 1}) – Sign in the complex exponential.
- quchip.engine.ir.SignalProgram¶
alias of
SignalNode
- class quchip.engine.ir.ScalarModulation(signal)[source]¶
Bases:
objectMark a
SignalProgramas a scalar modulation.- Variables:
signal (SignalProgram) – Backend-neutral scalar time dependence.
- signal: SignalNode¶
- quchip.engine.ir.signal_children(node)[source]¶
Return the
SignalProgramchild nodes of node.Dispatches to
SignalNode.signal_children(). AScalarModulationwrapper contributes itssignal.EnvelopeRef.envelopeis anEnvelope, not aSignalProgramchild, and so is not returned here.
- quchip.engine.ir.signal_window_bounds(signal, shift=0.0)[source]¶
Return absolute window edges, and keep native values and batch axes.
Enclosing shifts move every descendant window’s clock. Collecting the structure makes no numerical decisions, so timing stays differentiable.
- quchip.engine.ir.evaluate_signal_program(signal, t, *, xp=None)[source]¶
Evaluate a signal program at time(s) t (ns); xp defaults to NumPy.
- quchip.engine.ir.simplify_signal(signal)[source]¶
Recursively simplify a signal program by canceling exact opposing carrier pairs.
- class quchip.engine.ir.CarrierBand(envelope, freq)[source]¶
Bases:
objectOne band of a carrier-normalized signal:
envelope(t) · exp(i · freq · t).decompose_carrier_bands()rewrites anySignalPrograminto a sum of these bands. Eachenvelopeis carrier-free (noCarrierleaves) and therefore slow.freqis the angular band frequency (rad/ns, sign folded in, JAX-traceable). Backends use this to keep the fast oscillation analytic and sample only the slow envelope. Unlike pre-sampling the whole product, this is exact for every carrier, resonant or not.- envelope: SignalNode¶
- quchip.engine.ir.decompose_carrier_bands(signal)[source]¶
Rewrite signal into
Σ_k envelope_k(t) · exp(i · freq_k · t)with carrier-free envelopes.It is the scalar-coefficient analogue of the operator band decomposition in
quchip.engine.bands. EveryCarrierleaf is pulled out into a band frequency, leaving a slow, carrier-freeenvelopefor each band. The rewrite is exact and follows the carrier algebra, implemented node-locally in eachSignalNode.bands():Carrier(freq, sign)→ one band(1, sign·freq).Conjugate→ conjugate the envelope, flip the band frequency.RealPart→ split each band into±freq(Re z = (z+z̄)/2).Multiply→ frequency convolution (Cartesian product of bands).Add→ concatenate bands.Scale/PolarScale/Window/Shift→ distribute over bands (Shiftalso contributes the constant phaseexp(-i·freq·Δt)).
All frequency arithmetic stays in JAX-traceable terms (no
float(), no branching on traced values).
- class quchip.engine.ir.CanonicalOperator(layout, values, shape, dims, basis, subsystem_labels, indices=None, indptr=None, offsets=None, tag=None)[source]¶
Bases:
objectBackend-free operator with explicit dense/CSR/DIA payload and subsystem metadata.
For
dense, the payload is the full 2D matrix. Forcsr, it is the 1D nonzero value array paired withindices/indptr. Fordia, it is a 2D(n_diags, n_cols)array paired withoffsets.dimsmust multiply toshape[0]andsubsystem_labelsnames each subsystem.- Variables:
- classmethod from_dense(values, *, dims, basis, subsystem_labels, tag=None)[source]¶
Build a dense canonical operator.
- classmethod from_csr(values, indices, indptr, *, shape, dims, basis, subsystem_labels, tag=None)[source]¶
Build a CSR canonical operator.
- classmethod from_dia(values, offsets, *, shape, dims, basis, subsystem_labels, tag=None)[source]¶
Build a DIA canonical operator.
- with_metadata(*, dims=None, basis=None, subsystem_labels=None, tag=None)[source]¶
Return a metadata-adjusted copy with unchanged payload.
- scaled(factor, *, tag=None)[source]¶
Return a scalar multiple without changing the operator layout.
- Parameters:
factor (scalar) – Multiplier applied to the payload.
tag (str or None, optional) – Replacement diagnostic label.
- to_dense()[source]¶
Materialize the payload as a dense
shape-sized matrix.Vectorized and array-namespace-preserving (JAX-safe). A traced JAX payload yields a JAX array through
.at[].set/.add. A concrete NumPy payload yields a NumPy array. Callers that need a guaranteed concrete NumPy matrix must wrap the result innp.asarray(..., dtype=complex)themselves.
- fingerprint()[source]¶
Batching key: value-sensitive, with an automatic tracer-safe fallback.
Two crosstalk-rebuilt operators carrying the same coefficients collapse to the same key so they batch into one solve slot. Under
jax.jit, the payload is a tracer, possibly hidden inside a backend qarray wrapper such as a sparse-DIA dynamiqsQArray.contains_tracer()detects this case, and the key falls back to layout + shape/dtype structure only, sotobytes()is never called on a tracer. Two equivalent traced operators in different batch slots still produce identical keys.
- class quchip.engine.ir.StaticTerm(operator, coefficient=1.0, origin='device', metadata=<factory>)[source]¶
Bases:
objectTime-independent Hamiltonian contribution.
Engine assembly scales the
operatorpayload by 2π, so backends must not re-apply it.coefficientmultipliesoperatorand can be a concrete scalar or a JAX tracer (for example, sweeps over static couplings or detunings).originis purely advisory metadata.- Variables:
operator (CanonicalOperator) – Angular-frequency operator payload.
coefficient (scalar) – Scalar multiplier, default one.
origin (str) – Component category that authored the term.
metadata (dict) – Advisory term metadata.
- operator: CanonicalOperator¶
- class quchip.engine.ir.DynamicTerm(operator, time_dependence, origin='drive', tag=None)[source]¶
Bases:
objectTime-dependent Hamiltonian contribution
operator · f(t).f(t)is wrapped inScalarModulation, which each backend lowers into its native coefficient representation (for example, a QuTiP callback or a dynamiqs sampled array). Theoperatoris 2π-scaled already (see module docstring).tagis an optional human label that does not participate in physics.- Variables:
operator (CanonicalOperator) – Angular-frequency operator payload.
time_dependence (ScalarModulation) – Scalar coefficient evaluated in time.
origin (str) – Component category that authored the term.
tag (str or None) – Optional diagnostic label.
- operator: CanonicalOperator¶
- time_dependence: ScalarModulation¶
- class quchip.engine.ir.CollapseTerm(operator, rate, source, channel, parameter_paths=(), phase=None, frame_frequency=None)[source]¶
Bases:
objectBackend-neutral Lindblad channel, optionally exposed as a port.
- Variables:
operator (CanonicalOperator) – Dimensionless local jump operator before rate scaling.
rate (scalar) – Lindblad rate in
1/ns.channel (source,) – Owning component and local channel labels.
parameter_paths (tuple of str) – Parameter paths controlling the channel.
phase (scalar or None) – Coupling phase in radians.
frame_frequency (scalar or None) – Accessible-channel carrier in GHz;
Nonemarks a hidden channel.
- operator: CanonicalOperator¶
- class quchip.engine.ir.HamiltonianProgram(static_terms=(), dynamic_terms=())[source]¶
Bases:
objectResolved static and time-dependent Hamiltonian contributions.
- Variables:
static_terms (tuple of StaticTerm) – Time-independent contributions.
dynamic_terms (tuple of DynamicTerm) – Time-dependent contributions.
- static_terms: tuple[StaticTerm, ...] = ()¶
- dynamic_terms: tuple[DynamicTerm, ...] = ()¶
- class quchip.engine.ir.SLHChannel(key, accessibility, collapse, coupling_operator=None, reference=<factory>, input_occupation=None)[source]¶
Bases:
objectOne resolved Markov channel and its boundary accessibility.
- Variables:
key (str) – Unique resolved channel key.
accessibility ({"exposed", "hidden"}) – If the channel reaches the modeled experiment boundary.
collapse (CollapseTerm) – Component-authored channel record.
coupling_operator (CanonicalOperator or None) – Resolved physical coupling operator, when already composed.
reference (ReferencePlane) – External reference-plane transfer.
input_occupation (scalar or None) – Markov input occupation for a thermal field.
- collapse: CollapseTerm¶
- coupling_operator: CanonicalOperator | None = None¶
- reference: ReferencePlane¶
- property coupling: CanonicalOperator¶
Return the physical coupling operator for this channel.
- property collapse_term: CollapseTerm¶
Return the solver-facing collapse record for this resolved channel.
- class quchip.engine.ir.ResolvedSLH(scattering, hamiltonian, channels=(), support=None, output_network=None)[source]¶
Bases:
objectImmutable, input-free normal form for resolved Markovian physics.
- Variables:
scattering (array_like) – Unitary scalar channel matrix
S.hamiltonian (HamiltonianProgram) – Resolved Hamiltonian
H.channels (tuple of SLHChannel) – Coupling channels
Lin scattering order.support (array_like or None) – Boolean structural reachability matrix.
output_network (object or None) – Captured external output processing.
Notes
See Physics reference for the SLH composition and channel conventions.
- hamiltonian: HamiltonianProgram¶
- channels: tuple[SLHChannel, ...] = ()¶
- property has_network_hamiltonian: bool¶
Return if connection resolution generated coherent Hamiltonian terms.
- classmethod from_terms(*, static_terms, dynamic_terms, collapse_terms)[source]¶
Build an identity-scattering model from engine terms.
- Parameters:
static_terms (tuple of StaticTerm) – Static Hamiltonian contributions.
dynamic_terms (tuple of DynamicTerm) – Dynamic Hamiltonian contributions.
collapse_terms (tuple of CollapseTerm) – Component-authored Lindblad channels.
- property L: tuple[CanonicalOperator, ...]¶
Return physical coupling operators in channel order.
- property H: HamiltonianProgram¶
Return the resolved Hamiltonian program.
- property external_channels: tuple[SLHChannel, ...]¶
Return the exposed boundary channels.
Return channels traced out by the modeled experiment.
- property collapse_terms: tuple[CollapseTerm, ...]¶
Return solver-facing collapse records in resolved channel order.
- class quchip.engine.ir.DroppedTerm(source, operator, reason, band_weights=None, amplitude=None, frequency=None, frame_frequency=None)[source]¶
Bases:
objectAdvisory record for a Hamiltonian term elided by an approximation.
For static interactions,
amplitudeandfrequencyidentify the entry with the largest|V|²/|E_col - E_row|in isolated energy coordinates. This perturbative scale is a heuristic, not an error bound. A nonzero entry at zero detuning is resonant. Its scale is infinite. A zero amplitude contributes no shift. Numeric fields use ordinary GHz and can be traced. The selected entry can change as parameters vary.- Parameters:
source (str) – Label of the owning component (coupling / drive / …) that dropped the term.
operator (str) – Human-readable operator string (for example
"a_q0 · a_q1").reason (str) – Short reason (for example
"discarded by RWA band selection").band_weights (tuple[int, ...] | None) – Energy-index weights
column - row, one per supported device in the owner’s declared order (for example(1, 1)fora·b). Lowering has positive weight, opposite to the level change.Nonewhen not applicable.amplitude (Any | None) – Magnitude of the selected static matrix element in GHz, possibly traced.
Nonefor time-dependent terms or unknown amplitudes.frequency (Any | None) – Absolute bare-energy detuning of that same entry in GHz, independent of the frame and possibly traced. Zero denotes resonance.
Nonewhen unknown, including general time-dependent terms.frame_frequency (Any | None) – Absolute frame carrier in GHz, possibly traced. For a scheduled drive this includes its dropped signal partner.
Nonewhen unknown. This carrier is not a physical transition detuning.
- class quchip.engine.ir.BoundCoherentInput(exposure, source_label, beta, reference_beta)[source]¶
Bases:
objectOne solve-bound incident field, kept outside input-free SLH.
reference_betais the signal scheduled at the authored external reference plane.betais shifted by the total duration of the exposure’s inbound reference run and is the field composed with the Markov boundary.- beta: SignalNode¶
- reference_beta: SignalNode¶
- class quchip.engine.ir.EngineResult(slh, applied_hamiltonian=<factory>, coherent_inputs=(), dims=(), metadata=<factory>, dropped_terms=(), bases=<factory>, authored=None, resolved_frame=None, approximation=None, dynamical_supports=(), dissipation=True, excitation_space=None, _dressing_context=None)[source]¶
Bases:
objectBackend-neutral resolved physics passed to backends.
Represents
\[H(t) \;=\; \sum_s c_s \, O_s \;+\; \sum_d O_d \, f_d(t)\]slhis the input-free Markov model.applied_hamiltonianholds scheduled controls and solve-bound coherent drives. Operators already include the 2π conversion. Backends can usemetadataintegration hints but remain responsible for resolving finite-support dynamics.dropped_termsis advisory approximation metadata.- Variables:
slh (ResolvedSLH) – Input-free resolved scattering, Hamiltonian, and channel description.
applied_hamiltonian (HamiltonianProgram) – Solve-bound static and dynamic terms added after the input-free model.
coherent_inputs (tuple) – Captured coherent source bindings used to assemble those terms.
dims (tuple of int) – Solver dimensions. A compact solve uses one coordinate axis. Physical dimensions remain in excitation_space and in the public result.
excitation_space (object or None) – Captured exact excitation coordinate map. None denotes product coordinates.
metadata (dict) – Advisory solver hints, with frequencies in GHz and time scales in ns.
dropped_terms (tuple of DroppedTerm) – Terms removed by the selected approximation, kept for diagnostics.
bases (mapping) – Per-device authored-to-solver basis records.
authored (object or None) – Captured authored physics description.
resolved_frame (ResolvedFrame) – Frame frequencies and demodulation convention used by assembly.
approximation (Approximation or None) – Approximation captured by this resolved snapshot.
dynamical_supports (tuple of tuple of str) – Device groups coupled by kept dynamical terms.
dissipation (bool) – If
collapse_termsexposes the resolved dissipators.
- slh: ResolvedSLH¶
- applied_hamiltonian: HamiltonianProgram¶
- coherent_inputs: tuple[BoundCoherentInput, ...] = ()¶
- dropped_terms: tuple[DroppedTerm, ...] = ()¶
- property static_terms: tuple[StaticTerm, ...]¶
Return resolved and solve-applied static Hamiltonian terms.
- property dynamic_terms: tuple[DynamicTerm, ...]¶
Return resolved and solve-applied time-dependent Hamiltonian terms.
- property collapse_terms: tuple[CollapseTerm, ...]¶
Return active collapse records in SLH channel order.
- dress(*, at_time=None, overlap_threshold=0.5, labeling='DE')[source]¶
Dress this resolved Hamiltonian, optionally at one instant.
Unlike
Chip.dress, this method analyzes the selected frame and approximation stored in this snapshot. A snapshot with dynamic Hamiltonian terms requiresat_time. The result is an instantaneous eigensystem, not a Floquet analysis. A compact pulse snapshot analyzes only its retained invariant space. Its eigenstates use those compact solver coordinates.
- with_applied_hamiltonian_terms(*, static_terms=None, dynamic_terms=None)[source]¶
Return a copy with solve-bound Hamiltonian terms replaced.
- Parameters:
static_terms (tuple of StaticTerm or None, optional) – Replacement static terms.
Nonekeeps them.dynamic_terms (tuple of DynamicTerm or None, optional) – Replacement dynamic terms.
Nonekeeps them.
- property port_terms: tuple[CollapseTerm, ...]¶
Return active collapse channels that cross an accessible port boundary.
- hamiltonian()[source]¶
Return the exact canonical Hamiltonian as an inspectable expression.
This view derives from the same terms backends receive. Matrix leaves remain opaque, while each dynamic coefficient renders as a named function of time.
- dropped_terms_summary()[source]¶
Format
dropped_termsas a multi-line human-readable string.Traced numeric values print as
tracedand are not concretized.
- class quchip.engine.ir.HamiltonianTemplate(base_result, drive_terms=(), coherent_terms=(), reference_drive_ops=(), delivered_keys=frozenset({}))[source]¶
Bases:
objectCaptured chip physics and pre-embedded bands for homogeneous drive sweeps.
base_resultowns invariant operators, channels, bases and diagnostics. Reference operations and delivered keys guard the routing and pulse topology. Only signal-program leaves are rebuilt for each variant.- base_result: EngineResult¶
- class quchip.engine.ir.ResolvedFrame(frequencies, demod_freqs, mode, plan=None)[source]¶
Bases:
objectResolved per-device frame information.
Describes the rotating-frame transformation applied uniformly to the chip. The static Hamiltonian gets the counter-term
−Σᵢ ω_frame,ᵢ nᵢ, and solves and results keep states in this integration frame.- Variables:
frequencies (dict) – Integration-frame frequency
ω_frameof each device label, in GHz.demod_freqs (dict) –
reference_freq − ω_frameof each device label, in GHz. After the solve, this frequency rotates expectations back into the user’s control frame.reference_freqis the device attribute (seereference_freq), which defaults to the dressed drive frequency.mode (str) – One of
"lab","rotating","auto","float"and"dict".plan (FramePlan or None) – The
FramePlanselected for"auto", or None for an explicit frame.
- class quchip.engine.ir.SolveProblem(chip, engine_result, initial_state, tlist, e_ops=None, e_ops_meta=None, resolved_frame=None, solver=None, options=<factory>, *, truncation=None, states=None, run_args=<factory>, monitoring=None, backend=None, device_info=())[source]¶
Bases:
objectImmutable simulation request handed from the chip pipeline to a backend.
Backend selection is captured separately from
options.e_ops_metareconstructs flattened band expectations into public dict-keyed observables.- Variables:
chip (Chip) – Source chip captured by the request.
engine_result (EngineResult) – Frozen resolved physics.
initial_state (state_like) – Initial ket or density matrix in solver coordinates.
tlist (array_like) – Solver times in ns.
e_ops (sequence or None) – Backend-ready expectation operators.
e_ops_meta (object or None) – Metadata used to reconstruct public observables.
resolved_frame (ResolvedFrame) – Captured integration and demodulation frame.
solver (str or None) – Explicit solver selection.
options (dict) – Backend solver options. A
"backend"key is rejected.run_args (dict) – Native trajectory call keywords, separate from integrator options.
monitoring (dict or None) – Captured channel-index to (efficiency, phase) selection; prepare with_monitoring().
truncation (object or None) – Captured boundary-population plan.
states ({"all", "final", "none"} or None) – None keeps native stochastic defaults. Deterministic requests resolve it to all.
backend (Backend) – Captured backend owner.
device_info (tuple) – Device labels and computational flags in subsystem order.
- solver_name(backend)[source]¶
Return the selected solver name.
An explicit
solvertakes precedence, butsesolveis rejected for a density matrix. Otherwise, selectsesolveonly for a ket with no collapse terms, andmesolvefor a density matrix or any problem with collapse terms.- Parameters:
backend (Backend) – Backend used to classify the initial state.
- class quchip.engine.ir.LinearResponseProblem(frequencies, mode_labels, hamiltonian, couplings, scattering, plane_indices, inbound_transfer, outbound_transfer, field_channels=())[source]¶
Bases:
objectPassive-linear input-output request handed to a backend.
hamiltonianis the number-conserving mode matrix in angular units. For a weak probe of an excitation-conserving chip, it is the chip’s one-excitation block, which can carry a non-Hermitian part from number-conserving channels.couplingsstacks the channel rows ofL = C a.scatteringis the complete instantaneous SLH matrix, including hidden vacuum and loss channels. Frequencies remain ordinary GHz at the public boundary.plane_indicesselects the external channels used as matrix rows and columns.inbound_transferandoutbound_transfercontain the per-frequency reference factors for each external channel. Backends return the undecorated Markov response, and the engine applies both factors.- Variables:
frequencies (array_like) – Probe frequencies in GHz.
mode_labels (tuple of str) – Linear Fock modes, or the devices whose first excited levels span the one-excitation states, in matrix order.
hamiltonian (array_like) – Number-conserving mode matrix in rad/ns.
couplings (array_like) – Channel-to-mode coupling matrix in
1/sqrt(ns).scattering (array_like) – Instantaneous SLH scattering matrix.
plane_indices (tuple of int) – External channel indices used for result rows and columns.
outbound_transfer (inbound_transfer,) – Frequency-dependent external reference factors.
field_channels (tuple of FieldChannel) – Captured input field states.
- field_channels: tuple[FieldChannel, ...] = ()¶
- class quchip.engine.ir.CoherenceResponseProblem(frequencies, hamiltonians, lowering, conserving, sources, scattering, plane_indices, inbound_transfer, outbound_transfer)[source]¶
Bases:
objectFrequency response on adjacent excitation-sector coherences.
- Variables:
frequencies (array_like) – Probe frequencies in GHz.
hamiltonians (tuple of array_like) – Sector Hamiltonians in rad/ns, ordered by excitation number from zero.
lowering (tuple of array_like) – Channel blocks from N to N-1, shaped (channels, d[N-1], d[N]). Entry zero is unused and has zero rows.
conserving (tuple of array_like) – Number-conserving channel blocks, shaped (conserving_channels, d[N], d[N]).
sources (tuple of array_like) – Negative probe commutators on (N,N-1), shaped (d[N], d[N-1], inputs). Entry zero is unused and has zero columns.
scattering (array_like) – Complete instantaneous SLH scattering matrix.
plane_indices (tuple of int) – Selected external channels in input and output order.
outbound_transfer (inbound_transfer,) – Reference-plane transfer factors, shaped (frequencies, channels).
- class quchip.engine.ir.SteadyStateProblem(chip, engine_result, e_ops=None, e_ops_meta=None, resolved_frame=None, options=<factory>, *, backend=None, device_info=())[source]¶
Bases:
objectImmutable static Lindblad request handed from a chip to its backend.
- Variables:
chip (Chip) – Source chip captured by the request.
engine_result (EngineResult) – Frozen static resolved physics.
e_ops (sequence or None) – Backend-ready expectation operators.
e_ops_meta (object or None) – Metadata used to reconstruct public observables.
resolved_frame (ResolvedFrame) – Captured stationary frame.
options (dict) – Backend solver options.
backend (Backend) – Captured backend owner.
device_info (tuple) – Device labels and computational flags in subsystem order.
- engine_result: EngineResult¶
- class quchip.engine.ir.SolveBatch(chip, problems, params=None, shape=(), axes=(), _failure_context=())[source]¶
Bases:
objectExplicit solve problems sharing one dispatch owner and sweep shape.
- Variables:
- problems: tuple[SolveProblem, ...]¶
Return if every point has the same captured time grid.
- signals_for(slot)[source]¶
Return one dynamic slot across all batch points.
- Parameters:
slot (int) – Dynamic-term index.
- class quchip.engine.ir.DriveOp(target_label, envelope, freq=None, start_time=0.0, phase_offset=0.0, drive_label='', frame=None, detuning=None)[source]¶
Bases:
objectDrive operation scheduled on a device or a modulable coupling.
freqis in GHz.Noneselects flux drive (or baseband edge pump).start_timeandphase_offsetapply in the control frame.drive_labelresolves the drive in the chip’s control equipment (for example"charge_0").target_labelresolves in the chip’s device or coupling label space.framenames the device whose accumulated virtual-Z phasephase_offsetincludes, or isNone. The phase is already inphase_offset, so the engine does not readframe.detuningis a carrier offset in GHz, referenced tostart_time, orNonefor no offset.The pulse window keeps its absolute scheduled time. A solve can select a partial interval, and a window wholly outside it or touching only an endpoint contributes no evolution.
- class quchip.engine.ir.CoherentOp(coherent_input, envelope, freq=None, start_time=0.0, phase_offset=0.0, frame=None, detuning=None)[source]¶
Bases:
objectCoherent field operation scheduled on an external SLH exposure.
The fields follow
DriveOp.frameisNoneunless the schedule names a device frame for this input.- coherent_input: Any¶