Skip to main content

Jet is an open-source library for quantum circuit simulation using tensor network contractions

Project description

Jet
GitHub Actions Documentation Standard License

Jet is a cross-platform C++ and Python library for simulating quantum circuits using tensor network contractions.

Features

  • Runs on a variety of systems, from single-board machines to massively parallel supercomputers.

  • Accelerates tensor contractions using a novel task-based parallelism approach.

  • Models quantum systems with an arbitrary number of basis states.

To get started with Jet, read one of our tutorial walkthroughs or browse the full API documentation.

Installation

C++

The Jet C++ library requires Taskflow, a BLAS library with a CBLAS interface, and a C++ compiler with C++17 support. To use Jet, add #include <Jet.hpp> to the top of your header file and link your program with the CBLAS library.

For example, assuming that the Taskflow headers can be found in your g++ include path and OpenBLAS is installed on your system, you can compile the hellojet.cpp program below

#include <array>
#include <complex>
#include <iostream>

#include <Jet.hpp>

int main(){
    using Tensor = Jet::Tensor<std::complex<float>>;

    Tensor lhs({"i", "j", "k"}, {2, 2, 2});
    Tensor rhs({"j", "k", "l"}, {2, 2, 2});

    lhs.FillRandom();
    rhs.FillRandom();

    Tensor res = Tensor::ContractTensors(lhs, rhs);

    for (const auto &datum : res.GetData()) {
        std::cout << datum << std::endl;
    }

    std::cout << "You have successfully used Jet version " << Jet::Version() << std::endl;

    return 0;
}

by running

git clone https://github.com/XanaduAI/jet
g++ --std=c++17 -O3 -Ijet/include hellojet.cpp -lopenblas

The output of this program should resemble

$ ./hellojet
(-0.936549,0.0678852)
(-0.0786964,-0.771624)
(2.98721,-0.657124)
(-1.90032,1.58051)
You have successfully used Jet version 0.2.1

For more detailed instructions, see the development guide.

Python

The Jet Python package requires Python version 3.7 and above. Installation of Jet, as well as all dependencies, can be done using pip:

pip install quantum-jet

To build the Jet Python distribution locally, a BLAS library with a CBLAS interface and a C++ compiler with C++17 support is required. Simply run

