A Python package for exact diagonalization calculations of quantum manybody systems.
Project description
QuSpin
QuSpin is an open-source Python package for exact diagonalization and quantum dynamics of arbitrary boson, fermion and spin many-body systems. QuSpin supports the use of various (user-defined) symmetries for one and higher-dimensional lattice systems, (imaginary) time evolution following arbitrary user-specified driving protocols, constrained Hilbert spaces, and parallel sparse linear algebra tools.
The complete Documentation for QuSpin (including a number of recent tutorials) can be found at
http://quspin.github.io/QuSpin/
Examples with python scripts and Jupyter notebooks which show how to use QuSpin can be downloaded at
http://quspin.github.io/QuSpin/Examples.html
For an indepth introduction to the package, check out the following papers:
QuSpin wraps Scipy, Numpy, and custom C++/Cython libraries together to offer state-of-the art exact diagonalization calculations. The interface allows the user to define any many-body (and single particle) Hamiltonian which can be constructed from local single-particle operators. It also gives the user the flexibility of accessing many pre-defined symmetries in 1d (e.g. translation, reflection, spin inversion), as well as user-defined symmetry based on elementary transformations, such as site and spin flips. Moreover, there are convenient built-in ways to specify the time and parameter dependence of operators in the Hamiltonian, which is interfaced with user-friendly routines to solve the time dependent Schrödinger equation numerically. All the Hamiltonian data is stored either using Scipy's sparse matrix library for sparse Hamiltonians or dense Numpy arrays which allows the user to access any powerful Python scientific computing tools.
Contents
Installation
automatic install
The latest version of the package has the compiled modules written in Cython which has made the code far more portable across different platforms. We will support precompiled version of the package for Linux, OS X and Windows 64-bit systems. The automatic installation of QuSpin requires the pip package manager for Python. Once pip has been installed, all one has to do to install QuSpin is run:
$ pip install quspin
This will install the latest version on your computer. Right now the package is in its beta stages and so it may not be available for installation on all platforms using this method. In such a case one can also manually install the package.
OpenMP support is automatically built in starting from QuSpin 1.0.0.
developer install
Clone the QuSpin Workspace repository:
$ git clone https://github.com/QuSpin/QuSpin-workspace
Initialize the submodules to pull the code:
$ git submodule init
$ git submodule update
You will see three directories, each pointing to its own repository:
- sparse parallel tools extension which contains the cpp code for the
tools
module; - QuSpin extension which contains the cpp code for the basis modules;
- QuSpin with the quspin python package that uses the other two modules.
Create a python>3.9 virtual environment. This can be done using miniconda, or using python itself:
$ cd QuSpin-workspace/
$ python3 -m venv .quspin_env
Activate the environment:
$ source .quspin_env/bin/activate
Double check if the python and pip binaries point to the environment path:
$ which python
$ which pip
Install extension modules (may take a bit of time to build the cpp code):
$ pip install -e parallel-sparse-tools/ -v
$ pip install -e QuSpin-Extensions/ -v
$ pip install -e QuSpin/ -v
Make sure you add an exhaustive test to test any code you want to add to the package. To run unit tests, you can use pytest:
$ pip install pytest
$ cd QuSpin-workspace/QuSpin/tests
$ pytest `# runs all tests in all subdirectories`
$ pytest test_specific.py
Make sure you also comment your code and add a your new public functions to the documentation. For the documentation, you need to install in addition:
$ pip install -U sphinx
$ pip install numpydoc
$ pip install sphinx-rtd-theme
$ pip install sphinx-rtd-size
To build the documentation, do:
$ cd QuSpin-workspace/QuSpin/sphinx/
$ rm ./source/generated/* `# removes previously generated doc files`
$ make clean
$ make html
$ open _build/html/index.html
updating the package
To update the package with pip, all one has to do is run the command.
$ pip install --upgrade quspin
Documentation
The complete QuSpin documentation can be found under
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file quspin-1.0.0.tar.gz
.
File metadata
- Download URL: quspin-1.0.0.tar.gz
- Upload date:
- Size: 174.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: pdm/2.19.1 CPython/3.10.12 Linux/6.8.0-1014-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c279632364952091c597cc426323b128df7ee0811845e7ebae9b6c67a1ba306 |
|
MD5 | 4c16e819892cd335390f090db67a541f |
|
BLAKE2b-256 | d6806d408b9c59076d0b99fe04d49044a46a5a0db70ba7d002c16c359fb55333 |
File details
Details for the file quspin-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: quspin-1.0.0-py3-none-any.whl
- Upload date:
- Size: 199.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: pdm/2.19.1 CPython/3.10.12 Linux/6.8.0-1014-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e45b4e48b14c9a35f579f4c40f68bc949aa2b738f3f50f6863f2e8698369cc6 |
|
MD5 | c7ef60e53f9260aebe9b392c60c2a60f |
|
BLAKE2b-256 | 485281c5867ba2eb4156816093d4f4f153330cfcb2bc8a3fc6e4b7addabcd522 |