A VQE package which interfaces with Rigetti's QCS platform
Project description
The Qu & Co Chemistry package is an open source library (licensed under Apache 2) for compiling and running quantum chemistry algorithms on Rigetti’s Forest quantum computing platform.
Installation
To start using Qu & Co Chemistry library, you need to first install the Rigetti’s Forest SDK which contains both the Quantum Virtual Machine and the Rigetti’s quantum compiler.
You can install the library in two different ways.
From PyPi or conda
Using pip install the latest version from PyPi within a virtual environment:
python -m pip install qucochemistry
Alternatively, the library can be installed within a conda environment:
conda install -c quco qucochemistry
From source
Using pip, install the library within a virtual environment:
python -m pip install -r deploy/requirements.txt
python -m pip install -e .
Alternatively, install within a Conda environment using the provided environment:
conda env create -n <env_name> -f deploy/environment.yml
conda activate <env_name>
python -m pip install -e .
Usage
In order to use this library within your program, Rigetti’s quantum virtual machine and quantum compilers must be running in the background. If you run on Linux or OSX and the Rigetti’s Forest SDK is correctly installed, you can start them in the background with the following commands:
screen -dm -S qvm qvm -S
screen -dm -S quilc quilc -S
On Windows just execute qvm -S
and quilc -S
commands in two separate cmd terminals.
For more details on how to use the library, several tutorials on Jupyter notebook are available here. To be able run end-to-end programs, you should install PySCF and OpenFermion-PySCF as additional dependencies with pip:
python -m pip install openfermionpyscf pyscf
If you created the Conda environment as described in the previous section, you should be able to install these dependencies within the environment with the same command.
With Docker container
The library can also be used in Jupyter notebooks hosted within a Docker container. You should have both docker and docker-compose installed in your system.
To setup the Docker environment in the project root directory run:
docker-compose up -d
Now you can access a Jupyter notebook in your browser at http://127.0.0.1:8888
with Qu&Co Chemistry library available. Navigate to the examples/ folder to run the tutorial notebooks.
Development
The unit tests are built using the pytest framework. In order to run them, install the qucochemistry package using the previous instruction and add the following dependencies:
# for Conda environment
conda install pytest pytest-cov
# for standard virtual environment
python -m pip install pytest pytest-cov
The tests can be executed in the root project directory as follows:
pytest -v --cov=qucochemistry
An automatic code coverage report will be generated after running the above command. In order to visualize the details of the code coverage for each module, an HTML report can be generated and rendered with your favorite browser
pytest -v --cov=qucochemistry --cov-report html
firefox htmlcov/index.html
How to contribute
We’d love to accept your contributions and patches to Qu & Co Chemistry. There are a few guidelines you need to follow. Contributions to Qu & Co Chemistry must be accompanied by a Contributor License Agreement. You (or your employer) retain the copyright to your contribution, this simply gives us permission to use and redistribute your contributions as part of the project.
All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. Consult GitHub Help for more information on using pull requests. Furthermore, please make sure your new code comes with extensive tests! We use automatic testing to make sure all pull requests pass tests and do not decrease overall test coverage by too much. Make sure you adhere to our style guide. Just have a look at our code for clues. We mostly follow PEP 8 and use the corresponding linter to check for it. Code should always come with documentation.
Disclaimer
Copyright 2019
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 qucochemistry-0.1.2.tar.gz
.
File metadata
- Download URL: qucochemistry-0.1.2.tar.gz
- Upload date:
- Size: 21.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0aede73b69dc72baf69d96137fdcd1530f46c3c217e8a26da4872b110b65104b |
|
MD5 | c064014393547057f00056383f7ce3ca |
|
BLAKE2b-256 | 5dfd4582b12a4ab3456301ed997a688de246e170cd4406ba137c5cf0cb17fa06 |
File details
Details for the file qucochemistry-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: qucochemistry-0.1.2-py3-none-any.whl
- Upload date:
- Size: 24.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5f17b61472c1b2492c752a5ee2cde16cf7d607c3503fadbb15542773d39f4ad |
|
MD5 | 01a529a3427352bd6d9a5c59c3c8e88d |
|
BLAKE2b-256 | 4ded3aaae20a495a119f9498181add4d29112f91b4c880f091571d8a2c9a5f64 |