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

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

dwave_gate-0.3.3.tar.gz (388.9 kB view details)

Uploaded Source

Built Distributions

dwave_gate-0.3.3-cp313-cp313-win_amd64.whl (584.2 kB view details)

Uploaded CPython 3.13 Windows x86-64

dwave_gate-0.3.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.13 manylinux: glibc 2.17+ x86-64

dwave_gate-0.3.3-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.5 MB view details)

Uploaded CPython 3.13 manylinux: glibc 2.17+ ARM64

dwave_gate-0.3.3-cp313-cp313-macosx_11_0_arm64.whl (604.3 kB view details)

Uploaded CPython 3.13 macOS 11.0+ ARM64

dwave_gate-0.3.3-cp313-cp313-macosx_10_13_x86_64.whl (613.4 kB view details)

Uploaded CPython 3.13 macOS 10.13+ x86-64

dwave_gate-0.3.3-cp312-cp312-win_amd64.whl (584.7 kB view details)

Uploaded CPython 3.12 Windows x86-64

dwave_gate-0.3.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

dwave_gate-0.3.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.5 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

dwave_gate-0.3.3-cp312-cp312-macosx_11_0_arm64.whl (606.9 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

dwave_gate-0.3.3-cp312-cp312-macosx_10_13_x86_64.whl (616.0 kB view details)

Uploaded CPython 3.12 macOS 10.13+ x86-64

dwave_gate-0.3.3-cp311-cp311-win_amd64.whl (586.3 kB view details)

Uploaded CPython 3.11 Windows x86-64

dwave_gate-0.3.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

dwave_gate-0.3.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.6 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

dwave_gate-0.3.3-cp311-cp311-macosx_11_0_arm64.whl (606.2 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

dwave_gate-0.3.3-cp311-cp311-macosx_10_9_x86_64.whl (618.4 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

dwave_gate-0.3.3-cp310-cp310-win_amd64.whl (586.4 kB view details)

Uploaded CPython 3.10 Windows x86-64

dwave_gate-0.3.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

dwave_gate-0.3.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.5 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

dwave_gate-0.3.3-cp310-cp310-macosx_11_0_arm64.whl (606.0 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

dwave_gate-0.3.3-cp310-cp310-macosx_10_9_x86_64.whl (615.8 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

dwave_gate-0.3.3-cp39-cp39-win_amd64.whl (586.4 kB view details)

Uploaded CPython 3.9 Windows x86-64

dwave_gate-0.3.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

dwave_gate-0.3.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.5 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

dwave_gate-0.3.3-cp39-cp39-macosx_11_0_arm64.whl (606.5 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

dwave_gate-0.3.3-cp39-cp39-macosx_10_9_x86_64.whl (616.4 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

File details

Details for the file dwave_gate-0.3.3.tar.gz.

File metadata

  • Download URL: dwave_gate-0.3.3.tar.gz
  • Upload date:
  • Size: 388.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.7

File hashes

Hashes for dwave_gate-0.3.3.tar.gz
Algorithm Hash digest
SHA256 e2fb5ee48caa8bb49a929e883a4c4c04998767adec0b5b65c384a8e6df4a2cdb
MD5 5c81ef718c9a6a6b5616d939791e4e2b
BLAKE2b-256 d4e5eb7f1c7de0e9a2965e075a2bed8f8a9973a9316b4568ad7ca0714f51d335

See more details on using hashes here.

File details

Details for the file dwave_gate-0.3.3-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.3.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 0173491701a41621be9fbab56da8ca54593a08295520ee26022f2a5dfe9a608b
MD5 d09057d27c9065d77dc88366e1cadbe9
BLAKE2b-256 5875f37ba35013ea71f6cd889f706b6f68fe5493e6a67817b218e0e7697bde16

See more details on using hashes here.

File details

Details for the file dwave_gate-0.3.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.3.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 44762c31004f32ab4f20b0ad8ee7ac8011cbf99b4eebdf972ed488ea3f068d57
MD5 e738e2990c2bdc92c5db4fd5cd0766ae
BLAKE2b-256 60f06421dc63afa15a90a911d0893f91da2caae76c0ae756e6f4f51fcbe0e01c

See more details on using hashes here.

File details

Details for the file dwave_gate-0.3.3-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.3.3-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 10e2346fe9624b0a63e3a31e4af62a21e6e21f9d1b6d29324a8ae9babc0c958c
MD5 c247c67461bed20db0df5c3ff41b4630
BLAKE2b-256 3b77bb604aa7aa09284ee79eb85182959279001a0c2e9b43dbedbdfaa2c051ae

See more details on using hashes here.

File details

Details for the file dwave_gate-0.3.3-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.3.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2e181fbde3ce3198a3d36a3d5ae2468bf27c42518eb5195f14029432de91f19d
MD5 e7038a927b448be3e3f36313706e9604
BLAKE2b-256 067ebe4a086606de8a7cdbb4ad8a8fe1aeda6a4818a0d36027126ff455eef3f1

See more details on using hashes here.

File details

Details for the file dwave_gate-0.3.3-cp313-cp313-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.3.3-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 2813b776571d726edc6bdac086b5e13d51c8a3c389832daa0ecb3486e53f72ba
MD5 563b12890017367efdf7e4e565918b43
BLAKE2b-256 c88f4c4f5777242394be1be9ca97d1e7c9cc01659a6b85256cb07fc734524f8c

See more details on using hashes here.

File details

Details for the file dwave_gate-0.3.3-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.3.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9eb51a57904f046a9b895c91e204ecb57c778e190026b8f836a35a48ef74d2c5
MD5 b26af402cf347a33a09003cc94fa0c38
BLAKE2b-256 30b08485f7a0fd638272b5afb3884a79d8fa5af5eebc0f382b7041c664e22452

See more details on using hashes here.

File details

Details for the file dwave_gate-0.3.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.3.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a48b098a9cfc1293d088275ba738f650aac17ce2160b4c3e830501f78bde16e5
MD5 e626bca370642436d400c31dfe7eb877
BLAKE2b-256 ea367aeef983c96988db80fd0f15afb43849e75f3df7a03951b6d624d60cea0a

See more details on using hashes here.

File details

Details for the file dwave_gate-0.3.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.3.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 25fa319e467c760f858fac6b8aa226004e8d3b2ea72d14e25e9e8096c19357d3
MD5 ea6fa8c8f8d43fc618f327f20900e905
BLAKE2b-256 81e88b882f7d803fc767f9a8bb5aa0c081ee2c9c27fe623895a402d866639899

See more details on using hashes here.

File details

Details for the file dwave_gate-0.3.3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.3.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 843bcdfdd98c90be6e00a9b5dce5e152d0333c28b90aa5ed8f634ed91b34c3f6
MD5 e3d67e3e9de98aaa84c59a54b5886c85
BLAKE2b-256 2acc76a6569cdb6f284564b2646ab8f4010edef69b8af9a05a15f719701e9b72

See more details on using hashes here.

File details

Details for the file dwave_gate-0.3.3-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for dwave_gate-0.3.3-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 b8fb300baa7eea672750c08af3e8b4e9cd28bb437f7cfe9a6b29362445fe9b23
MD5 9a13c50e1f3c30d826a1c072719af168
BLAKE2b-256 b34d57579b885028d17535a428b92aa0d8baa762a3b863a3555413662af500c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.3.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0044ab6e7e839dd8fc54d32ab5b9eca8e877a054d5b1d76b264c23da1b5d92c0
MD5 915f01289ac7530c2985a4582c41e8d8
BLAKE2b-256 c680e3ef175cf25a26e4edf5bb02ec291437d5a8430a6bbeebd9027c3cc46c34

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.3.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dbc7a239e0bba1a2392136517ad2d236df7cd257a57ead9538dac81299546d01
MD5 7306a861b2fc24c41904b90139392688
BLAKE2b-256 85e79455b2383d0e1004f292f697e7385cc3e8d9493884c4a86353436d045ddd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.3.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d704011b408f13bdf2a9fac73d58169df6d4fb5d042c93c0d49fb29feacdd334
MD5 488094beeb10a4dd80bd0610d5c4fa8d
BLAKE2b-256 b913b5887cc445dba72c5ffd7ee46a4381f79db507a02dfa92e6dc0811c29750

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.3.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 810275b4052738da4c4f835938cc5dc32fd2aba4fa75294178f15dc5e0c970f1
MD5 5fc840a862b3f422c92fc641f8ec851d
BLAKE2b-256 38ec6ef20f9e5dd59d2fb9c529344b98ce8e5270c8a98f9e7583285236c4dcd9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.3.3-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6571deb6337ed8a5eed2878c0ac725354b9989aa922df67fbbe3f4bd2f30013e
MD5 dd2f312896b3782bd22c22c2fdbf481f
BLAKE2b-256 d839c46ae5c58b23e9da3932e05a556174665be54a7a0b00669d24594997bd2c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.3.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 eff2a1757d6ef61c3d35dc3b8c51ad27706041e5ddd6e03d346072e46579e740
MD5 c848fe09045b671d9c21d752f591fb1c
BLAKE2b-256 df6e1f6ffdeabb217ae58366a193f989e7e77f2e7f048bcf1cdad8c574075991

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.3.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 875249a8d5459779e45b9c34a0c80495156e10020f86ebe6ca2af7da151b0272
MD5 334d2cf0d09718c10666ff7132f4d748
BLAKE2b-256 9ff96284de376e9e612512bb23f087fd5772bc76887d1942171062ad4d865c1e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.3.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 bfe4d529c0e5430c3039ce8c023fd3c510e77138ad96f31cb6c44d3a314268ae
MD5 5fbf0cf39beb1bc5f439afb9df407325
BLAKE2b-256 2aeddcf0ab11d5646e4ce23b168406a8fac22312c38b7ab4c8779e5909d99f0a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.3.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5df63b602ddd5b4ece7efc82bdd2b8a75d7a163aaa7dd824f36f329e1358ebad
MD5 d9661f4d374c0a86d05bdfb74de1ea88
BLAKE2b-256 1257b469dc1c66480402c81f1f356b6095212d693ef4dca965270625f00c8cf0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.3.3-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 50dcffe5090ff0cb8305ccaf3b844deb6867d1d34958052c6738e2fa943fc99a
MD5 8be12aa187ac997967f035ce46f01355
BLAKE2b-256 b01cda706ce94df2a1504be3de7f86e7c731c7598829b6bf8d4e93982781f3eb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.3.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 077c662854b31b9c05bb2b91c0bce56cf02f4cdcc8e84f78935544d525649cb0
MD5 2da2138ab2cbd43c7077643e9a2a04ec
BLAKE2b-256 ffbf3adfcadaf02aa8a36c3a03aa2b4b4023f5517dffee50bbefbf654063e913

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.3.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 48055997525bc8cb707e2b0d75eddb216f994d06e2bcc4d59b64a5c5d3b45612
MD5 0f87e7a7a1dd3c57d81787ee4a1358bf
BLAKE2b-256 59c514f5acb57df3275b5d96e3baa9097f2bd3a528518b6c496dd76f51a14bed

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.3.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a03d176e79343b43d7a70e5e8e047c1b865d301c36e17110af961f0ab00e728c
MD5 e12ded333907d638a1d522098014654a
BLAKE2b-256 676b3716a6ab5478ac1bc985c66879d9ffeae56896d104f7c8117e7e102c869f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.3.3-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a7d3d64d7a6192d7febed8e67e2dcbe188e0f94a254ce2b783f7d449e474617a
MD5 04e4c25756a75b55b702ea0e81b39392
BLAKE2b-256 05845dd338d5b2ba9f5ac4838f525d3a98e31a4817c3ffd78029dd9b4af7e6b6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.3.3-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f030f73ec053ec57befcd5a6077313d5eb0ba511f00ae3fd7a87193b9bd86c43
MD5 3f2cbe8400ed38b7f3e4eaaa3b55d80f
BLAKE2b-256 cc837546b42233041a14eeac009e67f59501559646164b0a8287b4f55dd957aa

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 Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page