Gate model library.
Project description
dwave-gate
dwave-gate is a software package for constructing, modifying and running quantum circuits on the included simulator. It provides a set of tools that enables you to:
Construct quantum circuits using an intuitive context-manager interface.
Utilize a comprehensive library of quantum gates with simple access to matrix representations, various decompositions, and more.
Simulate circuits on a performant (C++) state-vector simulator.
Easily create your own quantum gates and templates. Any circuit can be either directly applied in another circuit or converted into a quantum operation.
Example usage
This example uses the dwave.gate.Circuit object’s context manager to append operations to a two-qubit circuit.
import dwave.gate.operations as ops
from dwave.gate import Circuit
circuit = Circuit(2)
with circuit.context as (q, c):
ops.X(q[0])
ops.Hadamard(q[1])
ops.CZ(q[0], q[1])
ops.Hadamard(q[1])
You can run the dwave.gate.simulator simulator on such circuits,
>>> from dwave.gate.simulator import simulate >>> simulate(circuit)
and then access the resulting state via the state attribute.
>>> circuit.state array([0.+0.j, 0.+0.j, 0.+0.j, 1.+0.j])
Installation
The simplest way to install dwave-gate is from PyPI:
pip install dwave-gate
It can also be installed from source by cloning this GitHub repository and running:
make install
The makefile will also simplify running tests (make test), coverage (make coverage), documentation (make docs), as well as formatting (make format) the code using the Black formatter (set to a line-length of 100) and isort. It’s available on both Unix as well as Windows systems, via the make.bat batch file.
Alternatively, the package can be built and installed in development mode using Python and pip. The simulator operations would need to be generated first by executing operation_generation.py, found in dwave/gate/simulator.
python setup.py build_ext --inplace
pip install -e .
Tests and coverage can be run using Pytest.
python -m pytest tests/ --cov=dwave.gate
License
Released under the Apache License 2.0. See LICENSE file.
Contributing
Ocean’s contributing guide has guidelines for contributing to Ocean packages.
Release Notes
dwave-gate uses reno to manage its release notes.
When making a contribution to dwave-gate that will affect users, create a new release note file by running
reno new your-short-descriptor-here
You can then edit the file created under releasenotes/notes/. Remove any sections not relevant to your changes. Commit the file along with your changes.
See reno’s user guide for details.
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
Built Distributions
File details
Details for the file dwave_gate-0.3.2.tar.gz
.
File metadata
- Download URL: dwave_gate-0.3.2.tar.gz
- Upload date:
- Size: 387.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21e19cbb87204e2f5918966295b58666edf2659b9b1c7045d487f03afd939628 |
|
MD5 | 818d10c7a101fcc756692571d5094bdd |
|
BLAKE2b-256 | a6a0f5d2784299c98c81eff9186ed3407f19a25dc445e87d52f054847fad9cd2 |
File details
Details for the file dwave_gate-0.3.2-cp312-cp312-win_amd64.whl
.
File metadata
- Download URL: dwave_gate-0.3.2-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 575.1 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 501c82aa3096f94d96df307bab67846781fb9d303a6d775a27bad192ff6501bb |
|
MD5 | c004182b25149bee44614b13ea3fd865 |
|
BLAKE2b-256 | 26318934ad492e256561e78fcfe17e3c0d0134d8a3ffb1520a44e022800676f4 |
File details
Details for the file dwave_gate-0.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: dwave_gate-0.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 798922755299c9e3bb7d298a94b3abf1f4e2453d44e9292a392fdf822996009f |
|
MD5 | 798d25dd40862bd876b3663a76e5f92a |
|
BLAKE2b-256 | 5113b99a0a6cd048933b20ba637f08fe1860a1b33bc892ef6c395157ba3b8479 |
File details
Details for the file dwave_gate-0.3.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: dwave_gate-0.3.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a1eef5532da30dcf95b4fe5c5441015db5a09baf36b6ba0a1ff691fa038b01f |
|
MD5 | 34b45358212e97e5c74e23439ed64386 |
|
BLAKE2b-256 | 84d13b1c2cd39bcbf1922514b4543f061f8afc5bbacbb8e1cf95b995645a79ef |
File details
Details for the file dwave_gate-0.3.2-cp312-cp312-macosx_11_0_arm64.whl
.
File metadata
- Download URL: dwave_gate-0.3.2-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 605.1 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f56557dd09db122704d00ba000f2135e370eba1eae271c2d0a8d7591b45d006b |
|
MD5 | d413d8e2620f4aefa7e03ada7c0695dc |
|
BLAKE2b-256 | ba0ab2f22cf871b944ba7228bccce9f9de04779dedd579dc4cccf096b3bc52ba |
File details
Details for the file dwave_gate-0.3.2-cp312-cp312-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: dwave_gate-0.3.2-cp312-cp312-macosx_10_9_x86_64.whl
- Upload date:
- Size: 614.8 kB
- Tags: CPython 3.12, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7801231f9b737195a201f4fac913fd317f83ffd8b5dc4a95024ea1b6a7c79e4 |
|
MD5 | 95d0edcf8132fddc7c486b301be3fa2c |
|
BLAKE2b-256 | 01ab19d358402f6c14433e037620d653ef91468612e14b92697b8dcc3c331de2 |
File details
Details for the file dwave_gate-0.3.2-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: dwave_gate-0.3.2-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 576.8 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4fc7c1bf6f7abe882ffe4195684328ecec75aa0bf71e7fa12f3e259199771da |
|
MD5 | b479e9f88137904a1a4ac02fdca9c0e7 |
|
BLAKE2b-256 | 26d00640bec482be8113cade0fa92459bbd297bac19603854a4617eb0cc1a461 |
File details
Details for the file dwave_gate-0.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: dwave_gate-0.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4122b27aa64bf98bffee6f84d2a100dec5bfd037d0721b9e71602bfed74894a1 |
|
MD5 | cf2bfa481146ca949f9f69d6ff57436c |
|
BLAKE2b-256 | bad8a9049dc8927c1f309d904c756d164750e551bc0867f094b4fb0970dab960 |
File details
Details for the file dwave_gate-0.3.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: dwave_gate-0.3.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57048fb3707dd0961c2d6f87b2a1341bcb948704d291e8879aa0aea0fb9ed12c |
|
MD5 | 70043c7301d20df93de4eb14b1a65489 |
|
BLAKE2b-256 | cb9f4ede674e6d3e8a74ce11079b42be0aa3d5e6e9ca43e070cd48286981e52e |
File details
Details for the file dwave_gate-0.3.2-cp311-cp311-macosx_11_0_arm64.whl
.
File metadata
- Download URL: dwave_gate-0.3.2-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 604.4 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65e25ab457f919b330704619b0e330decb314823f6249fb0bf33c259603561c9 |
|
MD5 | f9386a16110e6c0edb6bc24697912dc9 |
|
BLAKE2b-256 | 85e53aa331f14fcf9aac290f835039c8ebdf740fa3d56ab979e8574a168c26af |
File details
Details for the file dwave_gate-0.3.2-cp311-cp311-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: dwave_gate-0.3.2-cp311-cp311-macosx_10_9_x86_64.whl
- Upload date:
- Size: 616.5 kB
- Tags: CPython 3.11, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8a69816aee748d04166d05dc8ee02849d03b530b24b40457ffa7fe2f8062828 |
|
MD5 | 376c6973464190824ba55eaf0215ff38 |
|
BLAKE2b-256 | 62aeef9c531e4c020edb08d19e21a5d251acf7d435802ff41ad441ae03634ddb |
File details
Details for the file dwave_gate-0.3.2-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: dwave_gate-0.3.2-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 576.8 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc42fd5753745415569ce2329be174c9bcacd6d1917569a76fe061f1013956ca |
|
MD5 | b5f815474f4ad9ac1bf0cc7f7b2485f4 |
|
BLAKE2b-256 | d03af3be9befb52b50f07e45e33b97b47953a3eddeed201b3b369b7028db744d |
File details
Details for the file dwave_gate-0.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: dwave_gate-0.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5393430771610d77048c9c82810d2f27d554322082dd91ec7b56636239f88c42 |
|
MD5 | 0590a0784951e35ca0b69fe5ced8d713 |
|
BLAKE2b-256 | c0727e9c26c9ff76aad8d64ecc7525fb627e2f70ade9bfa43d557e05023e6377 |
File details
Details for the file dwave_gate-0.3.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: dwave_gate-0.3.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0950dd0c8b2eb58e9e6605f7007664399903029f7d02a6b7bca693d009e1246e |
|
MD5 | 8fcf93ab050c2cce6eb0abff9fc3f4a7 |
|
BLAKE2b-256 | 9f7bf12b21f2d90263f362a0a9894fcb8f20b270d18e10574fa5f63438c89cee |
File details
Details for the file dwave_gate-0.3.2-cp310-cp310-macosx_11_0_arm64.whl
.
File metadata
- Download URL: dwave_gate-0.3.2-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 604.2 kB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ba99fbdab1d727783156a64c914d34f8e52100b7ce4ee3ee7e250040bc1b3d6 |
|
MD5 | 3b990d20b17a0dcb141b4d2c3697c088 |
|
BLAKE2b-256 | d5fb3fd3e1e95d05dd2817ea29f789392ba792f504680c729bbc2a101fea9b71 |
File details
Details for the file dwave_gate-0.3.2-cp310-cp310-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: dwave_gate-0.3.2-cp310-cp310-macosx_10_9_x86_64.whl
- Upload date:
- Size: 613.9 kB
- Tags: CPython 3.10, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f289fce63e94f25c7e6904adbad77ddaae1c9fe57634fd34531f83ef3159c83 |
|
MD5 | c075edc59ab1de7d49eca2830089e335 |
|
BLAKE2b-256 | e6d17d418b57f224f61ad714fd6381c742d69efe88274a55dec06fb32d58fa50 |
File details
Details for the file dwave_gate-0.3.2-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: dwave_gate-0.3.2-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 576.8 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 712bcd1f4162a32b715492e654d8f0c7aa4015df296ee0b7f6fc51c5a3de7990 |
|
MD5 | 86b14d0b99d16dc329b9bf8d0f551b35 |
|
BLAKE2b-256 | 19d5e2c57985a09664c204f1107a4042e7b5b1f0063f8a7fab5eb52be7286ae0 |
File details
Details for the file dwave_gate-0.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: dwave_gate-0.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6e009134fde0152278373752c78aeeea36492f39a128c7184b3e6489100e431 |
|
MD5 | e97b2d56228a62d318d8e4487fe134ae |
|
BLAKE2b-256 | 7f42e07079cb954598c0c1538be90805ea439a86506baf3152b3d35e41f9e677 |
File details
Details for the file dwave_gate-0.3.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: dwave_gate-0.3.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d908787c0b1d9870d00d4808c486b7bc272010da6a5997f98092e6de2829ee2 |
|
MD5 | 5fb76748f964355b82e5bcc0d61f3b3e |
|
BLAKE2b-256 | 4f89ea01e98ee3b70ebf22984cea94ca16eece2a0d6dcf0377fce3347eb59d9c |
File details
Details for the file dwave_gate-0.3.2-cp39-cp39-macosx_11_0_arm64.whl
.
File metadata
- Download URL: dwave_gate-0.3.2-cp39-cp39-macosx_11_0_arm64.whl
- Upload date:
- Size: 604.7 kB
- Tags: CPython 3.9, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 217d2062e303085fde1375f0f639ddc967ac621027edc02a8947b2b2087d6c20 |
|
MD5 | 20724c2eae122d0ce4e5e9e42b35f6e1 |
|
BLAKE2b-256 | 0d6c708f474f05b00bcc6b0331a71b5a7f52e0e15583a2c3a86b262e559182ad |
File details
Details for the file dwave_gate-0.3.2-cp39-cp39-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: dwave_gate-0.3.2-cp39-cp39-macosx_10_9_x86_64.whl
- Upload date:
- Size: 614.7 kB
- Tags: CPython 3.9, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b13c014cd993dc51e3664bc1a4268f4686d5798f976d0c53089cd5020220b354 |
|
MD5 | 5a57f5c194fbdb99f73393df7cde5644 |
|
BLAKE2b-256 | 13194d4be8b0c322e7a9897ee7c664a786de985544316a586397e2913d595b0b |
File details
Details for the file dwave_gate-0.3.2-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: dwave_gate-0.3.2-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 575.3 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e807e12e7a59722282cfb0ea6a287c0c21522b377f6811f738c656b213ff9db |
|
MD5 | 963ee29a99bbd9b1756cefba4e405625 |
|
BLAKE2b-256 | fe84b0e2cb6702053e2daec4813068a01f4cd23f07a376dc8a0787fab8d706bc |
File details
Details for the file dwave_gate-0.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: dwave_gate-0.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46432fd6d279b3d0d43bbb69fcf0edf036b5d05718753be91577ad58eb5610fe |
|
MD5 | 688880b623e6292236e32b334a853760 |
|
BLAKE2b-256 | 697dce2b28e8bdca169cd25ab6c0a2e0f716e9d3c15f6f600e6a10196edcf87c |
File details
Details for the file dwave_gate-0.3.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: dwave_gate-0.3.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.8, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2ededfb198e790d5d3a0561a6b9d18dec756aaac5c6e3e25c9ab4d07a9f7016 |
|
MD5 | 3f97d29d5b0c3b7b8f9229c2f3bbd7e2 |
|
BLAKE2b-256 | 78d4048003075dbfa5064275e545cab88c05691ae348950bf46d90e87d9e05d5 |
File details
Details for the file dwave_gate-0.3.2-cp38-cp38-macosx_11_0_arm64.whl
.
File metadata
- Download URL: dwave_gate-0.3.2-cp38-cp38-macosx_11_0_arm64.whl
- Upload date:
- Size: 603.2 kB
- Tags: CPython 3.8, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a3dec286fcde054a196453d782d67417d99d23e27b7394e503bb53b993628e5 |
|
MD5 | acf896a256cac022361e38d245e754f8 |
|
BLAKE2b-256 | dcd63d04939889b1fe35dbafb549f214c947ae298c329da381417195b4c44dc1 |
File details
Details for the file dwave_gate-0.3.2-cp38-cp38-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: dwave_gate-0.3.2-cp38-cp38-macosx_10_9_x86_64.whl
- Upload date:
- Size: 612.8 kB
- Tags: CPython 3.8, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ce3ade9a027d1c5b470a05e31e61492c302f7a1697ca9aa0d18b6912882e031 |
|
MD5 | 255e381286d7191dcbc8fbcf81663d42 |
|
BLAKE2b-256 | fdbc25b44e3c85bbcf74175b64805dbf33240b94e1ad225523d9fb5e531953ca |