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 details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

File details

Details for the file quantestpy-0.1.0.tar.gz.

File metadata

  • Download URL: quantestpy-0.1.0.tar.gz
  • Upload date:
  • Size: 56.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for quantestpy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6a627111ab2a6f53fc4ea09e54788476a897ab570579fbd7626731d461f2f6cd
MD5 625b2a951e23c6d8c36c6583c06422ee
BLAKE2b-256 82d4c817a6c59f72739ebdde889d8645be126a2f3803873828ef5787b3352626

See more details on using hashes here.

File details

Details for the file quantestpy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: quantestpy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 33.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for quantestpy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b02700151226bce8714d32732b2132ffca8b58a269d4ee4e51e50738d1735066
MD5 77f4432c5f456a3e6d9b170e23c5a999
BLAKE2b-256 8432736a7ddd2ddd6d5c2a1a48cf1e63ff187b67069313a665f72b7c1fad0287

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