Skip to main content

qxelarator Python Package

Project description

QX Simulator

A universal quantum computer simulator.

Dependencies

QX should work on the following platforms.

  • Linux
  • Windows
  • MacOS

For compilation, you need the following things.

  • A C++ compiler with C++14 and OpenMP support (GCC 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.7) [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 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
qx.execute()                            # execute the circuit once, print the final quantum
                                            state
qx.execute(100)                         # execute the circuit 100 times, print measurement
                                            register averaging
qx.get_measurement_outcome(0)           # get measurement results from qubit 'n' as bool
                                            note: in the case of repeated execution, the very
                                            last value of the measurement register is returned
qx.get_state()                          # get quantum register state as string
                                            note: in the case of repeated execution, the very
                                            last quantum state is returned

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 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. The PyPI binaries assume that only SSE3 is available.

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.5.3-cp311-cp311-win_amd64.whl (3.3 MB view hashes)

Uploaded CPython 3.11 Windows x86-64

qxelarator-0.5.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.2 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

qxelarator-0.5.3-cp311-cp311-macosx_10_10_universal2.whl (2.5 MB view hashes)

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

qxelarator-0.5.3-cp310-cp310-win_amd64.whl (3.3 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

qxelarator-0.5.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.2 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

qxelarator-0.5.3-cp310-cp310-macosx_11_0_x86_64.whl (2.5 MB view hashes)

Uploaded CPython 3.10 macOS 11.0+ x86-64

qxelarator-0.5.3-cp39-cp39-win_amd64.whl (3.3 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

qxelarator-0.5.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.2 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

qxelarator-0.5.3-cp39-cp39-macosx_11_0_x86_64.whl (2.5 MB view hashes)

Uploaded CPython 3.9 macOS 11.0+ x86-64

qxelarator-0.5.3-cp38-cp38-win_amd64.whl (3.3 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

qxelarator-0.5.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.2 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

qxelarator-0.5.3-cp38-cp38-macosx_10_15_x86_64.whl (2.5 MB view hashes)

Uploaded CPython 3.8 macOS 10.15+ x86-64

qxelarator-0.5.3-cp37-cp37m-win_amd64.whl (3.3 MB view hashes)

Uploaded CPython 3.7m Windows x86-64

qxelarator-0.5.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.2 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

qxelarator-0.5.3-cp37-cp37m-macosx_10_15_x86_64.whl (2.5 MB view hashes)

Uploaded CPython 3.7m 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