Operators and States¶
Python operator and state primitives.
Generated operators use sparse storage internally where that preserves the
structure of common open-system models. The public to_numpy and
__array__ interfaces still expose dense arrays for convenient inspection
and interoperability.
- class openquantumsim.operators.Operator(data, space=None, label=None)[source]¶
Bases:
objectLinear operator with an optional Hilbert-space descriptor.
- Parameters:
data (Any)
space (HilbertSpace | None)
label (str | None)
- data: Any¶
- space: HilbertSpace | None = None¶
- label: str | None = None¶
- property shape: tuple[int, int]¶
Matrix shape.
- property dim: int¶
Matrix dimension.
- openquantumsim.operators.eye(space_or_dim)[source]¶
Identity operator.
- Parameters:
space_or_dim (HilbertSpace | int)
- Return type:
- openquantumsim.operators.destroy(space_or_dim)[source]¶
Bosonic annihilation operator for a finite-dimensional truncation.
- Parameters:
space_or_dim (HilbertSpace | int)
- Return type:
- openquantumsim.operators.create(space_or_dim)[source]¶
Bosonic creation operator.
- Parameters:
space_or_dim (HilbertSpace | int)
- Return type:
- openquantumsim.operators.identity(space_or_dim)[source]¶
Identity operator (alias of
eye()).- Parameters:
space_or_dim (HilbertSpace | int)
- Return type:
- openquantumsim.operators.position(space_or_dim)[source]¶
Dimensionless position quadrature
(a + a^dagger) / sqrt(2).- Parameters:
space_or_dim (HilbertSpace | int)
- Return type:
- openquantumsim.operators.momentum(space_or_dim)[source]¶
Dimensionless momentum quadrature
-i (a - a^dagger) / sqrt(2).- Parameters:
space_or_dim (HilbertSpace | int)
- Return type:
- openquantumsim.operators.num(space_or_dim)[source]¶
Bosonic number operator.
- Parameters:
space_or_dim (HilbertSpace | int)
- Return type:
- openquantumsim.operators.sigmax(space_or_dim=None)[source]¶
Pauli sigma-x operator.
- Parameters:
space_or_dim (HilbertSpace | int | None)
- Return type:
- openquantumsim.operators.sigmay(space_or_dim=None)[source]¶
Pauli sigma-y operator.
- Parameters:
space_or_dim (HilbertSpace | int | None)
- Return type:
- openquantumsim.operators.sigmaz(space_or_dim=None)[source]¶
Pauli sigma-z operator.
- Parameters:
space_or_dim (HilbertSpace | int | None)
- Return type:
- openquantumsim.operators.sigmam(space_or_dim=None)[source]¶
Two-level lowering operator |down><up|.
- Parameters:
space_or_dim (HilbertSpace | int | None)
- Return type:
- openquantumsim.operators.sigmap(space_or_dim=None)[source]¶
Two-level raising operator |up><down|.
- Parameters:
space_or_dim (HilbertSpace | int | None)
- Return type:
- openquantumsim.operators.spin_jm(space_or_dim)[source]¶
Spin-S lowering operator in the Dicke basis ordered by descending m.
- Parameters:
space_or_dim (SpinSpace | DickeSpace | int)
- Return type:
- openquantumsim.operators.spin_jp(space_or_dim)[source]¶
Spin-S raising operator.
- Parameters:
space_or_dim (SpinSpace | DickeSpace | int)
- Return type:
- openquantumsim.operators.spin_jx(space_or_dim)[source]¶
Spin-S x operator.
- Parameters:
space_or_dim (SpinSpace | DickeSpace | int)
- Return type:
- openquantumsim.operators.spin_jz(space_or_dim)[source]¶
Spin-S z operator in the Dicke basis ordered by descending m.
- Parameters:
space_or_dim (SpinSpace | DickeSpace | int)
- Return type:
- openquantumsim.operators.dicke_jm(space_or_dim)[source]¶
Collective Dicke lowering operator
J_-.- Parameters:
space_or_dim (DickeSpace | int)
- Return type:
- openquantumsim.operators.dicke_jp(space_or_dim)[source]¶
Collective Dicke raising operator
J_+.- Parameters:
space_or_dim (DickeSpace | int)
- Return type:
- openquantumsim.operators.dicke_jx(space_or_dim)[source]¶
Collective Dicke drive operator
J_x.- Parameters:
space_or_dim (DickeSpace | int)
- Return type:
- openquantumsim.operators.dicke_jz(space_or_dim)[source]¶
Collective Dicke inversion operator
J_z.- Parameters:
space_or_dim (DickeSpace | int)
- Return type:
- openquantumsim.operators.dicke_excitation(space_or_dim)[source]¶
Collective excitation-number operator in the symmetric Dicke manifold.
- Parameters:
space_or_dim (DickeSpace | int)
- Return type:
- openquantumsim.operators.collective_lowering(space_or_dim)[source]¶
Alias for the Dicke collective lowering operator
J_-.- Parameters:
space_or_dim (DickeSpace | int)
- Return type:
- openquantumsim.operators.collective_raising(space_or_dim)[source]¶
Alias for the Dicke collective raising operator
J_+.- Parameters:
space_or_dim (DickeSpace | int)
- Return type:
- openquantumsim.operators.collective_x(space_or_dim)[source]¶
Alias for the Dicke collective drive operator
J_x.- Parameters:
space_or_dim (DickeSpace | int)
- Return type:
- openquantumsim.operators.collective_z(space_or_dim)[source]¶
Alias for the Dicke collective inversion operator
J_z.- Parameters:
space_or_dim (DickeSpace | int)
- Return type:
- openquantumsim.operators.collective_excitation(space_or_dim)[source]¶
Alias for the Dicke collective excitation-number operator.
- Parameters:
space_or_dim (DickeSpace | int)
- Return type:
- openquantumsim.operators.basis(space_or_dim, index)[source]¶
Basis ket as a column vector.
- Parameters:
space_or_dim (HilbertSpace | int)
index (int | str)
- Return type:
ndarray[tuple[Any, …], dtype[complex128]]
- openquantumsim.operators.fock(space_or_dim, n)[source]¶
Fock basis state |n>.
- Parameters:
space_or_dim (HilbertSpace | int)
n (int)
- Return type:
ndarray[tuple[Any, …], dtype[complex128]]
- openquantumsim.operators.dicke_state(space, excitations)[source]¶
Symmetric Dicke state with a fixed number of excited spins.
- Parameters:
space (DickeSpace)
excitations (int)
- Return type:
ndarray[tuple[Any, …], dtype[complex128]]
- openquantumsim.operators.ket2dm(ket)[source]¶
Convert a ket to a density matrix.
- Parameters:
ket (ndarray[tuple[Any, ...], dtype[complex128]])
- Return type:
ndarray[tuple[Any, …], dtype[complex128]]
- openquantumsim.operators.coherent(space_or_dim, alpha)[source]¶
Truncated coherent state.
- Parameters:
space_or_dim (FockSpace | int)
alpha (complex)
- Return type:
ndarray[tuple[Any, …], dtype[complex128]]