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)¶
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.
- to_numpy()¶
Return a dense NumPy array representation.
- Return type:
ndarray[tuple[Any, …], dtype[complex128]]
- openquantumsim.operators.eye(space_or_dim)¶
Identity operator.
- Parameters:
space_or_dim (HilbertSpace | int)
- Return type:
- openquantumsim.operators.destroy(space_or_dim)¶
Bosonic annihilation operator for a finite-dimensional truncation.
- Parameters:
space_or_dim (HilbertSpace | int)
- Return type:
- openquantumsim.operators.create(space_or_dim)¶
Bosonic creation operator.
- Parameters:
space_or_dim (HilbertSpace | int)
- Return type:
- openquantumsim.operators.num(space_or_dim)¶
Bosonic number operator.
- Parameters:
space_or_dim (HilbertSpace | int)
- Return type:
- openquantumsim.operators.sigmax(space_or_dim=None)¶
Pauli sigma-x operator.
- Parameters:
space_or_dim (HilbertSpace | int | None)
- Return type:
- openquantumsim.operators.sigmay(space_or_dim=None)¶
Pauli sigma-y operator.
- Parameters:
space_or_dim (HilbertSpace | int | None)
- Return type:
- openquantumsim.operators.sigmaz(space_or_dim=None)¶
Pauli sigma-z operator.
- Parameters:
space_or_dim (HilbertSpace | int | None)
- Return type:
- openquantumsim.operators.sigmam(space_or_dim=None)¶
Two-level lowering operator |down><up|.
- Parameters:
space_or_dim (HilbertSpace | int | None)
- Return type:
- openquantumsim.operators.sigmap(space_or_dim=None)¶
Two-level raising operator |up><down|.
- Parameters:
space_or_dim (HilbertSpace | int | None)
- Return type:
- openquantumsim.operators.spin_jm(space_or_dim)¶
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)¶
Spin-S raising operator.
- Parameters:
space_or_dim (SpinSpace | DickeSpace | int)
- Return type:
- openquantumsim.operators.spin_jx(space_or_dim)¶
Spin-S x operator.
- Parameters:
space_or_dim (SpinSpace | DickeSpace | int)
- Return type:
- openquantumsim.operators.spin_jz(space_or_dim)¶
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)¶
Collective Dicke lowering operator
J_-.- Parameters:
space_or_dim (DickeSpace | int)
- Return type:
- openquantumsim.operators.dicke_jp(space_or_dim)¶
Collective Dicke raising operator
J_+.- Parameters:
space_or_dim (DickeSpace | int)
- Return type:
- openquantumsim.operators.dicke_jx(space_or_dim)¶
Collective Dicke drive operator
J_x.- Parameters:
space_or_dim (DickeSpace | int)
- Return type:
- openquantumsim.operators.dicke_jz(space_or_dim)¶
Collective Dicke inversion operator
J_z.- Parameters:
space_or_dim (DickeSpace | int)
- Return type:
- openquantumsim.operators.dicke_excitation(space_or_dim)¶
Collective excitation-number operator in the symmetric Dicke manifold.
- Parameters:
space_or_dim (DickeSpace | int)
- Return type:
- openquantumsim.operators.collective_lowering(space_or_dim)¶
Alias for the Dicke collective lowering operator
J_-.- Parameters:
space_or_dim (DickeSpace | int)
- Return type:
- openquantumsim.operators.collective_raising(space_or_dim)¶
Alias for the Dicke collective raising operator
J_+.- Parameters:
space_or_dim (DickeSpace | int)
- Return type:
- openquantumsim.operators.collective_x(space_or_dim)¶
Alias for the Dicke collective drive operator
J_x.- Parameters:
space_or_dim (DickeSpace | int)
- Return type:
- openquantumsim.operators.collective_z(space_or_dim)¶
Alias for the Dicke collective inversion operator
J_z.- Parameters:
space_or_dim (DickeSpace | int)
- Return type:
- openquantumsim.operators.collective_excitation(space_or_dim)¶
Alias for the Dicke collective excitation-number operator.
- Parameters:
space_or_dim (DickeSpace | int)
- Return type:
- openquantumsim.operators.tensor(*items)¶
Kronecker product of operators.
- openquantumsim.operators.basis(space_or_dim, index)¶
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)¶
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)¶
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)¶
Convert a ket to a density matrix.
- Parameters:
ket (ndarray[tuple[Any, ...], dtype[complex128]])
- Return type:
ndarray[tuple[Any, …], dtype[complex128]]