Skip to content

Commit

Permalink
Add --noise option to several of the benchmark mains
Browse files Browse the repository at this point in the history
  • Loading branch information
rtvuser1 committed Jun 9, 2024
1 parent 9257563 commit 2aa5b54
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bernstein-vazirani/bv_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ def get_args():
parser.add_argument("--max_circuits", "-c", default=3, help="Maximum circuit repetitions", type=int)
parser.add_argument("--method", "-m", default=1, help="Algorithm Method", type=int)
parser.add_argument("--input_value", "-i", default=None, help="Fixed Input Value", type=int)
parser.add_argument("--nonoise", "-non", action="store_true", help="Use Noiseless Simulator")
parser.add_argument("--verbose", "-v", action="store_true", help="Verbose")
return parser.parse_args()

Expand All @@ -230,6 +231,8 @@ def get_args():

# special argument handling
ex.verbose = args.verbose
verbose = args.verbose

if args.num_qubits > 0: args.min_qubits = args.max_qubits = args.num_qubits

# execute benchmark program
Expand All @@ -239,6 +242,7 @@ def get_args():
method=args.method,
input_value=args.input_value,
backend_id=args.backend_id,
exec_options = {"noise_model" : None} if args.nonoise else {},
api=args.api
)

4 changes: 4 additions & 0 deletions bernstein-vazirani/qiskit/bv_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ def get_args():
parser.add_argument("--max_circuits", "-c", default=3, help="Maximum circuit repetitions", type=int)
parser.add_argument("--method", "-m", default=1, help="Algorithm Method", type=int)
parser.add_argument("--input_value", "-i", default=None, help="Fixed Input Value", type=int)
parser.add_argument("--nonoise", "-non", action="store_true", help="Use Noiseless Simulator")
parser.add_argument("--verbose", "-v", action="store_true", help="Verbose")
return parser.parse_args()

Expand All @@ -213,6 +214,8 @@ def get_args():

# special argument handling
ex.verbose = args.verbose
verbose = args.verbose

if args.num_qubits > 0: args.min_qubits = args.max_qubits = args.num_qubits

# execute benchmark program
Expand All @@ -222,6 +225,7 @@ def get_args():
method=args.method,
input_value=args.input_value,
backend_id=args.backend_id,
exec_options = {"noise_model" : None} if args.nonoise else {},
#api=args.api
)

4 changes: 4 additions & 0 deletions grovers/qiskit/grovers_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ def get_args():
parser.add_argument("--method", "-m", default=1, help="Algorithm Method", type=int)
#parser.add_argument("--input_value", "-i", default=None, help="Fixed Input Value", type=int)
parser.add_argument("--use_mcx_shim", action="store_true", help="Use MCX Shim")
parser.add_argument("--nonoise", "-non", action="store_true", help="Use Noiseless Simulator")
parser.add_argument("--verbose", "-v", action="store_true", help="Verbose")
return parser.parse_args()

Expand All @@ -186,6 +187,8 @@ def get_args():

# special argument handling
ex.verbose = args.verbose
verbose = args.verbose

if args.num_qubits > 0: args.min_qubits = args.max_qubits = args.num_qubits

# execute benchmark program
Expand All @@ -195,6 +198,7 @@ def get_args():
#method=args.method, # not used currently
use_mcx_shim=args.use_mcx_shim,
backend_id=args.backend_id,
exec_options = {"noise_model" : None} if args.nonoise else {},
#api=args.api
)

4 changes: 4 additions & 0 deletions hidden-shift/qiskit/hs_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def get_args():
parser.add_argument("--max_circuits", "-c", default=3, help="Maximum circuit repetitions", type=int)
parser.add_argument("--method", "-m", default=1, help="Algorithm Method", type=int)
#parser.add_argument("--input_value", "-i", default=None, help="Fixed Input Value", type=int)
parser.add_argument("--nonoise", "-non", action="store_true", help="Use Noiseless Simulator")
parser.add_argument("--verbose", "-v", action="store_true", help="Verbose")
return parser.parse_args()

Expand All @@ -158,6 +159,8 @@ def get_args():

# special argument handling
ex.verbose = args.verbose
verbose = args.verbose

if args.num_qubits > 0: args.min_qubits = args.max_qubits = args.num_qubits

# execute benchmark program
Expand All @@ -167,6 +170,7 @@ def get_args():
#method=args.method, # not used currently
#input_value=args.input_value, # not used currently
backend_id=args.backend_id,
exec_options = {"noise_model" : None} if args.nonoise else {},
#api=args.api
)

Expand Down

0 comments on commit 2aa5b54

Please sign in to comment.