iitis / PyQBench

Apache License 2.0
4 stars 3 forks source link

Implement tests verifying that native Rigetti circuits can be used in verbatim mode #21

Closed dexter2206 closed 2 years ago

dexter2206 commented 2 years ago

This PR introduces tests verifying that our decompositions of circuits using Rigetti-native gateset are actually correct. The tests run the circuits in verbatim mode on the actual QPU and fail if any circuits fail to run.

Additionally, this PR removes deprecated calls to as_unitary(), which luckily fixes qubit ordering, so we no longer need basis change in tests.

Notice that to run tests on actual Rigetti QPU you need to have AWS CLI configured for use with Braket. Since we can't do this now, these tests are disabled on the CI. They can be run locally by adding --rigetti flag to pytest, e.g.

pytest tests --rigetti

I have run the tests locally and all the circuits indeed work. The cost of running tests with --rigetti flag only is below $1.50.

Also, be mindful that Rigetti QPUs are only available for several hours daily. If you run tests outside those Hours, or they fail to finish on time, the following will happen:

Always consult the Amazon Braket dashboard to verify when a given device is accessible to avoid the hang-up described above.