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

EndpointOps

LocalOps(label, levels)

Declarative operator namespace for one local Hilbert space endpoint.

class quchip.declarative.ops.LocalOps(label, levels)[source]

Bases: object

Declarative operator namespace for one local Hilbert space endpoint.

Passed as op to DeviceModel.local_hamiltonian() and as the two endpoints a, b to CouplingModel.interaction(). Each property returns a PhysicsExpr that 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'
Parameters:
label: str
levels: int
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.

quchip.declarative.ops.EndpointOps

alias of LocalOps