struqture_py/spins/
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.
12use pyo3::prelude::*;
13
14mod pauli_product;
15pub use pauli_product::PauliProductWrapper;
16
17mod decoherence_product;
18pub use decoherence_product::DecoherenceProductWrapper;
19
20mod plus_minus_product;
21pub use plus_minus_product::PlusMinusProductWrapper;
22
23mod plus_minus_operator;
24pub use plus_minus_operator::PlusMinusOperatorWrapper;
25
26mod plus_minus_noise_operator;
27pub use plus_minus_noise_operator::PlusMinusLindbladNoiseOperatorWrapper;
28
29mod pauli_operator;
30pub use pauli_operator::PauliOperatorWrapper;
31
32mod pauli_hamiltonian;
33pub use pauli_hamiltonian::PauliHamiltonianWrapper;
34
35mod pauli_noise_operator;
36pub use pauli_noise_operator::PauliLindbladNoiseOperatorWrapper;
37
38mod pauli_open_system;
39pub use pauli_open_system::PauliLindbladOpenSystemWrapper;
40
41/// Spin module of struqture Python interface
42///
43/// Module for representing spin indices (PauliProduct and DecoherenceProduct), spin systems (PauliOperator and PauliHamiltonian)
44/// and Lindblad type spin open systems (PauliLindbladNoiseOperator and PauliLindbladOpenSystem).
45///
46/// .. autosummary::
47///     :toctree: generated/
48///
49///     PauliProduct
50///     DecoherenceProduct
51///     PauliOperator
52///     PauliHamiltonian
53///     PauliLindbladNoiseOperator
54///     PauliLindbladOpenSystem
55///
56#[pymodule]
57pub fn spins(_py: Python, m: &Bound<PyModule>) -> PyResult<()> {
58    // pyo3_log::init();
59    m.add_class::<PauliProductWrapper>()?;
60    m.add_class::<DecoherenceProductWrapper>()?;
61    m.add_class::<PauliOperatorWrapper>()?;
62    m.add_class::<PauliHamiltonianWrapper>()?;
63    m.add_class::<PauliLindbladNoiseOperatorWrapper>()?;
64    m.add_class::<PauliLindbladOpenSystemWrapper>()?;
65    m.add_class::<PlusMinusProductWrapper>()?;
66    m.add_class::<PlusMinusOperatorWrapper>()?;
67    m.add_class::<PlusMinusLindbladNoiseOperatorWrapper>()?;
68    Ok(())
69}