qsym2/lib.rs
1#![doc(
2 html_logo_url = "https://qsym2.dev/assets/logos/qsym2_logo_no_text_no_background.svg",
3 html_favicon_url = "https://qsym2.dev/assets/logos/qsym2_icon.png"
4)]
5
6//! # QSym²: A Program for Quantum Symbolic Symmetry
7//!
8//! QSym² is a program for **Q**uantum **Sym**bolic **Sym**metry analysis of
9//! quantum-chemical calculations written in Rust with the following capabilities:
10//! - on-the-fly generation of symbolic character tables,
11//! - analysis of degeneracy and symmetry breaking effects in Abelian and non-Abelian groups,
12//! - analysis of symmetry in external magnetic and electric fields,
13//! - inclusion of antiunitary symmetry based on corepresentation theory, and
14//! - inclusion of double-valued representations and corepresentations via explicit spin rotations
15//!
16//! for the following targets:
17//! - Slater determinants,
18//! - molecular orbitals,
19//! - multi-determinantal wavefunctions obtained via non-orthogonal configuration interaction,
20//! - real-space functions defined on a grid,
21//! - electron densities, and
22//! - vibrational coordinates.
23//!
24//! QSym² has been integrated with [QUEST](https://quest.codes/) and its complementary
25//! GUI, [QuestView](https://gitlab.com/Bspeake/questview). QSym² can also work with
26//! [Q-Chem](https://www.q-chem.com/) HDF5 archive files and
27//! [Orca](https://orcaforum.kofo.mpg.de/index.php) output files.
28//!
29//! The main website for QSym² can be found [here](https://qsym2.dev).
30//!
31//! QSym² is hosted on [GitLab](https://gitlab.com/bangconghuynh/qsym2). Please submit
32//! an issue there if you've encountered anything that is unclear or that you feel needs improving.
33//!
34//! This documentation details the public API of the `qsym2` crate.
35//!
36//! ## Help and support
37//!
38//! Developmental and programming issues with the crate `qsym2` can be reported on
39//! [GitLab](https://gitlab.com/bangconghuynh/qsym2). For scientific enquiries such as how to run
40//! the program QSym² for a particular quantum-chemical calculation or how to interpret
41//! the results of QSym², please join the dedicated [Slack](https://qsym2.slack.com)
42//! workspace using this [invite link](https://join.slack.com/t/qsym2/shared_invite/zt-24thj1y1x-JqvLtEA1xfQ9AylNRCDH9w).
43//!
44//! ## Getting started
45//!
46//! To use QSym² in your Rust project, simply add this crate to your project's
47//! `Cargo.toml`. The available features defined by this crate are:
48//!
49//! ### Linear algebra backend
50//!
51//! There are six features defining six different ways a linear algebra backend can be configured
52//! for QSym². These are inherited from the
53//! [`ndarray-linalg`](https://docs.rs/ndarray-linalg/latest/ndarray_linalg/) crate. One
54//! (and only one) of these must be enabled:
55//! - `openblas-static`: Downloads, builds OpenBLAS, and links statically
56//! - `openblas-system`: Finds and links existing OpenBLAS in the system
57//! - `netlib-static`: Downloads, builds LAPACK, and links statically
58//! - `netlib-system`: Finds and links existing LAPACK in the system
59//! - `intel-mkl-static`: Finds and links existing static Intel MKL in the system, or downloads and
60//! links statically if not found
61//! - `intel-mkl-system`: Finds and links existing shared Intel MKL in the system
62//!
63//! If the `*-static` backends give rise to numerical problems, please try installing the linear
64//! algebra backends directly (either via your system's package manager or by compiling from source)
65//! and then using the corresponding `*-system` backends.
66//!
67//! ### Interfaces
68//! - `qchem`: Enables Q-Chem's HDF5 archive files to be read in and analysed
69//! - `python`: Enables the Python bindings for several core functionalities
70//!
71//! ### Integrals
72//! - `integrals`: Enables the computation of $`n`$-centre overlap integrals and $`n`$-centre
73//! overlap integral derivatives within QSym²
74//!
75//! ### Composite
76//! - `standard`: Enables the `openblas-static` and `qchem` features
77//! - `full`: Enables the `standard` and `integrals` features
78//!
79//! ### Developmental
80//! - `sandbox`: Enables experimental features that are still being actively developed
81//!
82//! ## Dependencies
83//!
84//! The compilation of QSym² requires the following:
85//! - Common:
86//! * `libssl-dev` (Debian/Ubuntu) or `openssl-devel` (Rocky/Fedora/RHEL)
87//! * `pkg-config` (Debian/Ubuntu) or `pkgconfig` (Rocky/Fedora/RHEL)
88//!
89//! - Feature-specific:
90//!
91//! | Feature | Dependencies | Notes |
92//! |--------------------|---------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
93//! | `openblas-static` | `make`, `gcc`, `gfortran` | Builds OpenBLAS and links statically (see [ndarray-linalg documentation](https://github.com/rust-ndarray/ndarray-linalg)) |
94//! | `openblas-system` | <ul><li>`libopenblas-dev` (Debian/Ubuntu)</li> <li>`openblas-devel` (Rocky/Fedora/RHEL)</li></ul> | Finds and links existing OpenBLAS in the system (see [ndarray-linalg documentation](https://github.com/rust-ndarray/ndarray-linalg)) |
95//! | `netlib-static` | `make`, `gfortran` | Builds LAPACK and links statically (see [ndarray-linalg documentation](https://github.com/rust-ndarray/ndarray-linalg)) |
96//! | `netlib-system` | <ul><li>`liblapack-dev` (Debian/Ubuntu)</li> <li>`lapack-devel` (Rocky/Fedora/RHEL)</li></ul> | Finds and links existing LAPACK in the system (see [ndarray-linalg documentation](https://github.com/rust-ndarray/ndarray-linalg)) |
97//! | `intel-mkl-static` | <ul><li> `pkg-config` (Debian/Ubuntu)</li> <li>`pkgconfig` (Rocky/Fedora/RHEL)</li></ul> | Finds and links existing static Intel MKL in the system, or downloads and links statically if not found (see [ndarray-linalg documentation](https://github.com/rust-ndarray/ndarray-linalg))|
98//! | `intel-mkl-system` | <ul><li> `pkg-config` (Debian/Ubuntu)</li> <li>`pkgconfig` (Rocky/Fedora/RHEL)</li></ul> | Finds and links existing shared Intel MKL in the system (see [ndarray-linalg documentation](https://github.com/rust-ndarray/ndarray-linalg)) |
99//! | `qchem` | `cmake`, `gcc` | Builds the HDF5 C library and links statically |
100//! | `integrals` | <ul><li> `libssl-dev` (Debian/Ubuntu)</li> <li>`openssl-devel` (Rocky/Fedora/RHEL)</li></ul> | Installs the TLS framework required for [reqwest](https://github.com/seanmonstar/reqwest) |
101//! | `python` | Python, which is best managed via Anaconda | Installs the Python bindings for core functionalities of QSym² |
102//!
103//! ## Examples and usage
104//!
105//! For most items (structs, enums, functions, and traits), their usages are illustrated in test
106//! functions. For more explanation, please consult this documentation.
107//!
108//! For usage of the compiled `qsym2` binary or Python library, please consult the `README.md` file
109//! on [GitLab](https://gitlab.com/bangconghuynh/qsym2) and the documentations on
110//! [QSym²'s website](https://qsym2.dev).
111//!
112//! ## License
113//!
114//! GNU Lesser General Public License v3.0.
115//!
116//! ## Authors and acknowledgement
117//!
118//! QSym² has been developed and maintained by
119//! Dr [Bang C. Huynh](https://orcid.org/0000-0002-5226-4054) at the University of Nottingham, UK
120//! since July 2022 with scientific support from Prof.
121//! [Andrew M. Wibowo-Teale](https://orcid.org/0000-0001-9617-1143) and Dr
122//! [Meilani Wibowo-Teale](https://orcid.org/0000-0003-2462-3328) and financial support from
123//! the ERC grant under the *topDFT* project.
124//!
125//! The logo for QSym², which is a stylised stellated octahedron, was designed with
126//! artistic support from Mr [Thinh Nguyen](https://www.linkedin.com/in/thinh-nguyen-a38b7856/).
127
128macro_rules! count_exprs {
129 () => (0);
130 ($head:expr) => (1);
131 ($head:expr, $($tail:expr),*) => (1 + count_exprs!($($tail),*));
132}
133
134macro_rules! replace_expr {
135 ($_t:tt $sub:expr) => {
136 $sub
137 };
138}
139
140pub mod analysis;
141pub mod angmom;
142pub mod auxiliary;
143pub mod basis;
144pub mod bindings;
145pub mod chartab;
146pub mod drivers;
147pub mod group;
148#[cfg(feature = "integrals")]
149pub mod integrals;
150pub mod interfaces;
151pub mod io;
152pub mod permutation;
153pub mod rotsym;
154#[cfg(feature = "sandbox")]
155pub mod sandbox;
156pub mod symmetry;
157pub mod target;