Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

qxelarator-0.6.1-cp311-cp311-win_amd64.whl (3.4 MB view hashes)

Uploaded CPython 3.11 Windows x86-64

qxelarator-0.6.1-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (4.2 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.24+ ARM64 manylinux: glibc 2.28+ ARM64

qxelarator-0.6.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

qxelarator-0.6.1-cp311-cp311-macosx_10_10_universal2.whl (2.2 MB view hashes)

Uploaded CPython 3.11 macOS 10.10+ universal2 (ARM64, x86-64)

qxelarator-0.6.1-cp310-cp310-win_amd64.whl (3.4 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

qxelarator-0.6.1-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (4.2 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.24+ ARM64 manylinux: glibc 2.28+ ARM64

qxelarator-0.6.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

qxelarator-0.6.1-cp310-cp310-macosx_11_0_x86_64.whl (2.2 MB view hashes)

Uploaded CPython 3.10 macOS 11.0+ x86-64

qxelarator-0.6.1-cp39-cp39-win_amd64.whl (3.4 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

qxelarator-0.6.1-cp39-cp39-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (4.2 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.24+ ARM64 manylinux: glibc 2.28+ ARM64

qxelarator-0.6.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

qxelarator-0.6.1-cp39-cp39-macosx_11_0_x86_64.whl (2.2 MB view hashes)

Uploaded CPython 3.9 macOS 11.0+ x86-64

qxelarator-0.6.1-cp38-cp38-win_amd64.whl (3.4 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

qxelarator-0.6.1-cp38-cp38-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (4.2 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.24+ ARM64 manylinux: glibc 2.28+ ARM64

qxelarator-0.6.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

qxelarator-0.6.1-cp38-cp38-macosx_10_15_x86_64.whl (2.2 MB view hashes)

Uploaded CPython 3.8 macOS 10.15+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page