Skip to main content

DQCsim QX backend

PyPi

See also: DQCsim and QX.

This repository contains some glue code to use the QX simulator as a DQCsim backend.

Status

The backend should support:

  • The following gates: H, cnot, Toffoli, I, X, Y, Z, S, S', T, T', CZ, swap, RX(angle), RY(angle), RZ(angle), measure X/Y/Z, prep X/Y/Z.
  • Depolarizing channel error model.
  • Dynamic qubit allocation upstream, as long as the number of qubits ever live at a time does not increase after the first measurement (prefixing the algorithm with an allocation of the desired number of qubits followed by a free of those qubits is enough to tell the backend you want to allocate that many).

Install

You can install using pip using pip install dqcsim-qx or equivalent. If you're installing with --user, make sure that the path Python installs the executables into is in your system path, otherwise DQCsim will not be able to find the plugin. A simple way to see where the files are installed is to run pip uninstall dqcsim-qx; it shows which files it's about to delete before querying for confirmation.

Building/installing from source

  • Make sure all git submodules are checked out: git submodule update --init --recursive

  • Build the wheel file locally: python3 setup.py build bdist_wheel

  • Install the wheel file you just built: pip install target/python/dist/* (or equivalent)

Don't push a build like this to PyPI or attempt to distribute this wheel; it will likely only work locally due to hardcoded paths and the likes. Refer to release.md for more info.

Usage

Once the plugin is installed, you can use it by selecting the qx backend in a DQCsim command.

The following ArbCmds are supported for initialization and at runtime from host or upstream unless otherwise specified:

  • qx.error: selects the error model using the JSON argument, which can be:

    • {"model": "none"} to disable error;
    • {"model": "depolarizing_channel", "error_probability": <float>} to select the depolarizing channel error model. Note that like QX itself, this model does not take gate timing into consideration; it simply inserts an X, Y, or Z gate with the given probability before any gate in the circuit.

    If the error model is modified during execution, the model is applied retroactively back to the previous measurement, because the backend queues up gates in a circuit until a measurement gate is seen.

  • qx.dump_state: dumps the state of the quantum register, flushing the aforementioned gate queue to synchronize the state of the quantum register.

  • qx.epsilon (only for init()): specifies the gate detection RMS tolerance using a JSON argument of the form {"epsilon": <float>}. Epsilon defaults to 1e-6.

Release files for dqcsim-qx 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for dqcsim-qx 0.0.5
File
dqcsim_qx-0.0.5-cp38-none-manylinux2010_x86_64.whl CPython 3.8 none Linux glibc 2.12+ x86-64 Details
dqcsim_qx-0.0.5-cp37-none-manylinux2010_x86_64.whl CPython 3.7 none Linux glibc 2.12+ x86-64 Details
dqcsim_qx-0.0.5-cp36-none-manylinux2010_x86_64.whl CPython 3.6 none Linux glibc 2.12+ x86-64 Details
dqcsim_qx-0.0.5-cp35-none-manylinux2010_x86_64.whl CPython 3.5 none Linux glibc 2.12+ x86-64 Details

Total release size: 1.4 MB

Release files / dqcsim_qx-0.0.5-cp38-none-manylinux2010_x86_64.whl

Download URL dqcsim_qx-0.0.5-cp38-none-manylinux2010_x86_64.whl
Size 362.2 kB
Tags CPython 3.8 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
8d0e8d77128530d99021df08901392228c5eadaa79e666f27c7fed8dcb47954a
BLAKE2b-256 checksum
How to use checksums
42f0fdd45e3c3ce298840b41037c32cf1bab4bcb8d4494cedf1c4428f49454bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.10

Release files / dqcsim_qx-0.0.5-cp37-none-manylinux2010_x86_64.whl

Download URL dqcsim_qx-0.0.5-cp37-none-manylinux2010_x86_64.whl
Size 362.2 kB
Tags CPython 3.7 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
5be1e7614a4f801e8e8ac6b43fe5fe23b3914b7600f7b626d597d01b7a3daa24
BLAKE2b-256 checksum
How to use checksums
bf38bbaa4d237a38d2a810384c55684abed096fb663378b2ff5d38c0071b731a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.10

Release files / dqcsim_qx-0.0.5-cp36-none-manylinux2010_x86_64.whl

Download URL dqcsim_qx-0.0.5-cp36-none-manylinux2010_x86_64.whl
Size 362.2 kB
Tags CPython 3.6 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
870053e8e98094bce8bf6b9c0019c7c48f45063421c10055b739e0737456fc9d
BLAKE2b-256 checksum
How to use checksums
ffc8bb04413e2427c4d5a027ef1b7e4686d6320ddf579ca14691552b2225df8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.10

Release files / dqcsim_qx-0.0.5-cp35-none-manylinux2010_x86_64.whl

Download URL dqcsim_qx-0.0.5-cp35-none-manylinux2010_x86_64.whl
Size 362.2 kB
Tags CPython 3.5 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
836f0de2c531052a697491301f0ab9dac79bfa9e32749e8da05a3313d5f1e3e6
BLAKE2b-256 checksum
How to use checksums
bbe7d69e36d095c6417ac5e3a0b72566a4cf17bda76a30c6b40269fd41f40f87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.10

Release history Release notifications | RSS feed

This release

0.0.5 This release

4 release files

0.0.4

4 release files

0.0.3

5 release files

0.0.2

4 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page