symop.core.operators¶
Operator primitives for mode and ladder-operator bookkeeping.
This module defines logical modes and their associated ladder operators, including signatures and commutation behavior based on overlaps.
A logical mode is represented by ModeOp, which is defined by a
composite mode label (typically including path, polarization, and envelope).
The generalized canonical commutation relations are implemented by
LadderOp using overlaps induced by the mode label.
Classes
|
A bosonic ladder operator bound to a specific logical mode. |
|
A logical mode, defined by a composite mode label. |
- class LadderOp(kind: OperatorKind, mode: ModeOp) None¶
Bases:
objectA bosonic ladder operator bound to a specific logical mode.
A
LadderOpis either an annihilation operator \(a\) or a creation operator \(a^\dagger\) acting on the mode specified bymode.The (generalized) canonical commutation relations used here are determined by the overlap of the logical modes. For two logical modes \(i\) and \(j\), define:
\[G_{ij} = \langle \mathrm{mode}_i, \mathrm{mode}_j \rangle = \langle \mathrm{label}_i, \mathrm{label}_j \rangle.\]Then the commutators are:
\[[a_i, a_j^\dagger] = G_{ij}, \qquad [a_i^\dagger, a_j] = -G_{ij}, \qquad [a_i, a_j] = [a_i^\dagger, a_j^\dagger] = 0.\]If the mode overlap is (numerically) zero, the operators commute.
Notes
LadderOpis immutable (frozen=True). Thewith_*helpers return updated copies viadataclasses.replace().This implements
LadderOpprotocol.- Parameters:
kind (OperatorKind)
mode (ModeOp)
- approx_signature(*, decimals: int = 12, ignore_global_phase: bool = False) tuple[object, ...]¶
Return an approximate signature.
- commutator(other: LadderOp) complex¶
Compute the commutator with another ladder operator.
The result implements the generalized CCR based on logical-mode overlap:
\[[a_i, a_j^\dagger] = \langle \mathrm{mode}_i, \mathrm{mode}_j \rangle = \langle \mathrm{label}_i, \mathrm{label}_j \rangle.\]The other cases follow by antisymmetry and vanishing same-kind commutators:
\[[a_i^\dagger, a_j] = -[a_j, a_i^\dagger], \qquad [a_i, a_j] = [a_i^\dagger, a_j^\dagger] = 0.\]Numerical note
If the overlap magnitude is below
1e-15, this returns0jto avoid noise from nearly-orthogonal modes.- Parameters:
other (LadderOp)
- Return type:
- dagger() LadderOp¶
Return the Hermitian adjoint of this ladder operator.
\[(a_i)^\dagger = a_i^\dagger, \qquad (a_i^\dagger)^\dagger = a_i.\]- Return type:
- kind: OperatorKind¶
- class ModeOp(label: ModeLabel, user_label: str | None = None, display_index: int | None = <factory>) None¶
Bases:
objectA logical mode, defined by a composite mode label.
Conceptually, a
ModeOprepresents a (possibly composite) bosonic mode characterized by a labellabelthat fully specifies how the mode overlaps with other modes (e.g., via path, polarization, and envelope components).This object is also the factory for its ladder operators
annandcreate:\[a_{\mathrm{mode}}, \quad a_{\mathrm{mode}}^\dagger.\]The commutation relations are implemented on
LadderOpusing the overlap induced bylabel.Notes
ModeOpis immutable (frozen=True). Thewith_*helpers return updated copies viadataclasses.replace().The
display_indexis intended purely for UI/debugging and does not contribute to signatures.This implements
ModeOpprotocol.- approx_signature(*, decimals: int = 12, ignore_global_phase: bool = False) tuple[object, ...]¶
Return an approximate signature.
- label: ModeLabel¶
- with_envelope(envelope: Envelope) Self¶
Return an updated
ModeOpwith newEnvelope.- Parameters:
envelope (Envelope)
- Return type:
- with_label(label: ModeLabel) Self¶
Return an updated
ModeOpwith newlabel.- Parameters:
label (ModeLabel)
- Return type:
- with_path(path: Path) Self¶
Return an updated
ModeOpwith newPath.- Parameters:
path (Path)
- Return type: