Skip to main content

Gate model library.

Project description

dwave-gate is a software package for constructing, modifying and running quantum circuits. 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:
    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 (on Unix systems):

make install

The makefile will also simplify running tests (make test), coverage (make coverage) and formatting (make format) the code using the Black formatter (set to a line-length of 100) and isort.

Alternatively, the package can be built and installed using Python (on any supported system):

python setup.py build_ext --inplace

and tests and coverage can be run using Pytest:

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.1.0.tar.gz (262.8 kB view details)

Uploaded Source

Built Distributions

dwave_gate-0.1.0-cp311-cp311-win_amd64.whl (167.4 kB view details)

Uploaded CPython 3.11 Windows x86-64

dwave_gate-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

dwave_gate-0.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.0 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

dwave_gate-0.1.0-cp311-cp311-macosx_11_0_arm64.whl (181.7 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

dwave_gate-0.1.0-cp311-cp311-macosx_10_9_x86_64.whl (201.7 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

dwave_gate-0.1.0-cp310-cp310-win_amd64.whl (168.3 kB view details)

Uploaded CPython 3.10 Windows x86-64

dwave_gate-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (960.2 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

dwave_gate-0.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (943.1 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

dwave_gate-0.1.0-cp310-cp310-macosx_11_0_arm64.whl (185.7 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

dwave_gate-0.1.0-cp310-cp310-macosx_10_9_x86_64.whl (206.5 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

dwave_gate-0.1.0-cp39-cp39-win_amd64.whl (171.3 kB view details)

Uploaded CPython 3.9 Windows x86-64

dwave_gate-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (983.0 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

dwave_gate-0.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (972.8 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

dwave_gate-0.1.0-cp39-cp39-macosx_11_0_arm64.whl (185.8 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

dwave_gate-0.1.0-cp39-cp39-macosx_10_9_x86_64.whl (207.2 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

dwave_gate-0.1.0-cp38-cp38-win_amd64.whl (171.4 kB view details)

Uploaded CPython 3.8 Windows x86-64

dwave_gate-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (996.3 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

dwave_gate-0.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (978.3 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

dwave_gate-0.1.0-cp38-cp38-macosx_11_0_arm64.whl (183.7 kB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

dwave_gate-0.1.0-cp38-cp38-macosx_10_9_x86_64.whl (204.4 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

dwave_gate-0.1.0-cp37-cp37m-win_amd64.whl (168.4 kB view details)

Uploaded CPython 3.7m Windows x86-64

dwave_gate-0.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (915.0 kB view details)

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

dwave_gate-0.1.0-cp37-cp37m-macosx_10_9_x86_64.whl (201.8 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: dwave-gate-0.1.0.tar.gz
  • Upload date:
  • Size: 262.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for dwave-gate-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8cb67ec79b6b8383e87db1678454dcb976b105d35b08de0c9c8b89e8e36cba80
MD5 79953a648baf275ebb9188fe2e24b316
BLAKE2b-256 e5ec7731e1a362fccc8aa7779e1eb92d74efcd25be094332148640765dbd33f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 dd4f5add87735a2f97663fdee09a5bc0d99eedb4b32d7ccd5be40be91098d822
MD5 752421d95c8dea012141b30f94967a16
BLAKE2b-256 4783958d4f9e26aed8425f2a75af9afdae9f6e94a76343ec2eeb8a6287adf7ca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e56a827fa4197ce678ce15975be481b7f113254b570b94977113f588a9bfe674
MD5 be8f707374ade42f7746a67bd25aad9b
BLAKE2b-256 570ac6473deba07dac09677543ef3ce95290ea1033ddf16c8dd1a3ffa1d43247

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 cb54e1fcb6e554c7b27ed545b7fce4ef16e9232c4dd3820a5f32f0be20f35c03
MD5 8acf71b1f3f766a39cd703eb5c7e9838
BLAKE2b-256 3dd997f06e50a9283250e09aca7d12fba4747e68a4e169fb6c9a0e82710da81a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 573603832431612e788b2994e0b613c0aa9dab099592c3d019aa103bca7a52e8
MD5 bf00af249dd199732a642c7bbcd8a831
BLAKE2b-256 9ee5ea601271fd04c723b354278e74aaa1f0e6f4c0e107ba77919cba425a5782

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.1.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 bb90a0f4e004adaccefc2a0edb335fce46c3cdd9984bcf34d1f024cba5980122
MD5 7b764b4e681597e7e5e06beee22a2bd0
BLAKE2b-256 d06802da72d74016014723615bd719ccd4b584b8fd4bfaa92284c50ce5ebc332

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e115c5d53d6a789590deee9a5e8a938486c19990c3ed9b85b2a1e28ea43c8d57
MD5 c915188eff804a574d943e8d70bee0fd
BLAKE2b-256 b2c0afd22cca06424aa7d255df36c693a02ff2dbd3f9ff126d12a6ab640bf50a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ec28088104400058d2a91920d0dd81f0803609944d60ed9645f4a1eba370b507
MD5 fbd591d347757cc4d208c341147f7a63
BLAKE2b-256 9e6c832023cb22be282c58b2cee2bbec262db2ceca0189b835f148f8020a4970

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 23359727b87d8670ea8d53a106c0044fafd785ead82bef563989ef83531c41f9
MD5 b3c4642c6da47bc49908c8383ed92078
BLAKE2b-256 94a447cae5afd838772bc1f9c227ad606e655b266b8b9f6d73a50212a4eddc8f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7108972ea8b6e3b8beecb8c9840b7b763e6e8e8bb3cc82c8a2f402ccedfd1223
MD5 eb110643bc5a3bdb3d11d2c454ebd101
BLAKE2b-256 d79d958c0bd780705e4858a8b4451a3712c4c307334f9a209fc4cec8e3a3a650

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.1.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 70101ac30a3da06cfcea64022fce48cdee1098865dc410c3727a505c799a120c
MD5 4312b203f21001bf9b7c474c9135768d
BLAKE2b-256 7712a4687952e556e9d8d18913ece468103ca38f2eb42c6a1cdc1acd8b12c1b6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dwave_gate-0.1.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 171.3 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for dwave_gate-0.1.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 ede7bef09120e198e2ab85ef3f615615ffae3bc27ae517bc2ef1ea3a021c820d
MD5 ed1d31e74086e9c58dcf1969f1d85d1e
BLAKE2b-256 19c15861abeabf6e788147660c5efe6659f3a737d6ee2cea2ef8c596c51a6960

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 304ada471e262bf79cbc5b6fd1631cf5dc09a8ccaffc6de9666ea0f8c920a452
MD5 a0c2fc9606c37a6c57c9edaba4ec6457
BLAKE2b-256 4e227d62c61be717a2088ced1544a0fa937c070c761bf9fbe2ec5d1d2499631f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e617ae78b8f9eca767a8184bef36029d653bf6f6c8422b7bfb00190cc40252ce
MD5 3324c328b26fa75c71eba16867572031
BLAKE2b-256 1fbbb99919529fd03b106ea58b5390753da5e7806d381ce668a2d4c4e9416111

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.1.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 20c5bc60c9240e7bfef0be9e3b800780529ff16d0bbcebf747d1995145fa8295
MD5 a9996046dfba23d6767d38c15d8aa4d8
BLAKE2b-256 0694e62d093b5e355dc37a689cd425aeb51b0f57780a4d576432f5699e5b1e6b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.1.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 db81b063f9b9cd6b20ce6a86f24fa0aec4bf3816caaa4c05155ecbda1fd9704f
MD5 48ced5b2cfb887bc60043c35de68d362
BLAKE2b-256 60230232f19ab3290c2de0a3adcb4a030f5e0a6b3f4e23b7984188a2e53e6d0a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dwave_gate-0.1.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 171.4 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for dwave_gate-0.1.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 ca4b795657d720619a5b9f4da940667235fac68c610bda3a728940bbcacfadab
MD5 befe68eb31d073eede401b9e38994954
BLAKE2b-256 5ca58462c0d4bd158e371ec46021b16ab6ad34fa423a0f8f7c01c2e7c55623b9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 89d29d119aa23c7c310def95f1def470471cb070f2986c8a1bff3222a9930034
MD5 507deca45041f8fd47d9b497c6f1e56f
BLAKE2b-256 0770f986dd65955eb724b9383221e8c90c14347150fc51dda6e7945c09605846

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 492ab0bd4b030da18578074743666ac9c2a0622e9805fa13c7e0d87769dd9921
MD5 5baa9c2d2fe15f7576b8efdcfa652f0f
BLAKE2b-256 07d236ec8d870abe20c0e7ff7b8daba7e64aac8201ffeecd49ea9c3cb2214dec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.1.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 021b43839e7d3054240527fe7c7deffda72e9357dd483cd13e2e561938d4b576
MD5 e0cc313325839fb30a0f0b13eaafecd9
BLAKE2b-256 4f5eaf5070d4a7d48a8c1bf5c3606b418526902f1b706185143b58a3490e8ff8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.1.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d16e3819c79bf67aa7b25e99a41d2cf8a66b952c97dfbffcf5c6964b1217366d
MD5 27e54ac27564260a9c7f0eeb04ccb24f
BLAKE2b-256 9691a29bbd151f5442d5811924efa90a22d1ea9cd990f2d59f82aa5fc00aaa94

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.1.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 55a78e248fe4f067219b4000a5bad786c03838599e02ee367fb3e00e1398b97b
MD5 031dc1314eccb84d1c94b6f09a5fe3b2
BLAKE2b-256 aa787e09fdae0231ea5a7bbd00c78fa73f30c479b379c568654e7b5b37689d71

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c6f2459d7db3b2ed1ef0483c1df0bb00eed31b2f2bc1781a499d7a2acd5effd6
MD5 40910319c9605a22cd40baae84435937
BLAKE2b-256 53aabd058627bc669db6f045a7ef8d6f386f9066d0836b612efbcafdf26135d9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.1.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e0b47da2e7332ad1b7c95003a585ba26fdba18882b86c3e5c506e3ca3a9b5a4f
MD5 9c02ffacb0b79562333d958870dd4964
BLAKE2b-256 e0df90b7a697735579b0708aa06e1eb6641a59600f158dcef27d8db3c6a9869b

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