Skip to main content

Gate model library.

Project description

https://img.shields.io/pypi/v/dwave-gate.svg https://img.shields.io/pypi/pyversions/dwave-gate.svg https://circleci.com/gh/dwavesystems/dwave-gate.svg?style=svg https://codecov.io/gh/dwavesystems/dwave-gate/branch/master/graph/badge.svg

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)
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

dwave-gate-0.2.1.tar.gz (289.0 kB view details)

Uploaded Source

Built Distributions

dwave_gate-0.2.1-cp311-cp311-win_amd64.whl (186.0 kB view details)

Uploaded CPython 3.11 Windows x86-64

dwave_gate-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

dwave_gate-0.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

dwave_gate-0.2.1-cp311-cp311-macosx_11_0_arm64.whl (202.2 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

dwave_gate-0.2.1-cp311-cp311-macosx_10_9_x86_64.whl (227.3 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

dwave_gate-0.2.1-cp310-cp310-win_amd64.whl (187.4 kB view details)

Uploaded CPython 3.10 Windows x86-64

dwave_gate-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

dwave_gate-0.2.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.0 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

dwave_gate-0.2.1-cp310-cp310-macosx_11_0_arm64.whl (208.2 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

dwave_gate-0.2.1-cp310-cp310-macosx_10_9_x86_64.whl (232.8 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

dwave_gate-0.2.1-cp39-cp39-win_amd64.whl (191.2 kB view details)

Uploaded CPython 3.9 Windows x86-64

dwave_gate-0.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

dwave_gate-0.2.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

dwave_gate-0.2.1-cp39-cp39-macosx_11_0_arm64.whl (207.5 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

dwave_gate-0.2.1-cp39-cp39-macosx_10_9_x86_64.whl (233.7 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

dwave_gate-0.2.1-cp38-cp38-win_amd64.whl (191.2 kB view details)

Uploaded CPython 3.8 Windows x86-64

dwave_gate-0.2.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

dwave_gate-0.2.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

dwave_gate-0.2.1-cp38-cp38-macosx_11_0_arm64.whl (204.9 kB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

dwave_gate-0.2.1-cp38-cp38-macosx_10_9_x86_64.whl (231.1 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

dwave_gate-0.2.1-cp37-cp37m-win_amd64.whl (188.7 kB view details)

Uploaded CPython 3.7m Windows x86-64

dwave_gate-0.2.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB view details)

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

dwave_gate-0.2.1-cp37-cp37m-macosx_10_9_x86_64.whl (227.7 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

File details

Details for the file dwave-gate-0.2.1.tar.gz.

File metadata

  • Download URL: dwave-gate-0.2.1.tar.gz
  • Upload date:
  • Size: 289.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for dwave-gate-0.2.1.tar.gz
Algorithm Hash digest
SHA256 d5e376670ee3066ceb66652813aeae62656cc7d84176dfba7296d857f5e6c511
MD5 06137d52dc47787e9ae71a669af9a4e2
BLAKE2b-256 4da4f1c4cd4d935619c40ef5bf284e968503a986551a68274d8c33ee4b91df49

See more details on using hashes here.

File details

Details for the file dwave_gate-0.2.1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.2.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 76ea2c3915dd7ba9ad2af62c0ee4ef6091347e11e434fc6f43b238eae56cb958
MD5 2fd8c57beee31ea060bfe356b1a8446f
BLAKE2b-256 eef5402a9c85d9ab84a4015b0457bc42269d541030220071e630d8a553877710

See more details on using hashes here.

File details

Details for the file dwave_gate-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fd45fe63a4f5209c117d58082aaf55c941a48f90a2635d3b45399a5ea3293df7
MD5 ba33959da9bf7ab5df8d7c9e79784cb7
BLAKE2b-256 78ccc5f0f8c74b0138c8a4d8d5df5f5eba0a554073f930b51425a74bbe4a5902

See more details on using hashes here.

File details

Details for the file dwave_gate-0.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 20ae7305e713ec3b384768b1970d0195270fc332687ea9d2910eab934d2f9f7f
MD5 a95237e8a17045539936998627b14613
BLAKE2b-256 19835ad5a695c9dc6ca1ea4e1bf3b773610d988edb123c061ec20ff5a532d2ed

See more details on using hashes here.

File details

Details for the file dwave_gate-0.2.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.2.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9463aaaf20d485fd4c298c640d0a10d6ac0f9452d3df18a147ac56ee6e530bef
MD5 3607412ea584dda86f46700cf8b94621
BLAKE2b-256 f6e8a6ef99b5892256fc6082a78a38980f659e8053701a00e228b360505c89ea

See more details on using hashes here.

File details

Details for the file dwave_gate-0.2.1-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.2.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 de87a717a26588d5d52020a704bd8d1aec848b660e047e61bcdc9a1b7fef0381
MD5 a27ae2f44df5164f1312f7800fb31c41
BLAKE2b-256 9443752a95d8a2330d272d408e05035f979700dfbc3798b746312b33b1deb32a

See more details on using hashes here.

File details

Details for the file dwave_gate-0.2.1-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.2.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 219948d9fbdc3cc054a6bce017bedc00c3ed46cd9e77c963a523ae3a15617b00
MD5 20cb79b4e998ba0a9f64e20f31bf1aba
BLAKE2b-256 d2d283a71f0b1bdfb7eb412924411e645ddedbfb24e4a624fbfe471132a5c5d9

See more details on using hashes here.

File details

Details for the file dwave_gate-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bac7ce3ea97475e138b320a954419cc110d74e6116661591ec0c0fa15a792ae1
MD5 a748fb60c8fd8e36588df3b941032d07
BLAKE2b-256 b3e9184c326343e8d78471a356b949bec43116197e4da2f97e35076bfca941ad

See more details on using hashes here.

File details

Details for the file dwave_gate-0.2.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.2.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4c13ad241be903b401c53fc97260d78c6b3e466420bd104913b18b38eea854ef
MD5 04b37fc1b7e1abc346ab9d40568f3207
BLAKE2b-256 a00ee8e1e187e9b0e9688018916658a4458203f38dc3db30e45005d58b02be0c

See more details on using hashes here.

File details

Details for the file dwave_gate-0.2.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.2.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d7b3f0973c524793fd44a30e8ab00549b05d19dfb8a9c3cfb0e0e404a4fa12a8
MD5 bcdc5480c34c83ad05b789aa5fa546a8
BLAKE2b-256 52bc9941a6b1cb6bef4708ab552db1c549e6a27d9d3a2a6bc2dc72744bb9c1e8

See more details on using hashes here.

File details

Details for the file dwave_gate-0.2.1-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.2.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f5ff98cafcfb48ae33e278db002161e269b8008552f84630c91e0fcb4a5a4dbd
MD5 a8ec0d4abc5ae4175a4519f4f66db3e6
BLAKE2b-256 7adb800e71975c34efac59c26426f24d3dc8132df18fc929fe8ebc8706e52b0e

See more details on using hashes here.

File details

Details for the file dwave_gate-0.2.1-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.2.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 fa79aedf4d1fa75e4f8f1aefb73d86c7ca799a669218f4b94b8da902bf0a7bf7
MD5 bcbc65404c31b7a441bf3b94f9e6e664
BLAKE2b-256 f5f0f38d3459e14dd1414d16eb4d86b7c19e3aa7b3986e5e4129d32162ca9d76

See more details on using hashes here.

File details

Details for the file dwave_gate-0.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2d04d7729ce4da12c844c0a11fd4bccefe16acab658960fdd4eef16d1e474d0f
MD5 4af9c648912d4e089f1f573e63e0c73f
BLAKE2b-256 e6ee52a74064763cea20e3bf556e00c1afa0c3408d3f44ccf5b91b458743dc57

See more details on using hashes here.

File details

Details for the file dwave_gate-0.2.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.2.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4ce658c686666d1cb88dfbdf61d4d0b34a2a54916c49477dbf1ee5879844132c
MD5 6c0281a575d4eb4aec92cd60886fc515
BLAKE2b-256 95e96986ec2374339b667972195b862d3290c375e72eed78772b4a98b8743904

See more details on using hashes here.

File details

Details for the file dwave_gate-0.2.1-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.2.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 48d31f76d442bfc28263c69ca0fbb2b10988617a95e277c2b1950db4e72f44ea
MD5 1afbd5f84bb4f7c01f42bdeeeab8ac17
BLAKE2b-256 32c75c5750de4f57cbb3ae8892b784bc25af65e0cff2fd1aa7d5c302ad12eb11

See more details on using hashes here.

File details

Details for the file dwave_gate-0.2.1-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.2.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 666357eaf69ec25ff2f21b80fde2f5d2702755a2510d3055b9b7e63f595ff15b
MD5 932a21244c635350cbbe9b8f5e13aa10
BLAKE2b-256 3e1c2c364cc733d15dc69581bf3b9955ddb771c46a38d8bbf6d67cd984d55a2f

See more details on using hashes here.

File details

Details for the file dwave_gate-0.2.1-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.2.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 9a21957a6787398cff1343f446d07296a64da17b0835d6941cdc569a45d3bc47
MD5 0b1092b8a0f18e3d5faa6a3dfc8d3638
BLAKE2b-256 90eadad78261adaf48f1eb2410594fc9b52767dc682b2d54ce24ff5628a8d551

See more details on using hashes here.

File details

Details for the file dwave_gate-0.2.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.2.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ab363daf734ce148520aafd8d6e001893ffc214eb8d1b6255c1827690703beec
MD5 d0ad97c2606d760c94c36397681f743f
BLAKE2b-256 06917ffd66c253bd28e7b27cb7030d98c599fe261a246a29f512962d7d8263cb

See more details on using hashes here.

File details

Details for the file dwave_gate-0.2.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.2.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6bd0fef7aab4a0f68711def4cd9c2f6756de6a104c3cdf044d181151ef1f94d3
MD5 66bbac282bcd20d4bb4970fa96a1d67a
BLAKE2b-256 5cff087138a89a5bdc8a6b5668f53bfd4bc617c02d4b7497c7e8ae8fa19d5ba4

See more details on using hashes here.

File details

Details for the file dwave_gate-0.2.1-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.2.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dd23746eaecf26b9f65e7ffa458a95ecc0dbf5266bbc365e48a67798a853c149
MD5 3acbaa5961de786eedbe62e45aade75b
BLAKE2b-256 c07bfc71869de5109de56b074beb2cae0bc794f63730a93bfb51052dd6fc08b9

See more details on using hashes here.

File details

Details for the file dwave_gate-0.2.1-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.2.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8ce9ef4800bb4cd640cb866b88446722db0ee0815fd266977fa2f01893e394b8
MD5 c7a783e5abaaaec968df655f1c55a21e
BLAKE2b-256 309bc0746b23f982c4e9f3925802f1a4d9b79f26fd26b7b06d2b0d96cea6bb72

See more details on using hashes here.

File details

Details for the file dwave_gate-0.2.1-cp37-cp37m-win_amd64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.2.1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 0625f928a7f08d2280cacbdeb98ebe5c05e79a13f39c8611c45567ad2d26d40c
MD5 3fe757b64adcf1dcba2e9cce4eedf8ef
BLAKE2b-256 1039ceb8a2390d3335a6a670f15aae6b2ad1ee1ddecf492e7ac2762df7965007

See more details on using hashes here.

File details

Details for the file dwave_gate-0.2.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.2.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bf1937f097406f9064fac5a8a396823ce00b241355136fe5e4b8e922f8f1faea
MD5 c9da2b39326ebdea8105f72821399853
BLAKE2b-256 666fb5ad581979fb77341d45cd7ee5b68684ddd7032e22d2ff7dd52b486382df

See more details on using hashes here.

File details

Details for the file dwave_gate-0.2.1-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.2.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 02d014888415053792c7083f258dde49fd36bbde6f422816426e62349bfc2d4d
MD5 d1f2fced5c08cffe4184325c6dc9b71e
BLAKE2b-256 e68f96427f7d22835d4b254844284409bdfd0e6ea61bdb9f1609b0ae85e75520

See more details on using hashes here.

Supported by

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