quchip.engine.states¶
State preparation in the solver basis.
Product states from energy labels or authored local kets, authored states of the full chip, the dressed initial state of a label, and reusable states in captured excitation coordinates. The chip’s state queries and the solve problems call these functions.
Functions
|
Resolve each local ket without allocating its tensor product. |
|
Build a product state from the shared local state preparation. |
|
Return the static block model of |
|
Prepare a normalized state on the excitation totals of its components. |
|
Validate captured coordinates before interpreting a saved energy state. |
|
Return the product label of a level mapping or state shorthand, in device order. |
|
Return the dressed state of a label at the start of a solve, in the solve's coordinates and frame. |
|
Prepare an initial state in the coordinates of an exact pulse space. |
|
Materialize one authored state specification in the engine's solver basis. |
|
Return the dressed eigenstate assigned to a label in the rows of an excitation space. |
Classes
|
Keep a ket or density matrix without expanding its product coordinates. |
|
Prepare the label targets of one solve from a snapshot of its chip. |
- quchip.engine.states.bare_state_from_bases(chip, resolved, bases)[source]¶
Build a product state from the shared local state preparation.
- quchip.engine.states.bare_local_kets(chip, resolved, bases)[source]¶
Resolve each local ket without allocating its tensor product.
- quchip.engine.states.label_levels(chip, spec, dims, *, role='An initial label')[source]¶
Return the product label of a level mapping or state shorthand, in device order.
Devices without a level are in level 0. A mapping that holds a local ket is not a label, and
chip.bare_statetakes it.
- quchip.engine.states.label_state(chip, spec, result, start)[source]¶
Return the dressed state of a label at the start of a solve, in the solve’s coordinates and frame.
The state is the eigenstate
|d_k⟩assigned to label k of the undriven static lab-frame model thatresult.approximationkeeps, with real, nonnegative overlap on the bare product|k⟩, aschip.state()assigns it. Under an excitation cutoff the model is the truncatedP H P. The frame map places the state atstartas the label target ofoverlap():U(start)†|d_k⟩ exp(−i 2π start Σᵢ fᵢ kᵢ). The labels of an uncoupled chip start in|k⟩in every frame.- Parameters:
chip (Chip) – Chip whose static model defines the state.
spec (mapping, str, or None) – Level label. None is the all-ground label.
result (EngineResult) – Solve contract with the frame, approximation, bases, and excitation space.
start (scalar) – Start time of the solve, in ns.
- Returns:
Native backend ket in the coordinates of the solve.
- Return type:
- quchip.engine.states.materialize_state_spec(chip, state_spec, bases)[source]¶
Materialize one authored state specification in the engine’s solver basis.
Labels and an omitted state are dressed states, which
label_state()prepares from the solve’s engine result.
- class quchip.engine.states.CompactState(values, space)[source]¶
Bases:
objectKeep a ket or density matrix without expanding its product coordinates.
Create this value with
chip.compact_stateorresult.compact_state. Pass it asinitial_stateto a later simulation of the same device bases. Numerical arrays are JAX pytree leaves.- Parameters:
values (array_like) – Ket columns or density matrix in the captured excitation space.
space (object) – Captured coordinate map, supplied by the state factory.
- space: PulseSpace¶
- quchip.engine.states.compact_state(chip, *components, dressed=True)[source]¶
Prepare a normalized state on the excitation totals of its components.
- Parameters:
chip (Chip) – Chip whose resolved energy bases define the coordinates.
*components (mapping, str, or (amplitude, specification) pairs) – Energy-level labels, as in
Chip.compact_state. Withdressed=False, a mapping can also give a device a local ket.dressed (bool, default=True) – Use the static dressed eigenstate assigned to each label. False uses the bare product of each label.
- Returns:
Captured state accepted as a pulse simulation’s initial_state.
- Return type:
- quchip.engine.states.block_model(chip, approximation)[source]¶
Return the static block model of
approximation, or None when dressing needs the full eigensystem.Under an excitation cutoff, every chip has a block model. Without one, the static model must conserve the total energy-level index.
- Parameters:
chip (Chip) – Chip whose static model is split.
approximation (Approximation) – Approximation of the static model.
- quchip.engine.states.sector_label_ket(chip, model, space, levels)[source]¶
Return the dressed eigenstate assigned to a label in the rows of an excitation space.
The eigenvector comes from the block of
modelthat holds the label. Rows of the block outsidespaceare dropped, because the states of the solve have no amplitude there.- Parameters:
chip (Chip) – Chip whose backend sets the array module.
model (SectorModel) – Static block model of the solve’s approximation.
space (PulseSpace) – Excitation space of the solve.
levels (tuple of int) – Product label of local energy levels.
- class quchip.engine.states.LabelTargets(chip, approximation)[source]¶
Bases:
objectPrepare the label targets of one solve from a snapshot of its chip.
capture()takes an isolated clone when the solve finishes, so later changes to the source chip do not change the targets. The clone runs its dressed analysis only when a dressed target is requested.- Parameters:
chip (Chip) – Isolated clone of the solve’s chip.
approximation (Approximation) – Approximation of the solve’s static model.
- classmethod capture(chip, approximation)[source]¶
Record an isolated clone of a chip.
- Parameters:
chip (Chip) – Source chip of the solve.
approximation (Approximation) – Approximation of the solve’s static model.
- levels(spec, dims)[source]¶
Return the product label of a mapping or state shorthand, in device order.
- bare(levels, bases, space=None)[source]¶
Return the bare product state of a label, in solver coordinates or in the rows of
space.- Parameters:
levels (tuple of int) – Product label of local energy levels.
bases (mapping) – Resolved basis record of each device.
space (PulseSpace or None, optional) – Excitation space of the solve. A label outside it gives a zero vector.
- dressed(levels, bases, space=None)[source]¶
Return the lab-frame dressed eigenstate assigned to a label, as
bare()places it.The static model is the one that the solve’s approximation keeps. None means the all-ground label of a conserving model, whose bare product is the only state with total level 0.
- Parameters:
levels (tuple of int) – Product label of local energy levels.
bases (mapping) – Resolved basis record of each device.
space (PulseSpace or None, optional) – Excitation space of the solve.
- quchip.engine.states.compatible_values(state, labels, dims, bases, backend)[source]¶
Validate captured coordinates before interpreting a saved energy state.
- quchip.engine.states.materialize_compact(chip, spec, space)[source]¶
Prepare an initial state in the coordinates of an exact pulse space.
- Parameters:
chip (Chip) – Chip whose resolved energy bases define the state.
spec (state_like or CompactState) – Initial state.
label_state()prepares labels and an omitted state.space (PulseSpace) – Exact excitation space of the solve.
- Returns:
Native backend ket or density matrix in
spacecoordinates.- Return type: