Software for testing quantum computing programs.
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
quantestpy-0.1.2.tar.gz
(90.1 kB
view details)
Built Distribution
File details
Details for the file quantestpy-0.1.2.tar.gz
.
File metadata
- Download URL: quantestpy-0.1.2.tar.gz
- Upload date:
- Size: 90.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28561ddaf9632822ef587d6072bbda62613c755f26dd6d2c916571f7b0118c6b |
|
MD5 | 135d18608d25b01f94acfc14a4fabbee |
|
BLAKE2b-256 | 305518cb7c8edc7fbbb3f2c91f44c921dd722d0a067d8e441d2eeab3fcb3a7ea |
File details
Details for the file quantestpy-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: quantestpy-0.1.2-py3-none-any.whl
- Upload date:
- Size: 35.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c9ccd9f8f07079fffe0b309e5a66427befea968d21499bf290a3845db1fb0d7 |
|
MD5 | 21c5803f60245ce680c029ff0fecef0f |
|
BLAKE2b-256 | 50c7a38fa824335771486619ff06f79878f49f4e0c5431846e0999db0f4f0473 |