Open source library for hafnian calculation
Project description
A library for the calculation of hafnians, Hermite polynomials and Gaussian boson sampling. For more information, please see the documentation.
Features
Fast calculation of hafnians, loop hafnians, and torontonians of general and certain structured matrices.
An easy to use interface to use the loop hafnian for Gaussian quantum state calculations.
Sampling algorithms for hafnian and torontonians of graphs.
Efficient classical methods for approximating the hafnian of non-negative matrices.
Easy to use implementations of the multidimensional Hermite polynomials, which can also be used to calculate hafnians of all reductions of a given matrix.
Installation
The Walrus requires Python version 3.7, 3.8, 3.9, or 3.10. Installation of The Walrus, as well as all dependencies, can be done using pip:
pip install thewalrus
Compiling from source
The Walrus has the following dependencies:
You can compile the latest development version by cloning the git repository, and installing using pip in development mode.
$ git clone https://github.com/XanaduAI/thewalrus.git
$ cd thewalrus && python -m pip install -e .
Software tests
To ensure that The Walrus library is working correctly after installation, the test suite can be run locally using pytest.
Additional packages are required to run the tests. These dependencies can be found in requirements-dev.txt and can be installed using pip:
$ pip install -r requirements-dev.txt
To run the tests, navigate to the source code folder and run the command
$ make test
Documentation
The Walrus documentation is available online on Read the Docs.
Additional packages are required to build the documentation locally as specified in doc/requirements.txt. These packages can be installed using:
$ sudo apt install pandoc
$ pip install -r docs/requirements.txt
To build the HTML documentation, go to the top-level directory and run the command
$ make doc
The documentation can then be found in the docs/_build/html/ directory.
Contributing to The Walrus
We welcome contributions - simply fork The Walrus repository, and then make a pull request containing your contribution. All contributors to The Walrus will be listed as authors on the releases.
We also encourage bug reports, suggestions for new features and enhancements, and even links to projects, applications or scientific publications that use The Walrus.
Support
Source Code: https://github.com/XanaduAI/thewalrus
Issue Tracker: https://github.com/XanaduAI/thewalrus/issues
If you are having issues, please let us know by posting the issue on our Github issue tracker.
License
The Walrus is free and open source, released under the Apache License, Version 2.0.
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 thewalrus-0.21.0.tar.gz
.
File metadata
- Download URL: thewalrus-0.21.0.tar.gz
- Upload date:
- Size: 111.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8e1d6a7dea1e2c70aeb172f2dba1dfc7fabfa6e000c8ace9c5f81c7df422637 |
|
MD5 | 3b8e978005438dea1c6f40607f1cdc5d |
|
BLAKE2b-256 | d81bc1dea1e8422a512b54811ccfc18895c7c093d77f9e6c0c093e78dd10df08 |
File details
Details for the file thewalrus-0.21.0-py3-none-any.whl
.
File metadata
- Download URL: thewalrus-0.21.0-py3-none-any.whl
- Upload date:
- Size: 94.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f393d17fc8362e7156337faed769e99f15149040ef298d2a1be27f234aa8cb9 |
|
MD5 | 7c96677f519ebada89dc14628f8ffc2e |
|
BLAKE2b-256 | 34b7dc4666f631ef43b555f2740272c20579508e3cfa203f3daa8691cca33faa |