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_occupation=None)[source]

Bases: DeviceModel

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

The local Hamiltonian is \(H=-\omega\sigma_z/2\), with ordinary frequency freq in GHz.

Parameters:
  • freq (float) – Transition frequency \(\omega\) in GHz. Must be positive.

  • basis ({None, "native", "eigen"}, keyword-only) – Solver basis request. None uses the chip default.

  • levels (int, default 2) – Must remain exactly 2.

  • label (str or None, default None) – Device label.

  • T1 (float or None, default None) – Energy-relaxation time in ns. None disables T1 relaxation.

  • T2 (float or None, default None) – Total 0-1 coherence time in ns. If both are set, T2 <= 2*T1.

  • thermal_occupation (float or None, default None) – Dimensionless mean bath occupation. None disables absorption.

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.

validate()[source]

Validate cross-field constraints at construction and grouped rebinding.

Subclasses implement their joint constraints here. Gate numerical checks on concrete scalars so traced parameters remain supported.

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. It exposes a, adag, n, I and the Pauli handles as composable PhysicsExpr nodes.

  • p (ParameterNamespace) – Symbolic leaves for this model’s declared parameters.

Returns:

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

Return type:

PhysicsExpr

charge_coupling_operator()[source]
lowering_operator()[source]

Return the spin’s declared downward transition.

raising_operator()[source]

Return the spin’s declared upward transition.

number_operator()[source]

Return the excited-state projector used by the T2 channel.

tunable_param_names = ('freq',)

Parameters eligible for inverse design. DeviceModel derives these from declared fields unless the class or an ancestor supplies a tuple. Explicit tuples remain authoritative when inherited; an empty tuple excludes the device from inverse design. Plain BaseDevice subclasses default to an empty tuple without derivation.