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

Uploaded Source

Built Distributions

dwave_gate-0.2.0-cp311-cp311-win_amd64.whl (186.4 kB view details)

Uploaded CPython 3.11 Windows x86-64

dwave_gate-0.2.0-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.0-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.0-cp311-cp311-macosx_11_0_arm64.whl (202.6 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

dwave_gate-0.2.0-cp311-cp311-macosx_10_9_x86_64.whl (227.5 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

dwave_gate-0.2.0-cp310-cp310-win_amd64.whl (187.8 kB view details)

Uploaded CPython 3.10 Windows x86-64

dwave_gate-0.2.0-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.0-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.0-cp310-cp310-macosx_11_0_arm64.whl (208.4 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

dwave_gate-0.2.0-cp310-cp310-macosx_10_9_x86_64.whl (233.0 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

dwave_gate-0.2.0-cp39-cp39-win_amd64.whl (191.4 kB view details)

Uploaded CPython 3.9 Windows x86-64

dwave_gate-0.2.0-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.0-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.0-cp39-cp39-macosx_11_0_arm64.whl (207.5 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

dwave_gate-0.2.0-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.0-cp38-cp38-win_amd64.whl (191.4 kB view details)

Uploaded CPython 3.8 Windows x86-64

dwave_gate-0.2.0-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.0-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.0-cp38-cp38-macosx_11_0_arm64.whl (205.3 kB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

dwave_gate-0.2.0-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.0-cp37-cp37m-win_amd64.whl (188.5 kB view details)

Uploaded CPython 3.7m Windows x86-64

dwave_gate-0.2.0-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.0-cp37-cp37m-macosx_10_9_x86_64.whl (227.8 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: dwave-gate-0.2.0.tar.gz
  • Upload date:
  • Size: 287.8 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.0.tar.gz
Algorithm Hash digest
SHA256 e3484768095a5f01f88c961d0c78e091030273aa34270d9c1d687eebb8f12e8f
MD5 6bf6c5dad52fe08866386f98581e19f4
BLAKE2b-256 ecf924f4bdb7678e3c6d062f185fa7c4be3c08c504c798a9e8fa235572d6648d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.2.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 bbdc2e2be4cff53a075d3b9a031b3ef81194de67df5a58688718dba2f126631d
MD5 2520a6255ead5a4c9abc493c1ade6ede
BLAKE2b-256 3355ae37f789de5322547559c2dd17d93b106cb6217155b2ed3f944d28b65ca6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c769e4d8a8cc49944af14457b185b0ff319c771ed27b1542241f1f4d9871ad32
MD5 c61bf853c62c8382ede54262b143c559
BLAKE2b-256 f9da51dc8af9dcff73ea7bb36be391fb605b868f53f06bebb34671053a7f6450

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.2.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7d9e8b84c7dac4f161a7778f068487f5a07216f7f0120b4c749e324057dff27b
MD5 a66ff6d43a86fe6152b5258347abd441
BLAKE2b-256 5051f2bc0f994eca230f8d6ba41500447e20a990b1165b461f76af646c81c913

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.2.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b78453b925b39990e5b93ee1b6ddb52d99183b278fb183ef4aab490b1da5e49f
MD5 7f55f64d4612e73fc663c4314fcafc5c
BLAKE2b-256 4e804764a486dfeafda99504180b49770d6b04c851f78e2d7706f6111b28e2cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.2.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 2f445b41d88a4c0ef482ca522eec84867fd2d15c88538d136229d7f4cab67e3c
MD5 3cee0d36adf57fe5b3ea6c29439c0b92
BLAKE2b-256 20cc93d54b1e24d5fe5008a2479af1722c38486434a431c688fb47a1bff328bf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.2.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 3440441e6139f9dc60acfc1b3fa69c0a8e1dac2b250b8211e1a0da57e6952151
MD5 a2768384d437de4e092d58d3c5fcf20f
BLAKE2b-256 f2090ea029bf0946d2ab075ce100b1f6db4d4914dd90f7d92f6d98cac125834a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e169556737c7a3f20eb0358bb9573a24197cc3b280e4f1e7ae6a9e82b63ce4f6
MD5 4ac5379f1a29bf5642d8a2642bd37e08
BLAKE2b-256 31b016915921d9c0a7350fa662383a5dd1c71ec13de4f86a17d21c8ee29ef5e1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.2.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 791e6c260b463ed4ffca64b9cb4feb26c93dc79d441d77350c6a0da431ac357b
MD5 824c27af1ed702a9fcf66a1cfeb6092f
BLAKE2b-256 16b26bd1a498172a31293fd9327c01e16a21c2b8d505aef52c885a618b7d489c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.2.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 01c140f5f3c9c8f5b60344caada9b8cceedc0c47e8cdd6c0a34abb89e0cefc68
MD5 d309b1c076ac4f6e4c1753ec45ee82c7
BLAKE2b-256 1915b613aeed53facc8f676ff676ccb45cf6efbd37b483bd3d7b8979a71ad42e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.2.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 79c9d4b7aeaf02b9a3bb8e942c52c65b24ffc325d3c1087e478e369e8c5349d1
MD5 40f1db2d591604fcb0bd587bf52c79eb
BLAKE2b-256 496537cc058829e21e524ec2c1f1623646b4159f5ef958514961dc6476c5d1ef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.2.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 a45da018248bc5f3859b214f2c9fae817a05ef22fd55d6597d1d6c1db9e6a928
MD5 c1ba964851665a799c94df7bf5ff4aae
BLAKE2b-256 e11461704e6c044bc12a662bbd367c647c9a62e0d13929e6c46cc00743e92f2c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c22e696f35cb834868ed8702b599e95743f05ab2fbaccf95849a348a281c8b5e
MD5 35e9bd922df4c813f9a7a2ca1cb00e5e
BLAKE2b-256 b7724db0d91d3e90d58e58307c28491bb94059953e34c6bf43c70147560a1cf3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.2.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 68d6d71c4a2cf2399df404812689d26a48071267a37f0bf02cbc76381458ba2a
MD5 e71c1789e623d2227a31961f5e01b161
BLAKE2b-256 5a7af3a96f4c59db06e314314e63ee560a82c5d663321deb42c0b4e68568b5d9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.2.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7573b5aadc7935501eda585571afa3cba4259d5f51275eb8fb2ee0aa8cf59c01
MD5 4a8f38a35366c7147c19e6e51c03f794
BLAKE2b-256 3f8ea2c1f1ea802d42aaaa75f1e3b576058db89104c04ebdb5a29c5f6cd6be5f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.2.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 469eaeb783e912ccbf470cf0fbfdb7772d2e68fd8bfd672526a66e01b1c4dd35
MD5 e0de6dba99878c082c6242af68cc1f53
BLAKE2b-256 a8f8c3ca07882a1410297dbde2203f4c4a0ea8903a260ad8cc386e596c810294

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.2.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 87c4fb13ffa45021abc820549cf8ca41b9d7ffbca34015bcfecb4faae77d3c5e
MD5 18099d1aceb0f63e3afcf558869bfd09
BLAKE2b-256 198be2d405653f0ff57d0332f89193577e7f61a912ada24a2b21095e1dd31973

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5662fd56754a0ccfcb2e73febbafb4f05166d6df025a46c65a34ee0227ad83fd
MD5 a21e6fc7fb0a019547b637058f3cfbf6
BLAKE2b-256 5a58733ce68d396c4092bde911bd5afc8d09999c7e9744f4503368b2e6c75ca6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.2.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 fc003a2930975510414a1e59b75716d8a830f363408ca05eb026e5fbbe00fd1e
MD5 9e7484a1ad68d8cbfe20e70547251402
BLAKE2b-256 0aea6e4f95c06b63e5ef825054555ccfee5d2e02fc1c8bf7ff7501440f3ab1c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.2.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 57874e19888794cb258e5a4c55bd3c2ad8888124d5ae9d48f7490d0fe8428ff0
MD5 3cf118886f6c08cec61a080effaf430a
BLAKE2b-256 e02b3b1184d156645f97297626ff5f244e8e685f48ff366aaf7544c6d2bfe4d1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.2.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 81fb517802ba26b460923df43f1cce99aca096820d82172e6f60f3435e8b7573
MD5 02d3e1005a8a8beecc29ab99426da171
BLAKE2b-256 f64549700fcaea49bab72e60c017f8ece4c4050a4edc6a69621c7d6bf3a85bb8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.2.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 d9d8f7e0847b4d5bb6be1b7602d0f31708d8880ed940ee73e949b39936fca94b
MD5 c99d3908f12dd0845a3c947faa42c14d
BLAKE2b-256 ff95639c23275979ae4d4880b4cd8104e4d211be692b654e5acb2b3d221c7dbf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.2.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6026d15a2d5aa0255d95fef5900b2a9bc1c2148bf637b4d720b5d25e34c2f979
MD5 5f00c2ce60effcc4bb6fa0014c1d5488
BLAKE2b-256 6f7abf28b88d640ef5365cc547ce98919c18ea9808080f03a0f1e2a3b7e2cf77

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_gate-0.2.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f5d5356030aba5146b7f5efb99cf1dc6595125d22b657dd1515a976c7ce5b21a
MD5 9d2772ec522173cbfbe84430b1e6d6b5
BLAKE2b-256 8bf78a21961fa7b01ff944f486cbe00254649f9cd832019927018a367d5a3c2c

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