For each backend supported in Apache Mahout, the testing suite executes an example circuit using the qumat implementation of the backend, and then executes the same example circuit using the backend's native implementation. The test then checks that the resulting final state vectors are the same.
The testing suite is run using pytest, which is installed by default using poetry. To run the tests, simply run
pytest
In order to add my-new-backend to the testing suite:
- Create a file
testing/my-new-backend_helpers.py
- In
testing/my-new-backend_helpers.py
, create a functionget_qumat_backend_config
which returns the qumat backend config needed for the qumat implementation of my-new-backend - In
testing/my-new-backend_helpers.py
, create a functionget_native_example_final_state_vector
which builds and executes the example circuit using the native implementation of my-new-backend - In
testing/test_final_quantum_states.py
, add"my-new-backend"
tobackends_to_test