qxelarator Python Package
Project description
QX Simulator
A universal quantum computer simulator. Allows simulation of a quantum circuit written in cQasm.
For detailed documentation, please visit the ReadTheDocs page!
Dependencies
QX-simulator should work at least on the following platforms:
- Linux x64 and arm64
- Windows
- MacOS
For compilation, you need the following things.
- A C++ compiler with C++20 (GCC or LLVM/Clang for Linux, LLVM/Clang for MacOS, MSVC 2015 with update 3 or above for Windows)
- cmake (>= 3.13)
- flex (>= 2.6.1)
- bison (>= 3.0)
For the QXelarator Python module, you also need the following.
- swig (Linux/MacOS >= 3.0.12; Windows >= 4.0.0)
- python (>= 3.8) [for python interface to QX]
Installation
To build, run the following in the current directory:
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=<desired_install_path>
cmake --build .
cmake --target install # Linux/MacOS
cmake --target INSTALL # Windows
<desired_install_path>
must be an absolute path to where you want to install
QX.
QXelarator: QX as a Quantum Accelerator
QXelarator (note the typo; sorry) is the python interface to QX simulator, which is perhaps the easiest way to start simulating quantum circuits.
API
qxelarator
mainly provides the following API calls:
qx.set('basic.qasm') # set the required qasm file to be executed on QX
qx.set_string('version 1.0\nqubits 2\nh q[1]') # set the required qasm string to be executed on QX
qx.set_json_output_path('output.json) # set the path to the output JSON, containing
either complex amplitude (single shot) or
measurement register averaging
json_string = qx.execute() # execute the circuit once, print the final quantum
state and measurement register, save the result as JSON in json_string
json_string = qx.execute(100) # execute the circuit 100 times, print the very final quantum state
and measurement register averaging, save the result as JSON in json_string
Installation
The easiest way to get QXelarator running on your machine is to use a pre-built wheel. These are available for 64-bit Windows, Linux (x64 and arm64) and OSX, for all currently active Python versions. You can install them as follows.
python3 -m pip install qxelarator --user
Alternatively, you can build and install from source using
python3 -m pip install -v -e .
The latter might run faster on your machine, as it allows the compiler to
optimize for your particular CPU (i.e. -march=native
for GCC).
Licensing
QX is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.
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 qxelarator-0.6.1-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39c65a589638f453cdcbe6dc73488fb256c245d8dfb159a92c9d6fecf94ed98b |
|
MD5 | bd96eaffe352242eeeef666071ccb649 |
|
BLAKE2b-256 | 84d39d6c38da647204f5298d2cd3e253315a5999b992ba23d8a28cd1b3e11347 |
Hashes for qxelarator-0.6.1-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b218f1d7257620738bdc25bc6b40b0fbb052b34a8e2b7108a91b669244041d0b |
|
MD5 | 041c5de9e2919af2813f1c6247d7bd2e |
|
BLAKE2b-256 | 701dbdc275e83d501b21e64b13acdd451db0d5809e0d823b6be2506eaf3dff8e |
Hashes for qxelarator-0.6.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 907673e58a1bf35831b13e2fe5f96952e162dc673096497982297cca124588ae |
|
MD5 | e121558c60151173bdbc5a324cf04eaf |
|
BLAKE2b-256 | fab45d9ffc96efb094e76f8a2758b99fd6297caebf8a22288ad214355b2260ee |
Hashes for qxelarator-0.6.1-cp311-cp311-macosx_10_10_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01b669c40b680ba59981ca70389245278eeb79805dd647f1d00c0d2e8a0bdd60 |
|
MD5 | d56b1ba1821a806df40df7d0b25af7a2 |
|
BLAKE2b-256 | 392ffaa48ae453de3d268dc00a654723c47d3654d857f2a24779ec0ec16f9708 |
Hashes for qxelarator-0.6.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94ba0e32d7e6798ddf1e4dd7256d2db64704f964ee516a134e1234c95ce58d29 |
|
MD5 | 4503e4e9562a08b0e34f47d94acdf220 |
|
BLAKE2b-256 | 54719809d2bb08c2aee3c0922c662433d2b14fac972dc0c9f88edb26d3c7a636 |
Hashes for qxelarator-0.6.1-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a87dc9f79ab1fe51a99d191f6db8bf4a51c02edc98e69dd425c0c19d3e2d037d |
|
MD5 | cd599ff48735c9af7804b58ffa768e4b |
|
BLAKE2b-256 | a87c95ff5b2e7e6c467af56b0db79ca548a9483fad18fa84160f8f9898e33857 |
Hashes for qxelarator-0.6.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05f28e732c198f0f9cbd0da48cd6cca1c093cea48b096581721548d90413642c |
|
MD5 | 2566acba1b8283597a5ed33d409be0dc |
|
BLAKE2b-256 | 6de88ed934319de27b088e7c11b05c0d61c12283435d95352fe1076a7a9e8d3a |
Hashes for qxelarator-0.6.1-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 913aa052e4f84c3bb12640bc1a4f208358623016ea2d26551799d3e815c62587 |
|
MD5 | 47026947dbd2f72ca0a0348bf87671b6 |
|
BLAKE2b-256 | 80f7cf43fc14c174dce541933e3932a79d2f7b02202c8774809ad77773d86ff0 |
Hashes for qxelarator-0.6.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 886f3cf287d3faa499e4945d989a2909b20f3af81fc6a37ee2b839edbb60c29c |
|
MD5 | bba2e0ccbf2c5c7faf5108227bdafb45 |
|
BLAKE2b-256 | 54bc5612ac1bbbc8b4ec5d95bad83da743ab99297b80e821e2118651350db174 |
Hashes for qxelarator-0.6.1-cp39-cp39-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d61c23b0b7af67d08112478dde47213045aefd8614eb6585205e38090eddf15d |
|
MD5 | 417cf5bb120e193f299f88a067fff2dd |
|
BLAKE2b-256 | e87813436965e718fd7147f8d335c19afee63b3e9818c12d8218e29cdf243247 |
Hashes for qxelarator-0.6.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20cf0d36374cfaf61985254a21e8bf0fe47c15931415bb6810e68c919f89429d |
|
MD5 | 14bb47470f2f1aa2d66801142e8f646f |
|
BLAKE2b-256 | 25e2ff85595a700f4a435851624a2d5fa0ba5cee27d0bff3c86c584fba7ad0ec |
Hashes for qxelarator-0.6.1-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a82586fd958e86c8a5aeece7ad71429075658298af5bb6265bd5fc6576ba0b5 |
|
MD5 | 0b559c1244ca232a5b2ec1925a73903a |
|
BLAKE2b-256 | 0ea7a2b4dbfbfac17e1005e0973978e15b84056ad19484f646cdf859b26de0e7 |
Hashes for qxelarator-0.6.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d71f21c0be88c69db2f6dce07bf41426cde350c22c784de012fdd79eee848e76 |
|
MD5 | 95b9d9d0b336643e8fe4a093fe5cf7c4 |
|
BLAKE2b-256 | 5f4e8b9de7e3e288c26d8ea06d14b08543936c96ba3ef24213e229e435b5a414 |
Hashes for qxelarator-0.6.1-cp38-cp38-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16f333836ee34e25ec26cc43019162d14fff7730bd784040d6b1148a78bc605c |
|
MD5 | 965eb737fa839cf3835a8c03126405bb |
|
BLAKE2b-256 | b5fd7c287d5008a1134ea95f1b618e6af47918683bdf4f1a0fd05899e31a1d77 |
Hashes for qxelarator-0.6.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0efb906c1738b82c31dbd727f8a81703b32a84a6cc92e94aacb711e0b14f226 |
|
MD5 | 3562de886b813f2ed19c1e2d921ca24d |
|
BLAKE2b-256 | 1bd6e11b329dc93d17e2f9475511b51e18044de37914041e371f40a8c022434f |
Hashes for qxelarator-0.6.1-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b26debb503a4122acda9d12a55d021e721be77f6974ad9684eb437d2627a3ce4 |
|
MD5 | ca27bbd3b6c2ddbc87f0e016b7c083ec |
|
BLAKE2b-256 | 6a4c40cad20dd43cf224ca950d7e87c751041469cef4c43c5ee0e46f1b1783ae |