OpenQL Python Package
Project description
OpenQL Framework
OpenQL is a framework for high-level quantum programming in C++/Python. The framework provides a compiler for compiling and optimizing quantum code. The compiler produces the intermediate quantum assembly language and the compiled micro-code for various target platforms. While the microcode is platform-specific, the quantum assembly code (in cQASM format) is hardware-agnostic and can be simulated on the QX simulator.
OpenQL's source code is released under the Apache 2.0 license.
For detailed user and contributor documentation, please visit the ReadTheDocs page.
Dependencies
The following utilities are required to compile OpenQL from sources:
- C++ compiler with C++23 support (gcc 11, clang 14, msvc 17)
CMake
>= 3.12git
Python
3.x pluspip
, with the following package:conan
>= 2.0
Python build specific dependencies
SWIG
(Linux: >= 3.0.12, Windows: >= 4.0.0)- Optionally:
- Documentation generation:
doxygen
- Convert graphs from
dot
topdf
,png
, etc:Graphviz Dot
utility - Visualize generated graphs in
dot
format:XDot
- Use the visualizer in MacOS:
XQuartz
- Documentation generation:
- And the following Python packages:
plumbum
qxelarator
setuptools
wheel
- Optionally:
- Testing:
numpy
, andpytest
- Documentation generation:
m2r2
,sphinx==7.0.0
, andsphinx-rtd-theme
- Testing:
ARM specific dependencies
We are having problems when using the m4
and zulu-opendjk
Conan packages on an ARMv8 architecture.
m4
is required by Flex/Bison and zulu-openjdk
provides the Java JRE required by the ANTLR generator.
So, for the time being, we are installing Flex/Bison and Java manually for this platform.
Flex
>= 2.6.4Bison
>= 3.0Java JRE
>= 11
Build
This version of OpenQL can only be compiled via the conan
package manager.
You'll need to create a default profile before using it for the first time.
The installation of OpenQL
dependencies, as well as the compilation, can be done in one go.
git clone https://github.com/QuTech-Delft/OpenQL.git
cd OpenQL
conan profile detect
conan build . -pr=conan/profiles/tests-debug -b missing
Notice:
- the
conan profile
command only has to be run only once, and not before every build. - the
conan build
command is buildingOpenQL
in Debug mode with tests using thetests-debug
profile. - the
-b missing
parameter asksconan
to build packages from sources in case it cannot find the binary packages for the current configuration (platform, OS, compiler, build type...).
Build profiles
A group of predefined profiles is provided under the conan/profiles
folder.
They follow the [tests-](debug|release)[-unitary]
naming convention. For example:
release
is a Release build without tests and unitary decomposition disabled.tests-debug-unitary
is a Debug build with tests and unitary decomposition enabled.
All the profiles set the C++ standard to 23.
Build options
Profiles are a shorthand for command line options. The command above could be written as well as:
conan build . -s:h compiler.cppstd=23 -s:h openql/*:build_type=Debug -o openql/*:build_tests=True -o openql/*:disable_unitary=True -b missing
These are the list of options that could be specified whether in a profile or in the command line:
openql/*:build_type
: defaulted toRelease
, set toDebug
if you want Debug builds.openql/*:build_tests
: defaulted toFalse
, set toTrue
if you want to build tests.openql/*:disable_unitary
: defaulted toFalse
, set toTrue
if you want to disable unitary decomposition.openql/*:shared
: defaulted toFalse
, set toTrue
if you want OpenQL to be built as a shared library. The default option is mandatory on Windows.
Install
From Python
Install from the project root directory as follows:
python3 -m pip install -v .
You can test if it works by running:
python3 -m pytest -v
From C++
The CMakeLists.txt
file in the root directory includes install targets:
conan create --version 0.11.2 . tests-debug -b missing
You can test if it works by doing:
cd test/Debug
ctest -C Debug --output-on-failure
Use from another project
From Python
After installation, you should be able to use the bindings for the original API by just import openql as ql
.
The new API doesn't have Python bindings yet.
From C++
The easiest way to use OpenQL in a CMake project is to fetch the library and then link against it.
include(FetchContent)
FetchContent_Declare(OpenQL
GIT_REPOSITORY https://github.com/QuTech-Delft/OpenQL.git
GIT_TAG "<a given cqasm git tag>"
)
FetchContent_MakeAvailable(OpenQL)
target_include_directories(<your target> SYSTEM PRIVATE "${OpenQL_SOURCE_DIR}/include")
target_link_libraries(<your target> PUBLIC ql)
Note that the following dependencies are required for OpenQL
to build:
Flex
>= 2.6.4Bison
>= 3.0Java JRE
>= 11
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for qutechopenql-0.12.2-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd8183f29f20f5d56357dee5645eebed5ba3863be93c05046cd9a3b3dc6c35fc |
|
MD5 | 2b5e5999080ea1b4e9e2ac3f58b0f3e1 |
|
BLAKE2b-256 | f69fdcc50b750f82bcf025c3d83f54f2e112a26247a0856c0d6ace6af637d647 |
Hashes for qutechopenql-0.12.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87a38a148be507686cedb87943ce8acc5a2e127ef064582df49771e6917eb606 |
|
MD5 | 0a1fcf7b383739d6eae9476859eecc3b |
|
BLAKE2b-256 | 77d8e2d505539af73b1c5b1d791994d538bc23e50411956b7e609ba884f51901 |
Hashes for qutechopenql-0.12.2-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c0a1745e71e8c2eb77bd059259544fc316ef1f30e332bf1e442429a1eeccf81 |
|
MD5 | f0f6be9a59025334c5b6932f4070d7a8 |
|
BLAKE2b-256 | b85efab6b3718a732b51548b12d4acb912f143c830b10e79b5c657a60b1a5674 |
Hashes for qutechopenql-0.12.2-cp312-cp312-macosx_10_10_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04ba091887cfdbdb674c239245e75ea6c94be49d5bddb81eb639dda2c6767a84 |
|
MD5 | c8b3c09ee3eb7451282f58063aa87b7b |
|
BLAKE2b-256 | 1dd36bd22989648a8fc755bf48d6ca427e4aba6a44dbaedfdc34465c5afcfece |
Hashes for qutechopenql-0.12.2-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 705de7495c986290e489e19b1feb85538d3a748a5d15b0d053a6cccce7352e8a |
|
MD5 | 417151062c5efbd81c33da908d0ded34 |
|
BLAKE2b-256 | 0f43efbad1637828bb9229e58079d6ff546dd79a133a0b839321b50798cb3af3 |
Hashes for qutechopenql-0.12.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bbf83675c2bcff4e3d40478483da7fb8c473fa1e4418a8c03d81e8e53eaba77 |
|
MD5 | f6a6b35176c73a9808aa39b4644af010 |
|
BLAKE2b-256 | 2b3be0aa4f35a4ac4b1e5038bb45985c05bcf1075ea866a75e9b1f9e3b989758 |
Hashes for qutechopenql-0.12.2-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3328b6303063a6856cc8452441973cca0bf1d96b0144ac6f183ed076964ac051 |
|
MD5 | ffbe47779578dd675a46f0ca6a0c6be6 |
|
BLAKE2b-256 | afbebd235ad7cf57f514a34459c3ed9220d8c744470b17cb9e9ffdd5512699ce |
Hashes for qutechopenql-0.12.2-cp311-cp311-macosx_10_10_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b002d0e674ab96b689b35f873da1c031d45ea04f2287a2164ec970e218da2218 |
|
MD5 | 074fad9efe1994c4abc8e7b8b0c043d4 |
|
BLAKE2b-256 | e5d732dc934a1add0543e6c2f439963db28d52388c479cb86a066f8022275de2 |
Hashes for qutechopenql-0.12.2-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de8b2c3725c960b427887ce0181d42abefd3b37f06b04730eeac6b2e81f16851 |
|
MD5 | 2c2e76326a25f538cc4229c1aa871d15 |
|
BLAKE2b-256 | bc86cb1ffd3164448dd164b08d1bdb70084f0e4b4a94b4f24c488630dbdc9441 |
Hashes for qutechopenql-0.12.2-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45cb8ee75194d079d8683db4025167e6b51ffca5b208ab82d2bce47dd98e9706 |
|
MD5 | 3eb2f2dea122dc042356cf6b058ead3c |
|
BLAKE2b-256 | c1abe182ffaeefcf2881c0d33f7405541a8118db37d15cca678fbed97d259678 |
Hashes for qutechopenql-0.12.2-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88737ff3a3686fca1195c798ff3f53c5c131151249b76e3429a005e2c3da7b64 |
|
MD5 | b89b24fcd1bf2a24f36cad6e89ebe368 |
|
BLAKE2b-256 | fe6875af8e0440a2885cd2a755b96c529da2e87895f967d54b890a397a9ffdc9 |
Hashes for qutechopenql-0.12.2-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1e73a98b3a7c9c8c7fbcc702ae748905721937d5dc2254a20365df043cc224c |
|
MD5 | 949752d0131a7838d20afe22b406da38 |
|
BLAKE2b-256 | 9c146533cd132282cca37f720d4a4c3859974c088fcc3ab8aa7732a06176d0a3 |
Hashes for qutechopenql-0.12.2-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20ef98cfc9e7c34392626d5467713e2dd7829ca47579b6cd5815cdca2a9ef724 |
|
MD5 | ccb6a4628dedb9fff819f2e424315ff2 |
|
BLAKE2b-256 | 5682cdda1017f9c93b6243333aceaf3241eecd4905276f88f8d01e22df9d927d |
Hashes for qutechopenql-0.12.2-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0dfa4bd2d6216ec63a747e6dd4247a43f5b346e590fd558d0bc05161c1c96702 |
|
MD5 | a488fd76f6a282c071c411e5c7e26cee |
|
BLAKE2b-256 | 19efc1c4c5129bd67b0d1335855fd5650ba4f78bfe252116f5be9fe6a4829d41 |
Hashes for qutechopenql-0.12.2-cp39-cp39-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d1ca7ac3548e84583278ae595905c9a357fb9cd71b193c91d069df52171b65c |
|
MD5 | 4026133d6f0d7efcb485ba33d9bcc0b1 |
|
BLAKE2b-256 | 4d009ae5cb302d44e98230e65a950f9aa2369530b93e7099721c57203b0e9f4c |
Hashes for qutechopenql-0.12.2-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d29074fef48d3757763e9dc8634e1c0f1ad3f7fa553ed356262f97b7bc4f2b9 |
|
MD5 | 3bac2fc64dac9569d7976466921192e6 |
|
BLAKE2b-256 | 3e87f3cb656caa696f4d117f3b83f6f909cb20ed4c700b976f6f087ec713e94f |
Hashes for qutechopenql-0.12.2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf69b8b1c6e80ec5c03ab51350542867af888279ada47b21513a46b73427c3ab |
|
MD5 | 6f7f18cb89ae4b6b803f38cef289a7db |
|
BLAKE2b-256 | 4a36caa786e0df6d3cf32e00b45100c037fa4c92c5bdf557a05d62396b20f2ee |
Hashes for qutechopenql-0.12.2-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a85c94bea7a8756f9c8daab599b6e751d82bc45c44fe8df898f83b533acbe1f |
|
MD5 | 64c69b2c35da4a88a8afb771ff4ac1e7 |
|
BLAKE2b-256 | 89ec6bc43545c2581372ffccacd14ca7e2ef1bb83b98cd9c3b4bcd89eaa2e528 |
Hashes for qutechopenql-0.12.2-cp38-cp38-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9dfcb4972e340e6e9b8ea97876b8180a2be6b5ab193309aecc61a069cded8309 |
|
MD5 | 994e29f20b56a7828f60ac3e4d86842f |
|
BLAKE2b-256 | 9f148fd44e76a3c71fb063d9fb2d5337512e207f6c0e2e80ccdf3f346810270e |
Hashes for qutechopenql-0.12.2-cp38-cp38-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 528e8f40d0daae566a5a33947323322705fe154ae368324b425fe17406f5670f |
|
MD5 | 18267a1e58d8c973a2c2ef1cfd051c58 |
|
BLAKE2b-256 | 40712ed5259a99307606713fe3b4c6e79eb4698227521b8326981eac116b4e1e |