https://arxiv.org/abs/2304.00045
PyQBench is a package for benchmarking gate-based quantum computers by estimating how well they can discriminate between two von Neumann measurements. PyQBench is built around the Qiskit ecosystem and its configuration is driven by YAML files describing the experiment scenarios and backends to be used.
Installation
PyQBench can be installed from PyPI using pip:
pip install pyqbench
Quickstart
The most basic way to use PyQBench is by using its CLI. For more advanced usages see PyQBench's docs.
PyQBench's CLI can only run experiments using the parametrized Fourier family of measurements. Here's a basic example of how it works:
Step 1: preparing configuration files
The first YAML configuration file describes the experiment scenario to be executed:
type: discrimination-fourier
qubits:
- target: 1
ancilla: 2
angles:
start: 0
stop: 2 * pi
num_steps: 3
gateset: ibmq
method: direct_sum
num_shots: 100
The second file describes the backend. The precise format of this file depends on the type of the backend, here's an example for Qiskit's IBMQ backend:
name: ibmq_quito
asynchronous: true
provider:
hub: ibm-q
group: open
project: main
IBMQ backends typically require an access token to IBM Quantum Experience. Since it would be unsafe
to store it in plain text, the token has to be configured separately in IBMQ_TOKEN environmental variable.
Step 2: running the experiment
After preparing YAML files defining experiment and backend, running the benchmark can be launched by using the following command line invocation:
qbench disc-fourier benchmark experiment_file.yml backend_file.yml --output async_results.yml
The benchmark command will submit several batch jobs that will run asynchronously. It is non blocking, meaning that it won't wait for the jobs to finish.
You can check the status of the submitted jobs by running:
qbench disc-fourier status async_results.yml
Step 3: resolving asynchronous jobs
To get the actual results from the submitted asynchronous jobs, you can use resolve command.
qbench disc-fourier resolve async-results.yml resolved.yml
This operation is blocking and will wait for all the results to be available.
Step 4: tabulate results
Finally, the obtained results can be summarized into a table.
qbench disc-fourier tabulate results.yml results.csv
Here's what the result looks like:
| target | ancilla | phi | ideal_prob | disc_prob | mit_disc_prob |
|---|---|---|---|---|---|
| 1 | 2 | 0 | 0.5 | 0.57 | 0.57 |
| 1 | 2 | 3.14 | 1 | 0.88 | 0.94 |
| 1 | 2 | 6.28 | 0.5 | 0.55 | 0.56 |
What else can PyQBench do?
The above quickstart guide does not cover:
- Running the experiments in synchronous (blocking mode)
- Using error mitigation via M3Mitigation suite
- Using user-defined measurements instead of the default Fourier
Refer to PyQBench's documentation for further reading.
Authors and Citation
PyQBench is the work of Konrad Jałowiecki, Paulina Lewandowska and Łukasz Pawela.
Support email for questions dexter2206@gmail.com.
If you use PyQBench, please cite as per the included BibTeX file.
Metadata
Release files for pyqbench 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pyqbench-0.1.2.tar.gz | 175.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyqbench-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 366.7 kB
Release files / pyqbench-0.1.2.tar.gz
| Download URL | pyqbench-0.1.2.tar.gz |
|---|---|
| Size | 175.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b769c13bb2dbff3f4421681580ac153308b4e78fe9c4f67f0baa596f6db61c64
|
|
BLAKE2b-256 checksum How to use checksums |
ead0bbb4bebfa310c1ab13dcd40ee2c0f1bbab32288816fcc806c6013e677d67
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / pyqbench-0.1.2-py3-none-any.whl
| Download URL | pyqbench-0.1.2-py3-none-any.whl |
|---|---|
| Size | 191.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
19a7d388264e71032d4bbfe3b69c89c356f0f9498a344790dda3ff843a49cbf7
|
|
BLAKE2b-256 checksum How to use checksums |
c2cbe1aac7749bc80088e461a3c569386679a572decd4422201d3791964d2b2d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Security for pyqbench 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.