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_occupation=None)[source]¶
Bases:
DeviceModelTwo-level spin with a user-defined local operator vocabulary.
The local Hamiltonian is \(H=-\omega\sigma_z/2\), with ordinary frequency
freqin GHz.- Parameters:
freq (float) – Transition frequency \(\omega\) in GHz. Must be positive.
basis ({None, "native", "eigen"}, keyword-only) – Solver basis request.
Noneuses 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.
Nonedisables 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.
Nonedisables 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.
- freq: Scalar = Parameter(default=unbound, positive=True, nonnegative=False, serialize=True, unit='GHz', symbol='\\omega', noise=False, kw_only=False, required=False)¶
- 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,Iand the Pauli handles as composablePhysicsExprnodes.p (ParameterNamespace) – Symbolic leaves for this model’s declared parameters.
- Returns:
The local Hamiltonian expression, in ordinary-frequency units (GHz).
- Return type:
- 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.