quchip.chip.observables¶
Observable construction for Chip.
These helpers turn an operator specification — a short name string
(resolved off the device via BaseDevice.local_operator()), a raw
local-space operator, or a raw full-space NumPy array — into a
backend-native operator embedded on the chip’s tensor-product space.
The chip forwards its public observable surface (Chip.observable(),
Chip.e_ops(), Chip.from_array()) here; users normally call
the chip methods, not these functions directly. Module-level functions
(taking chip as the first argument) mirror
quchip.chip.serialization, since this group carries no per-chip
state of its own.
Functions
|
Build a dict-form |
|
Build a backend operator from a raw NumPy array. |
|
Embed a device operator onto the full chip Hilbert space. |
|
Resolve a string name to a device operator; pass non-strings through. |
- quchip.chip.observables.prepare_local_op(dev, spec)[source]¶
Resolve a string name to a device operator; pass non-strings through.
The operator-name vocabulary is owned by the device (
BaseDevice.local_operator()).- Parameters:
dev (BaseDevice)
- Return type:
- quchip.chip.observables.from_array(chip, data, device=None)[source]¶
Build a backend operator from a raw NumPy array.
With device, the array is interpreted as a local operator on that device’s subspace and embedded into the full tensor-product space. With
device=Nonethe array must already span the full chip Hilbert space.- Parameters:
chip (Chip)
data (Any)
device (str | BaseDevice | None)
- Return type:
Any
- quchip.chip.observables.observable(chip, device, op)[source]¶
Embed a device operator onto the full chip Hilbert space.
Accepts either an operator name (
"X","Y","Z","n","a","a_dag","I") or an already-built local-space operator, and returns it embedded on the chip’s tensor-product space.This is for manual full-space operator construction and analysis — the named-operator counterpart of
from_array(), alongsideoperator_in_dressed_basis(). It is not a solvere_op:e_ops()(Chip.e_ops) is the solver surface, and it keeps operators local so the demodulation pipeline can band-decompose and embed them correctly. Passing this embedded operator intosimulate(e_ops=...)would be misread as a local device operator.- Parameters:
chip (Chip)
device (str | BaseDevice)
op (str | Any)
- Return type:
Any
- quchip.chip.observables.e_ops(chip, *, correlators=None, **specs)[source]¶
Build a dict-form
e_opsmapping for the solver pipeline.Each keyword maps a device label to an operator specification: a name string, a list of names, a raw local-space operator, or a mixed list of strings and operators. Two-device correlators (e.g.
⟨Z₁⊗Z₂⟩) are specified via correlators as device-label pairs → operator pairs. Returns local-space operators (not embedded) — the demodulation pipeline embeds as needed.