Skip to main content

Property based testing package for Qiskit programs

Project description

QuCheck

Installation

Create a new conda environment with the following command: conda create -n qucheck_env python=3.11

Activate the environment: conda activate qucheck_env

Move to the qucheck directory: cd path/to/qucheck

Install the requirements: pip install .

Quickstart

If you want to run QuCheck on a single example property, start with docs/quickstart.md.

The quickstart uses:

  • examples/quickstart/properties/single_qubit_probability_property.py
  • examples/quickstart/properties/single_qubit_wrong_probability_property.py
  • examples/quickstart/run.py

RQ1:

To run the experiment in RQ1, execute: case_studies/multithreaded_test_runner.py

This will use all cores available on your machine to execute all case studies under all combinations of numbers or properties, inputs, and shots (can be modified in the test_and_store_parallel function). You can modify the number of threads used by changing the MAX_WORKERS variable in the script.

The results will be stored in the case_studies/mutation_test_results directory as CSV files.

(3 property, 100 input, 2500 and 4200 shots experiments will also be performed, which we use as a basis for comparison in RQ2)

RQ2:

To run the comparison with the MITRE unit tests, navigate to the case_studies/MITRE_unit_test_baseline directory and execute:

  • deutsch_jozsa.py
  • grover_tests.py
  • qft_tests.py
  • teleportation.py

The results will be stored in the case_studies/mutation_test_results directory as CSV files.

RQ3:

To perform the comparison with QSharpCheck, you will need to utilise the QSharpCheck framework. You can find the mutants and test files used for the comparison in the case_studies/superdense_coding/mutants/translated_circuits and case_studies/quantum_teleportation/mutants/translated_circuits directories.

You will also need to individually execute the relevant property in QuCheck for Quantum Teleportation and Superdense Coding.

This can be done by setting the number of properties to 1 in the test_and_store_parallel function in case_studies/multithreaded_test_runner.py, and commenting out all but input_reg0_equal_to_output_reg2_property.py


Credits and Third-Party Code

This repository is licensed under the MIT License (© 2024 Gabriel Pontolillo and Marek Grzesiuk).

Portions of this project include code developed by The MITRE Corporation (2019) from the qsfe/Qiskit repository, licensed under the Apache License, Version 2.0. See the header of each adapted file and http://www.apache.org/licenses/LICENSE-2.0 for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qucheck-0.0.1.tar.gz (22.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qucheck-0.0.1-py3-none-any.whl (28.6 kB view details)

Uploaded Python 3

File details

Details for the file qucheck-0.0.1.tar.gz.

File metadata

  • Download URL: qucheck-0.0.1.tar.gz
  • Upload date:
  • Size: 22.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for qucheck-0.0.1.tar.gz
Algorithm Hash digest
SHA256 32f95e2036aa629c58563b847d0897e47266f1b49b570e5444ecea7341c842d7
MD5 ad26724cfc3ed4a3efa15f064eede1b5
BLAKE2b-256 9d2339b01857f803e5d356c84b1f80c9fe18f7f1d7f9b549c398fe3e84b07650

See more details on using hashes here.

File details

Details for the file qucheck-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: qucheck-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 28.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for qucheck-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7dd7ac14444bf0aad030cdcfac80960c012f8c8755c6a8d7d70a2ab53e17fcd7
MD5 8e5a7ae8939da98d702039469268ab5a
BLAKE2b-256 2ff52725fa47ef5a3ce7e7712a945c3e69b2a645d9b08d9e0b11e4a67e234e8c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page