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 float and complex in Python.
17#[derive(FromPyObject)]
18pub enum PyScalarRC {
19    Real(f64),
20    Complex(C128),
21}
22
23/// Python-exposed enumerated type to handle the union type of numpy float 1d-arrays and numpy
24/// complex 1d-arrays in Python.
25#[derive(FromPyObject)]
26pub enum PyArray1RC<'a> {
27    Real(Bound<'a, PyArray1<f64>>),
28    Complex(Bound<'a, PyArray1<C128>>),
29}
30
31/// Python-exposed enumerated type to handle the union type of numpy float 2d-arrays and numpy
32/// complex 2d-arrays in Python.
33#[derive(FromPyObject)]
34pub enum PyArray2RC<'a> {
35    Real(Bound<'a, PyArray2<f64>>),
36    Complex(Bound<'a, PyArray2<C128>>),
37}
38
39/// Python-exposed enumerated type to handle the union type of numpy float 4d-arrays and numpy
40/// complex 4d-arrays in Python.
41#[derive(FromPyObject)]
42pub enum PyArray4RC<'a> {
43    Real(Bound<'a, PyArray4<f64>>),
44    Complex(Bound<'a, PyArray4<C128>>),
45}