make dist
pip install dist/*.whl

To verify that Jet is installed, you can run the hellojet.py program below

import jet

lhs = jet.Tensor(["i", "j", "k"], [2, 2, 2])
rhs = jet.Tensor(["j", "k", "l"], [2, 2, 2])

lhs.fill_random()
rhs.fill_random()
res = jet.contract_tensors(lhs, rhs)

for datum in res.data:
    print(f"{datum:.5f}")

print("You have successfully used Jet version", jet.version())

The output of this program should resemble

$ python hellojet.py
1.96289+0.25257j
-0.16588-1.44652j
-1.43005+0.49516j
1.66881-1.67099j
You have successfully used Jet version 0.2.1

Contributing to Jet

We welcome new contributions - simply fork the Jet repository and make a pull request containing your contribution. All contributers to Jet will be listed as authors on the releases. See our changelog for more details.

We also encourage bug reports, suggestions for new features and enhancements, and even links to cool projects or applications built using Jet. Visit the contributions page to learn more about sharing your ideas with the Jet team.

Support

If you are having issues, please let us know by posting the issue on our GitHub issue tracker.

Authors

Jet is the work of many contributors.

If you are doing research using Jet, please cite our paper:

Trevor Vincent, Lee J. O’Riordan, Mikhail Andrenkov, Jack Brown, Nathan Killoran, Haoyu Qi, and Ish Dhand. Jet: Fast quantum circuit simulations with parallel task-based tensor-network contraction. 2021. arxiv:2107.09793

License

Jet is free and open source, released under the Apache License, Version 2.0.

Jet contains a copy of JSON for Modern C++ from Niels Lohmann which is licenced under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quantum-jet-0.2.2.tar.gz (223.3 kB view details)

Uploaded Source

Built Distributions

quantum_jet-0.2.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.7 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

quantum_jet-0.2.2-cp39-cp39-macosx_10_14_x86_64.whl (356.7 kB view details)

Uploaded CPython 3.9 macOS 10.14+ x86-64

quantum_jet-0.2.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.7 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

quantum_jet-0.2.2-cp38-cp38-macosx_10_14_x86_64.whl (356.7 kB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

quantum_jet-0.2.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.7 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

quantum_jet-0.2.2-cp37-cp37m-macosx_10_14_x86_64.whl (350.9 kB view details)

Uploaded CPython 3.7m macOS 10.14+ x86-64

File details

Details for the file quantum-jet-0.2.2.tar.gz.

File metadata

  • Download URL: quantum-jet-0.2.2.tar.gz
  • Upload date:
  • Size: 223.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6

File hashes

Hashes for quantum-jet-0.2.2.tar.gz
Algorithm Hash digest
SHA256 c7de01abe63cff38eaf116785fad8df2fbd0eb16e0401c5ba22bba080792dc53
MD5 a308983c8ffce6064d4561ff0ff608af
BLAKE2b-256 d827c26a394fed71ab9dc11afd71c6609cf74e6de2547a07cbde7561eccdd807

See more details on using hashes here.

File details

Details for the file quantum_jet-0.2.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for quantum_jet-0.2.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 67516f8e792e173dfd8e7fac33965377d6cdfd3895fd6c1791226c9b19cd37a9
MD5 3be102bea9a3d9de424798189f4006ff
BLAKE2b-256 52e7c2f56d29884fd306710d6c7cfd20731640876a2432effe4997314b3c640b

See more details on using hashes here.

File details

Details for the file quantum_jet-0.2.2-cp39-cp39-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: quantum_jet-0.2.2-cp39-cp39-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 356.7 kB
  • Tags: CPython 3.9, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6

File hashes

Hashes for quantum_jet-0.2.2-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 7ff26fb6fc26b5428628ed14acb8cf0fcc06183e8ef0974a2d392c8568bd90ea
MD5 16ec49267d11630b402974c284255937
BLAKE2b-256 c0a8c9e409517036670f136ecde6b614fff5850d4bbdd5225ce9c3864424d460

See more details on using hashes here.

File details

Details for the file quantum_jet-0.2.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for quantum_jet-0.2.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 56d2bbff81a85ac5467fbf21776735031f75d29a166eb25097faeb66a02381eb
MD5 ed3b0ba6091117ae0438e132e1f41dcb
BLAKE2b-256 c8f8f494bbc8fb1d5bc57265b2eb9bb6d457d282f479ebb8dfa573eca4f9bf11

See more details on using hashes here.

File details

Details for the file quantum_jet-0.2.2-cp38-cp38-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: quantum_jet-0.2.2-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 356.7 kB
  • Tags: CPython 3.8, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6

File hashes

Hashes for quantum_jet-0.2.2-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 285ba3a9d4b0095584d24a8ac4b28f2ab6b1c6ff6c5ee9193e71094d40876df0
MD5 6092979e866e6ba8c6d630013104f4e0
BLAKE2b-256 86114fab43a3c3462aeb9416c049b7874d654e628c1cae575505224e7a264214

See more details on using hashes here.

File details

Details for the file quantum_jet-0.2.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for quantum_jet-0.2.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2943d8519ec1a6e6bb7f6401706bbbe65281f54e4c35cca091207d299742c35b
MD5 e1b7d1f56e635a619760a7a286ae3baf
BLAKE2b-256 ab5dbac1021b1be5271159b895d24f1ce2f9daaa29444cabdd7e87c01ee522ae

See more details on using hashes here.

File details

Details for the file quantum_jet-0.2.2-cp37-cp37m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: quantum_jet-0.2.2-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 350.9 kB
  • Tags: CPython 3.7m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6

File hashes

Hashes for quantum_jet-0.2.2-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 2c3c14c712c4874a2d6bafa4798960a28f15cd72df4e42ca3169ac3700dcfcb7
MD5 17cbc4ee4e641a5af6844e3443a52ee1
BLAKE2b-256 d40a900df53810aff8fbfb4fd0e5bc051ab5586d141e9bb33299328305f9faaa

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page