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 binary named
qsym2providing the command-line interface, or - as a Python library named
qsym2providing the exposed Python bindings.
Both methods can be configured via Rust features.
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 and extracting it.git: -
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 pathqsym2binary into a different path by running/custom/install/path/for/qsym2must then be added to the$PATHenvironment variable to makeqsym2discoverable by the operating system.
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.
- Follow steps 1 to 4 under the Binary compilation section above to install the required prerequisites.
- Make sure that the Anaconda package manager is available on your system. Instructions for installing Anaconda on a Linux system can be found here.
- Create a new conda environment named
qsym2-python(or a different name of your choice) running Python 3.13 (or a different version of your choice): and then activate this environment: -
From inside the source code directory, execute
This command callspipwhich automatically acquires the build toolmaturinto 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.