QuantestPy
QuantestPy is an unit testing framework for quantum computing programs.
Installation
We encourage installing QuantestPy via the pip tool(a python package manager). The following command installs the core QuantestPy component.
pip install quantestpy
Testing approaches with QuantestPy
You insert assert methods in your source codes.
# your_source_code.py
import quantestpy as qp
state_vec = [0.7072+0j, 0, 0, 0.7072+0j]
# check that the state vector is normalized.
qp.assert_normalized_state_vector(state_vector_subject_to_test=state_vec)
...
QuantestPy provides several assert methods to check for and report failures. The following table lists the available methods:
| Method | Checks that |
|---|---|
| assert_normalized_state_vector(state_vec) | state_vec is normalized |
| assert_equivalent_state_vectors(state_vec_a, state_vec_b) | state_vec_a == state_vec_b |
| assert_unitary_operator(operator) | operator is unitary |
| assert_equivalent_operators(operator_a, operator_b) | operator_a == operator_b |
| assert_circuit_equivalent_to_operator(circuit, operator) | circuit == operator |
| assert_qubit_reset_to_zero_state(circuit, qubits) | qubits in circuit are 0 states |
| assert_ancilla_reset(circuit, ancilla_qubits) | ancilla_qubits in circuit are always 0 states |
| assert_equivalent_circuits(circuit_a, circuit_b) | circuit_a == circuit_b |
| assert_unary_iteration(circuit, input_to_output) | circuit is the expected indexed operation |
| assert_circuit_equivalent_to_output_qubit_state(circuit, input_to_output) | circuit's output for the input is as expected |
The hyperlinks bring you to details of the methods.
License
Metadata
Release files for quantestpy 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 | Actions |
|---|---|---|---|---|
| quantestpy-0.1.2.tar.gz | 90.1 kB | Without provenance | Details for quantestpy-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| quantestpy-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for quantestpy-0.1.2-py3-none-any.whl |
Total release size: 125.9 kB
Release files / quantestpy-0.1.2.tar.gz
| Download URL | quantestpy-0.1.2.tar.gz |
|---|---|
| Size | 90.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
28561ddaf9632822ef587d6072bbda62613c755f26dd6d2c916571f7b0118c6b
|
|
BLAKE2b-256 checksum How to use checksums |
305518cb7c8edc7fbbb3f2c91f44c921dd722d0a067d8e441d2eeab3fcb3a7ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / quantestpy-0.1.2-py3-none-any.whl
| Download URL | quantestpy-0.1.2-py3-none-any.whl |
|---|---|
| Size | 35.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3c9ccd9f8f07079fffe0b309e5a66427befea968d21499bf290a3845db1fb0d7
|
|
BLAKE2b-256 checksum How to use checksums |
50c7a38fa824335771486619ff06f79878f49f4e0c5431846e0999db0f4f0473
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Security for quantestpy 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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.