A DQCsim backend for the QX simulator
Project description
DQCsim QX backend
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 forinit()
): specifies the gate detection RMS tolerance using a JSON argument of the form{"epsilon": <float>}
. Epsilon defaults to 1e-6.
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
Built Distributions
File details
Details for the file dqcsim_qx-0.0.5-cp38-none-manylinux2010_x86_64.whl
.
File metadata
- Download URL: dqcsim_qx-0.0.5-cp38-none-manylinux2010_x86_64.whl
- Upload date:
- Size: 362.2 kB
- Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d0e8d77128530d99021df08901392228c5eadaa79e666f27c7fed8dcb47954a |
|
MD5 | b8f7b42e78bc817f34546f88fbbac4c1 |
|
BLAKE2b-256 | 42f0fdd45e3c3ce298840b41037c32cf1bab4bcb8d4494cedf1c4428f49454bc |
File details
Details for the file dqcsim_qx-0.0.5-cp37-none-manylinux2010_x86_64.whl
.
File metadata
- Download URL: dqcsim_qx-0.0.5-cp37-none-manylinux2010_x86_64.whl
- Upload date:
- Size: 362.2 kB
- Tags: CPython 3.7, manylinux: glibc 2.12+ x86-64
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5be1e7614a4f801e8e8ac6b43fe5fe23b3914b7600f7b626d597d01b7a3daa24 |
|
MD5 | dcb35b86bc626ead56653e89a37e8843 |
|
BLAKE2b-256 | bf38bbaa4d237a38d2a810384c55684abed096fb663378b2ff5d38c0071b731a |
File details
Details for the file dqcsim_qx-0.0.5-cp36-none-manylinux2010_x86_64.whl
.
File metadata
- Download URL: dqcsim_qx-0.0.5-cp36-none-manylinux2010_x86_64.whl
- Upload date:
- Size: 362.2 kB
- Tags: CPython 3.6, manylinux: glibc 2.12+ x86-64
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 870053e8e98094bce8bf6b9c0019c7c48f45063421c10055b739e0737456fc9d |
|
MD5 | 7ea92d6d10a77571802978ce1e77e3c9 |
|
BLAKE2b-256 | ffc8bb04413e2427c4d5a027ef1b7e4686d6320ddf579ca14691552b2225df8f |
File details
Details for the file dqcsim_qx-0.0.5-cp35-none-manylinux2010_x86_64.whl
.
File metadata
- Download URL: dqcsim_qx-0.0.5-cp35-none-manylinux2010_x86_64.whl
- Upload date:
- Size: 362.2 kB
- Tags: CPython 3.5, manylinux: glibc 2.12+ x86-64
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 836f0de2c531052a697491301f0ab9dac79bfa9e32749e8da05a3313d5f1e3e6 |
|
MD5 | ec5c7a67bbb20af7997c6d3d39a101a2 |
|
BLAKE2b-256 | bbe7d69e36d095c6417ac5e3a0b72566a4cf17bda76a30c6b40269fd41f40f87 |