Extension for pytket, providing access to the cuTensorNet Python API.
Project description
Pytket Extensions
This repository contains the pytket-cutensornet extension, using Quantinuum's pytket quantum SDK.
pytket-cutensornet
Pytket is a python module for interfacing with tket, a quantum computing toolkit and optimisation compiler developed by Quantinuum.
cuTensorNet is a high-performance library for tensor network computations, developed by NVIDIA. It is part of the cuQuantum SDK - a high-performance library aimed at quantum circuit simulations on the NVIDIA GPU chips, consisting of two major components:
cuStateVec
: a high-performance library for state vector computations.cuTensorNet
: a high-performance library for tensor network computations.
Both components have both C and Python API.
pytket-cutensornet
is an extension to pytket
that allows pytket
circuits and
expectation values to be simulated using cuTensorNet
via an interface to
cuQuantum Python.
Currently, only single-GPU calculations are supported, but a multi-GPU execution will be
implemented in the due course using mpi4py
library.
Getting started
pytket-cutensornet
is available for Python 3.9, 3.10 and 3.11 on Linux.
In order to use it, you need access to a Linux machine with either Volta
, Ampere
or Hopper
GPU and first install cuQuantum Python
following their installation
instructions.
This will include the necessary dependencies such as CUDA toolkit. Then, to install
pytket-cutensornet
, run:
pip install pytket-cutensornet
Bugs, support and feature requests
Please file bugs and feature requests on the Github issue tracker.
Development
To install an extension in editable mode, from its root folder run:
pip install -e .
Contributing
Pull requests are welcome. To make a PR, first fork the repo, make your proposed
changes on the develop
branch, and open a PR from your fork. If it passes
tests and is accepted after review, it will be merged in.
Code style
Docstrings
We use the Google style docstrings, please see this page for reference.
Formatting
All code should be formatted using black, with default options. This is checked on the CI. The CI is currently using version 22.12.0. You can install it (as well as pylint as described below) by running from the root package folder:
pip install -r lint-requirements.txt
Type annotation
On the CI, mypy is used as a static
type checker and all submissions must pass its checks. You should therefore run
mypy
locally on any changed files before submitting a PR. Because of the way
extension modules embed themselves into the pytket
namespace this is a little
complicated, but it should be sufficient to run the script mypy-check
and passing as a single argument the root directory of the module to test. The directory
path should end with a /
. For example, to run mypy on all Python files in this
repository, when in the root folder, run:
./mypy-check ./
The script requires mypy
0.800 or above.
Linting
We use pylint on the CI to check compliance
with a set of style requirements (listed in .pylintrc
). You should run
pylint
over any changed files before submitting a PR, to catch any issues.
Tests
To run the tests for a module:
cd
into that module'stests
directory;- ensure you have installed
pytest
and any other modules listed in thetest-requirements.txt
file (all viapip
); - run
pytest
.
When adding a new feature, please add a test for it. When fixing a bug, please add a test that demonstrates the fix.
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 Distributions
Built Distribution
File details
Details for the file pytket_cutensornet-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: pytket_cutensornet-0.2.0-py3-none-any.whl
- Upload date:
- Size: 43.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6aebd618195069e9a6d3630ec0cb5f74ef93515c6db088c077a4851a527064d6 |
|
MD5 | 56b12b351124d98cbf7e96939a8a2ff5 |
|
BLAKE2b-256 | 31f598d0bbf8c543449bb10c011078fe13f1d5ecac7b534c7448ceb36b7d6ac1 |