eclipse / xacc

XACC - eXtreme-scale Accelerator programming framework
https://xacc.readthedocs.io
BSD 3-Clause "New" or "Revised" License
165 stars 85 forks source link

refactor IonTrapQubitPass to use Visitor pattern #562

Open stevescia opened 1 year ago

stevescia commented 1 year ago

Refactored IonTrapTwoQubitPass to use visitor pattern; /workspace/xacc/quantum/plugins/iontrap/tests/IonTrapTwoQubitPassTester.cpp were compiled and ran:

ls -lrt -rwxr-xr-x 1 gitpod gitpod 2570920 Nov 17 02:48 IonTrapTwoQubitPassTester

gitpod /workspace/xacc/build/quantum/plugins/iontrap/tests $ ./IonTrapTwoQubitPassTester [==========] Running 3 tests from 1 test case. [----------] Global test environment set-up. [----------] 3 tests from IonTrapTwoQubitPassTester [ RUN ] IonTrapTwoQubitPassTester.twoQubitPassDecomposesCnot [ OK ] IonTrapTwoQubitPassTester.twoQubitPassDecomposesCnot (19 ms) [ RUN ] IonTrapTwoQubitPassTester.twoQubitPassDecomposesCZ [ OK ] IonTrapTwoQubitPassTester.twoQubitPassDecomposesCZ (3 ms) [ RUN ] IonTrapTwoQubitPassTester.twoQubitPassDecomposesSwap [ OK ] IonTrapTwoQubitPassTester.twoQubitPassDecomposesSwap (4 ms) [----------] 3 tests from IonTrapTwoQubitPassTester (26 ms total)

[----------] Global test environment tear-down [==========] 3 tests from 1 test case ran. (27 ms total) [ PASSED ] 3 tests.