quchip.extensions.spaces

Reference device authored on a custom local operator space.

Classes

SpinHalf([freq, basis, levels, label, T1, ...])

Two-level spin with a user-defined local operator vocabulary.

class quchip.extensions.spaces.SpinHalf(freq=unbound, *, basis=None, levels=2, label=None, T1=None, T2=None, thermal_population=None)[source]

Bases: DeviceModel

Two-level spin with a user-defined local operator vocabulary.

computational = True

Whether this device represents a computational qubit, as opposed to e.g. a bus resonator or a coupler element.

approximation = 'Exact two-level spin Hamiltonian in a fixed custom basis.'

Declared approximation-regime statement surfaced by physics_notes() — the mechanism that keeps a model’s stated validity range attached to the class rather than buried in a docstring a caller may not read.

basis: Literal['native', 'eigen'] | None = Setting(default=None, serialize=True, kw_only=True)
freq: Scalar = Parameter(default=unbound, positive=True, nonnegative=False, serialize=True, unit='GHz', symbol='\\omega', noise=False, kw_only=False, required=False)
local_space()[source]

Return this device’s authored local operator space.

Return type:

CustomSpace

validate()[source]

Cross-field validation hook, run at the end of construction.

Default is a no-op. Subclasses override to enforce constraints that span multiple declared parameters (e.g. 2 * edge <= duration). Checks must be gated on concrete scalars via quchip.utils.jax_utils.maybe_concrete_scalar() so traced parameters never force concretization.

Return type:

None

local_hamiltonian(op, p)[source]

Return this device’s local Hamiltonian as a declarative expression.

Parameters:
  • op (LocalOps) – Operator namespace for this device’s endpoint, exposing a, adag, n, I and the Pauli handles as composable PhysicsExpr nodes.

  • p (ParameterNamespace) – Symbolic leaves for the parameters declared on this model.

Returns:

The local Hamiltonian expression, in ordinary-frequency units (GHz).

Return type:

PhysicsExpr

charge_coupling_operator()[source]
Return type:

Any

tunable_param_names = ('freq',)

Bare parameters this device exposes as differentiable / tunable scalars. fit_a_dress walks this tuple to discover what it is allowed to optimize on each device, decoupling the inverse-design surface from any specific device model. Three states, keyed on whether the value is explicitly declared:

  • No explicit declaration anywhere in the DeviceModel lineage — the default is derived: every declared parameter() field, in declaration order (see DeviceModel.__init_subclass__).

  • Explicit tuple on the class or an ancestor — exact curation, validated at class-definition time; authoritative and inherited until a subclass explicitly replaces it.

  • Explicit empty tuple — deliberately freezes the device (and its subclasses, until one replaces it) out of inverse design.

On a plain (non-DeviceModel) BaseDevice subclass there is no derivation; the default stays empty unless the subclass declares its own tuple — e.g. Fluxonium uses ("E_C", "E_J", "E_L", "phi_ext").