quchip.declarative.ops¶
Declarative operator-handle namespaces for the physics DSL.
LocalOps (aliased EndpointOps at coupling call sites)
exposes one Hilbert-space endpoint’s operators as composable
PhysicsExpr nodes.
Classes
|
Declarative operator namespace for one local Hilbert space endpoint. |
- class quchip.declarative.ops.LocalOps(label, levels)[source]¶
Bases:
objectDeclarative operator namespace for one local Hilbert space endpoint.
Passed as
optoDeviceModel.local_hamiltonian()and as the two endpointsa,btoCouplingModel.interaction(). Each property returns aPhysicsExprthat composes with+,-,@(same endpoint),*(scalar or tensor product).Examples
>>> from quchip.declarative import LocalOps >>> op = LocalOps(label="q", levels=3) >>> H = 5.0 * op.n + 0.5 * (op.adag @ op.adag @ op.a @ op.a) >>> H.kind 'add'
- property a: PhysicsExpr¶
Lowering operator for this endpoint.
- property adag: PhysicsExpr¶
Raising operator for this endpoint.
- property n: PhysicsExpr¶
Number operator for this endpoint.
- property I: PhysicsExpr¶
Identity operator for this endpoint.
- property x: PhysicsExpr¶
Unnormalized quadrature
x = a + a†(no 1/sqrt(2) factor).
- property sigma_x: PhysicsExpr¶
|0><1| + |1><0|on the computational|0>, |1>subspace of the truncated space.
- property sigma_y: PhysicsExpr¶
-i|0><1| + i|1><0|on the computational|0>, |1>subspace.
- property sigma_z: PhysicsExpr¶
|0><0| - |1><1|on the computational|0>, |1>subspace.
- property sigma_plus: PhysicsExpr¶
Raising operator
|1><0|on the computational subspace.
- property sigma_minus: PhysicsExpr¶
Lowering operator
|0><1|on the computational subspace.