Implemented command-line interface for test executable #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introducing command-line interface to the
src/test
executable to allow selecting specific tests or algorithms to run.Previously,
./test
executed all available tests. Now, users can specify a command:./test
with no arguments maintains the original behavior (runs all tests)../test <command> [arguments]
executes only the specified test/algorithm.Objective:
Usage Examples:
Run only Shor's algorithm for N= 15
./test shor 15
Expected Otucome :
Testing Shor: Factorizing N = 15...
Quantum period find found the period of 11^x mod 15 to be 2
Shor found a factor of 15 to be 5
Shor algorithm found a factor of 15 to be 5
Finished Shor factorization test.
Run only Grover's search for omega=6 on 3 qubits
. /test grover 6 3
Expected Outcome:
Testing Grover: Searching for state 6 using 3 qubits...
|000>: amp-> -0.0883883 + 0i, prob-> 0.0078125
|001>: amp-> -0.0883883 + 0i, prob-> 0.0078125
|010>: amp-> -0.0883883 + 0i, prob-> 0.0078125
|011>: amp-> -0.0883883 + 0i, prob-> 0.0078125
|100>: amp-> -0.0883883 + 0i, prob-> 0.0078125
|101>: amp-> -0.0883883 + 0i, prob-> 0.0078125
|110>: amp-> 0.972272 + 0i, prob-> 0.945312
|111>: amp-> -0.0883883 + 0i, prob-> 0.0078125
Grover result: want 6, got 6
Finished Grover test.
Run only the QFT tests
./test qft