quchip.engine.problem¶
Package engine physics and solve inputs into frozen solve requests.
Responsibilities¶
Resolve the chip frame.
Flatten
e_opsinto solver-ready bands withdecompose_eops().Build an
EngineResultfor each variant and pack into a singleSolveProblem, or merge homogeneous variants into aSolveBatch(Nidentical skeletons with per-elementScalarModulationsignals).
Collapse operators enter the standard Lindblad master equation
dρ/dt = −i[H, ρ] + Σₖ D[Lₖ]ρ. Rates are stored in 1/ns.
Functions
|
Package homogeneous |
|
Resolve, assemble, and package a frozen |
|
Resolve the frame and retain authored observables and state specifications. |
|
Group problems by shared operator skeleton and dispatch as :class:`SolveBatch`es. |
|
Validate every |
Classes
|
Shared solve metadata reused across a homogeneous problem batch. |
- class quchip.engine.problem.SolveProblemContext(chip, tlist, e_ops, e_ops_meta, resolved_frame, approximation, _base_result, solver, options, default_initial_state)[source]¶
Bases:
objectShared solve metadata reused across a homogeneous problem batch.
Built once by
prepare_solve_problem_context()so sweep points can skip redundant observable normalization.- Parameters:
chip (Chip)
tlist (Any)
e_ops (Any)
e_ops_meta (Any)
resolved_frame (Any)
approximation (Approximation)
_base_result (EngineResult | None)
solver (str | None)
default_initial_state (Any)
- tlist: Any¶
- e_ops: Any¶
- e_ops_meta: Any¶
- resolved_frame: Any¶
- approximation: Approximation¶
- default_initial_state: Any¶
- classmethod from_problem(ref)[source]¶
Reconstruct a shared context from an existing
SolveProblem.Mirrors
SolveBatch.element(): it lifts a single concrete problem back into the context shape so a homogeneous group of problems can be re-batched. The reference problem’s already-builtinitial_statebecomes the default state specification, andoptionsis defensively copied.- Parameters:
ref (SolveProblem)
- Return type:
- quchip.engine.problem.validate_drive_ops_window(drive_ops, tlist)[source]¶
Validate every
DriveOpin drive_ops against_validate_drive_op_window().
- quchip.engine.problem.prepare_solve_problem_context(chip, tlist, *, solver=None, options=None, e_ops=None, drive_ops=None, approximation=None)[source]¶
Resolve the frame and retain authored observables and state specifications.
Observables and states are materialized only after assembly resolves every local solver basis. The default ground state remains lazy, so callers that provide an explicit state do not pay for unused state construction.
tlistis validated by_validate_tlist(). When drive_ops is given, each entry’s pulse window is checked againsttlistviavalidate_drive_ops_window(); omit it (the default) when the caller validates its own per-variant drive ops elsewhere (seebuild_batch()).- Parameters:
- Return type:
- quchip.engine.problem.build_solve_batch_from_results(context, engine_results, *, initial_states=None)[source]¶
Package homogeneous
EngineResult`s as one :class:`SolveBatch.All results must share
static_termsidentity, the same number of dynamic terms, and matching operator payloads per slot (by identity or by canonical fingerprint — crosstalk rebuilds equal-by-value operators on every instantiation).initial_states=Nonefills every element withcontext.default_initial_state.- Parameters:
context (SolveProblemContext)
engine_results (list[EngineResult])
- Return type:
- quchip.engine.problem.build_solve_problem(chip, drive_ops, tlist, *, solver=None, options=None, e_ops=None, initial_state=None, approximation=None)[source]¶
Resolve, assemble, and package a frozen
SolveProblem.Equivalent to
prepare_solve_problem_context()followed bybuild_engine_result(). For many variants sharing one chip configuration, prefer that two-step form withbuild_solve_batch_from_results().- Parameters:
- Return type:
- quchip.engine.problem.solve_problem_list(problems, backend, *, progress=True)[source]¶
Group problems by shared operator skeleton and dispatch as :class:`SolveBatch`es.
Problems that share an operator skeleton are merged into one batched solve. A backend may dispatch a large heterogeneous list independently; otherwise each structural group follows the normal batch path, with incompatible results falling back to per-problem
backend.solve_problemcalls.Grouping uses two filters. The cheap identity-based prefilter here (
_skeleton_prefilter_key()) buckets problems byid()of their shared operators/metadata so that obviously-incompatible problems are never compared by value. The canonical by-value compatibility check is intentionally a separate concern that lives insidebuild_solve_batch_from_results()(operatorfingerprint): the prefilter is an identity prefilter, the fingerprint is the value check. Returns aSimulationBatchResult.- Parameters:
problems (list[SolveProblem])
backend (Any)
progress (bool)
- Return type: