Installation¶
The following instructions for installing QSym² from source are specific to Linux operating systems. On Microsoft Windows platforms, Windows Subsystem for Linux is recommended.
There are two main ways of installing QSym²:
- as a Python library named
qsym2providing the exposed Python bindings, or - as a binary named
qsym2providing the command-line interface.
Both methods can be configured via Rust features.
Python-library compilation¶
The following instructions assume that the openblas-static, integrals, and python features are to be compiled on a Linux operating system and then installed as a Python library inside a conda environment. These features are specified in the pyproject.toml file.
-
Make sure that the Anaconda/Miniconda package manager is available on your system. Instructions for installing Anaconda/Miniconda on a Linux system can be found here.
-
Create a new conda environment named
and then activate this environment:qsym2-python(or a different name of your choice) running Python 3.14 (or a different version of your choice): -
(Optional) If your system does not have system CA certificates, execute the following command to use SSL certificates that come with the conda environment:
-
Obtain the latest compressed tarball release of QSym² from here, either by downloading the
wheretar.gzfile through a browser or by usingwget:vX.Y.Zis the desired version. -
Execute
wherevX.Y.Zis the desired version.It is also possible to bypass step 4 and run
pip installdirectly on thetar.gzlink:This command automatically acquires the build tool
maturinto compile and install QSym² as a Python library into theqsym2-pythonconda environment. This library has theopenblas-static,integrals, andpythonfeatures enabled due to the specification in thepyproject.tomlfile.The Python library
qsym2can now be imported by any Python scripts running inside theqsym2-pythonconda environment.
Binary compilation¶
The following instructions assume that the full feature is to be installed on a Linux operating system to make available the qsym2 binary.
-
Install the basic dependencies by running the following commands (sudo privileges required):
-
Install the Rust compiler by running the command below and following the on-screen instructions:
The default configurations should suffice in most cases. Ensure that the current shell is restarted or the commandsource "$HOME/.cargo/env"is run upon installation completion so that the Rust compiler and thecargopackage manager can be found. -
Install the feature-specific dependencies by running the following command (sudo privileges required):
-
Obtain the source code of QSym² either via
or by downloading a compressed tarball release from here and extracting it:git:Bashwherewget https://gitlab.com/bangconghuynh/qsym2/-/archive/vX.Y.Z/qsym2-vX.Y.Z.tar.gz tar -xvf qsym2-vX.Y.Z.tar.gz cd qsym2-vX.Y.ZvX.Y.Zis the desired version. -
Inside the source code directory, install QSym² by running the following command:
which will compile and install theqsym2binary into$HOME/.cargo/binto allow for system-wide availability.Note that the
--featuresoption in the command above specifies that thefullfeature is to be installed. This option accepts a comma-separated list of features listed in the Rust features section and can be modified to select other features to be installed as appropriate.It is possible to install the
instead. The custom binary pathqsym2binary into a different path by running/custom/install/path/for/qsym2/binmust then be added to the$PATHenvironment variable to make theqsym2binary discoverable by the operating system.