quchip.extensions.spaces¶
Reference device authored on a custom local operator space.
Classes
|
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:
DeviceModelTwo-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.
- freq: Scalar = Parameter(default=unbound, positive=True, nonnegative=False, serialize=True, unit='GHz', symbol='\\omega', noise=False, kw_only=False, required=False)¶
- 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 viaquchip.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,Iand the Pauli handles as composablePhysicsExprnodes.p (ParameterNamespace) – Symbolic leaves for the parameters declared on this model.
- Returns:
The local Hamiltonian expression, in ordinary-frequency units (GHz).
- Return type:
- tunable_param_names = ('freq',)¶
Bare parameters this device exposes as differentiable / tunable scalars.
fit_a_dresswalks 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
DeviceModellineage — the default is derived: every declaredparameter()field, in declaration order (seeDeviceModel.__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)BaseDevicesubclass there is no derivation; the default stays empty unless the subclass declares its own tuple — e.g.Fluxoniumuses("E_C", "E_J", "E_L", "phi_ext").