Skip to main content

Software for testing quantum computing programs.

Project description


QuantestPy is an unit testing framework for quantum computing programs.


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.

import quantestpy as qp

state_vec = [0.7072+0j, 0, 0, 0.7072+0j]

# check that the state vector is normalized.


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.


Apache License 2.0

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

quantestpy-0.1.2.tar.gz (90.1 kB view hashes)

Uploaded source

Built Distribution

quantestpy-0.1.2-py3-none-any.whl (35.9 kB view hashes)

Uploaded py3

Supported by

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