Skip to content

Implemented command-line interface for test executable #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KaranSinghDev
Copy link

@KaranSinghDev KaranSinghDev commented Apr 10, 2025

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:

  • Running ./test with no arguments maintains the original behavior (runs all tests).
  • Running ./test <command> [arguments] executes only the specified test/algorithm.

Objective:

  • To give flexibility for running targeted tests or algorithm simulations.
  • Making experimentation easier without needing code modifications.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant