struqture_py/bosons/mod.rs
1// Copyright © 2021-2023 HQS Quantum Simulations GmbH. All Rights Reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
4// in compliance with the License. You may obtain a copy of the License at
5//
6// http://www.apache.org/licenses/LICENSE-2.0
7//
8// Unless required by applicable law or agreed to in writing, software distributed under the
9// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
10// express or implied. See the License for the specific language governing permissions and
11// limitations under the License.
12
13//! Module for representing bosonic physical systems
14//!
15//! A boson system can contain any combination of none, one or several subsystems of spin, bosonic or fermionic types.
16//! For example a mixed system with two spin-subsystems or a mixed system with a spin-subsystem and a bosonic-subsystem would both be valid.
17//!
18//! This module can be used to represent mixed quantum operators, mixed quantum Hamiltonians and mixed open quantum systems.
19//!
20//! In general the enduser should use the high-level modules [struqture::mixed_systems::MixedOperator] and [struqture::mixed_systems::MixedHamiltonian]
21//! to represent mixed quantum Operators and mixed Hamiltonians respectively.
22//!
23//! Open Quantum Systems should be represented using [struqture::mixed_systems::MixedLindbladOpenSystem].
24//!
25//!
26
27use pyo3::prelude::*;
28
29mod boson_product;
30pub use boson_product::BosonProductWrapper;
31
32mod hermitian_boson_product;
33pub use hermitian_boson_product::HermitianBosonProductWrapper;
34
35mod bosonic_operator;
36pub use bosonic_operator::BosonOperatorWrapper;
37
38mod bosonic_hamiltonian;
39pub use bosonic_hamiltonian::BosonHamiltonianWrapper;
40
41mod bosonic_noise_operator;
42pub use bosonic_noise_operator::BosonLindbladNoiseOperatorWrapper;
43
44mod bosonic_open_system;
45pub use bosonic_open_system::BosonLindbladOpenSystemWrapper;
46
47/// Bosons module of struqture Python interface
48///
49/// Module for representing bosonic indices (BosonProduct and HermitianBosonProduct), bosonic systems (BosonOperator and BosonHamiltonian),
50/// and Lindblad type bosonic open systems (BosonLindbladNoiseOperator, BosonLindbladOpenSystem).
51///
52/// .. autosummary::
53/// :toctree: generated/
54///
55/// BosonProduct
56/// HermitianBosonProduct
57/// BosonOperator
58/// BosonHamiltonian
59/// BosonLindbladNoiseOperator
60/// BosonLindbladOpenSystem
61///
62#[pymodule]
63pub fn bosons(_py: Python, m: &Bound<PyModule>) -> PyResult<()> {
64 // pyo3_log::init();
65 m.add_class::<BosonProductWrapper>()?;
66 m.add_class::<HermitianBosonProductWrapper>()?;
67 m.add_class::<BosonOperatorWrapper>()?;
68 m.add_class::<BosonHamiltonianWrapper>()?;
69 m.add_class::<BosonLindbladNoiseOperatorWrapper>()?;
70 m.add_class::<BosonLindbladOpenSystemWrapper>()?;
71
72 Ok(())
73}