{"id":20669485,"url":"https://github.com/iitis/pyqbench","last_synced_at":"2025-04-19T18:12:35.077Z","repository":{"id":65087141,"uuid":"448000964","full_name":"iitis/PyQBench","owner":"iitis","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-09T16:21:00.000Z","size":842,"stargazers_count":4,"open_issues_count":10,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-29T11:34:28.584Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iitis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-01-14T14:44:47.000Z","updated_at":"2024-03-24T10:40:50.000Z","dependencies_parsed_at":"2023-02-19T00:45:37.579Z","dependency_job_id":null,"html_url":"https://github.com/iitis/PyQBench","commit_stats":{"total_commits":40,"total_committers":3,"mean_commits":"13.333333333333334","dds":0.07499999999999996,"last_synced_commit":"e72c52e970c81815093e1b39b62180342ba23227"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iitis%2FPyQBench","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iitis%2FPyQBench/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iitis%2FPyQBench/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iitis%2FPyQBench/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iitis","download_url":"https://codeload.github.com/iitis/PyQBench/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249760126,"owners_count":21321843,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T20:14:30.554Z","updated_at":"2025-04-19T18:12:35.059Z","avatar_url":"https://github.com/iitis.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Logo](https://raw.githubusercontent.com/iitis/pyqbench/master/docs/source/_static/logo.png)\n\n![GitHub](https://img.shields.io/github/license/iitis/PyQBench)\n![PyPI](https://img.shields.io/pypi/v/pyqbench)\n![Read the Docs](https://img.shields.io/readthedocs/pyqbench)\n\nhttps://arxiv.org/abs/2304.00045\n\n**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.\n\n## Installation\n\nPyQBench can be installed from PyPI using `pip`:\n\n```bash\npip install pyqbench\n```\n\n## Quickstart\n\nThe most basic way to use PyQBench is by using its CLI. For more advanced usages see [PyQBench's docs](https://pyqbench.readthedocs.io/en/latest/notebooks/Example%2001%20discriminating%20measurements%20in%20Hadamard%20basis.html).\n\nPyQBench's CLI can only run experiments using the parametrized [Fourier family of measurements](https://pyqbench.readthedocs.io/en/latest/reference/fourier.html#qbench.fourier.FourierComponents). Here's a basic example of how it works:\n\n### Step 1: preparing configuration files\n\nThe first YAML configuration file describes the experiment scenario to be executed:\n\n```yml\ntype: discrimination-fourier\nqubits:\n    - target: 1\n      ancilla: 2\nangles:\n    start: 0\n    stop: 2 * pi\n    num_steps: 3\ngateset: ibmq\nmethod: direct_sum\nnum_shots: 100\n```\nThe 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:\n\n```yml\nname: ibmq_quito\nasynchronous: true\nprovider:\n    hub: ibm-q\n    group: open\n    project: main\n```\nIBMQ backends typically require an access token to IBM Quantum Experience. Since it would be unsafe\nto store it in plain text, the token has to be configured separately in ``IBMQ_TOKEN`` environmental variable.\n\n### Step 2: running the experiment\nAfter preparing YAML files defining experiment and backend, running the benchmark can be launched by using the following command line invocation:\n```bash\nqbench disc-fourier benchmark experiment_file.yml backend_file.yml --output async_results.yml\n```\n\nThe `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.\n\nYou can check the status of the submitted jobs by running:\n\n```bash\nqbench disc-fourier status async_results.yml\n```\n\n### Step 3: resolving asynchronous jobs\nTo get the actual results from the submitted asynchronous jobs, you can use `resolve` command.\n```bash\nqbench disc-fourier resolve async-results.yml resolved.yml\n```\n\nThis operation is blocking and will wait for all the results to be available.\n\n### Step 4: tabulate results\n\nFinally, the obtained results can be summarized into a table.\n```bash\nqbench disc-fourier tabulate results.yml results.csv\n```\n\nHere's what the result looks like:\n\n| target      | ancilla     | phi           | ideal_prob      | disc_prob     | mit_disc_prob   |\n| :----:      | :----:      |  :----:       | :----:          |    :----:     |         :----:  |\n| 1           | 2           | 0             | 0.5             | 0.57          | 0.57            |\n| 1           | 2           | 3.14          | 1               | 0.88          | 0.94            |\n| 1           | 2           | 6.28          | 0.5             | 0.55          | 0.56            |\n\n\n## What else can PyQBench do?\n\nThe above quickstart guide does not cover:\n\n- Running the experiments in synchronous (blocking mode)\n- Using error mitigation via [M3Mitigation suite](https://qiskit.org/ecosystem/mthree/stubs/mthree.M3Mitigation.html)\n- Using user-defined measurements instead of the default Fourier\n\nRefer to [PyQBench's documentation](https://pyqbench.readthedocs.io/en/latest/index.html) for further reading.\n\n## Authors and Citation\n\nPyQBench is the work of Konrad Jałowiecki, Paulina Lewandowska and Łukasz Pawela.\nSupport email for questions ``dexter2206@gmail.com``.\nIf you use PyQBench, please cite as per the included [BibTeX file](https://github.com/iitis/PyQBench/tree/pl/readme/pyqbench.bib\n).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiitis%2Fpyqbench","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiitis%2Fpyqbench","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiitis%2Fpyqbench/lists"}