qsym2/bindings/python/representation_analysis/
mod.rs

1//! Python bindings for QSym² symmetry analysis via representation and corepresentation theories.
2//!
3//! See [`crate::drivers::representation_analysis`] for more information.
4
5use num_complex::Complex;
6use numpy::{PyArray1, PyArray2, PyArray4};
7use pyo3::prelude::*;
8
9pub mod density;
10pub mod multideterminant;
11pub mod slater_determinant;
12pub mod vibrational_coordinate;
13
14type C128 = Complex<f64>;
15
16/// Python-exposed enumerated type to handle the union type of numpy float 1d-arrays and numpy
17/// complex 1d-arrays in Python.
18#[derive(FromPyObject)]
19pub enum PyArray1RC<'a> {
20    Real(Bound<'a, PyArray1<f64>>),
21    Complex(Bound<'a, PyArray1<C128>>),
22}
23
24/// Python-exposed enumerated type to handle the union type of numpy float 2d-arrays and numpy
25/// complex 2d-arrays in Python.
26#[derive(FromPyObject)]
27pub enum PyArray2RC<'a> {
28    Real(Bound<'a, PyArray2<f64>>),
29    Complex(Bound<'a, PyArray2<C128>>),
30}
31
32/// Python-exposed enumerated type to handle the union type of numpy float 4d-arrays and numpy
33/// complex 4d-arrays in Python.
34#[derive(FromPyObject)]
35pub enum PyArray4RC<'a> {
36    Real(Bound<'a, PyArray4<f64>>),
37    Complex(Bound<'a, PyArray4<C128>>),
38}