quchip.chip.observables

Observable construction for Chip.

These helpers turn an operator specification into a backend-native operator embedded on the chip’s tensor-product space. The specification is a short name string (resolved off the device through BaseDevice.local_operator()), a raw local-space operator, or a raw full-space NumPy array.

The chip forwards its public observable surface (Chip.observable(), Chip.e_ops(), Chip.from_array()) here, and users usually call those chip methods instead.

Functions

e_ops(chip, *[, correlators])

Build a dict-form e_ops mapping for the solver pipeline.

from_array(chip, data[, device])

Build a backend operator from a raw NumPy array.

observable(chip, device, op)

Embed a device operator onto the full chip Hilbert space.

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=None the array must already span the full chip Hilbert space.

quchip.chip.observables.observable(chip, device, op)[source]

Embed a device operator onto the full chip Hilbert space.

Accepts an operator name ("X", "Y", "Z", "n", "a", "a_dag", "I") or an already-built local-space operator. Returns the operator embedded on the chip’s tensor-product space.

This function is for manual full-space operator construction and analysis. It is the named-operator counterpart of from_array(), together with operator_in_dressed_basis(). It is not a solver e_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. If you pass this embedded operator to simulate(e_ops=...), it is misread as a local device operator.

quchip.chip.observables.e_ops(chip, *, correlators=None, **specs)[source]

Build a dict-form e_ops mapping 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. Specify two-device correlators (e.g. ⟨Z₁⊗Z₂⟩) with correlators as device-label pairs → operator pairs. Returns local-space operators (not embedded), which the demodulation pipeline embeds as needed.