Skip to main content

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.state_vector.assert_is_normalized(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
state_vector.assert_is_normalized(state_vec) state_vec is normalized
state_vector.assert_equal(state_vec_a, state_vec_b) state_vec_a == state_vec_b
operator.assert_is_unitary(operator) operator is unitary
operator.assert_equal(operator_a, operator_b) operator_a == operator_b
circuit.assert_equal_to_operator(circuit, operator) circuit == operator
circuit.assert_is_zero(circuit, qubits) qubits in circuit are 0 states
circuit.assert_ancilla_is_zero(circuit, ancilla_qubits) ancilla_qubits in circuit are always 0 states
circuit.assert_equal(circuit_a, circuit_b) circuit_a == circuit_b
assert_get_ctrl_val(circuit) values of control qubits for all gates

The hyperlinks bring you to details of the methods.

License

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.0.tar.gz (56.5 kB view hashes)

Uploaded Source

Built Distribution

quantestpy-0.1.0-py3-none-any.whl (33.9 kB view hashes)

Uploaded Python 3

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