jwoehr / qisjob

Qiskit Job Control
Other
32 stars 4 forks source link

Aer qasm_simulator has much lower max number of shots when used via qisjob! #15

Closed omarcostahamido closed 3 years ago

omarcostahamido commented 3 years ago

Ok, now I confirmed this. on the same python environment where I have qisjob installed:

$ python
>>> import time; from qiskit import *
>>> qc = QuantumCircuit(1,1); qc.h(0); qc.measure(0,0)
>>> backend = Aer.get_backend('qasm_simulator')
>>> start_time = time.time(); print( execute(qc, backend, shots=1000000).result().get_counts() ); print("--- %s seconds ---" % (time.time() - start_time));

has no problem running. However this will not run: $ qisjob onebit.qasm -a --qasm_simulator -t 200000

(you can assume that I am inside the share/qasm_examples folder here) It will throw:

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: UserWarning: QuantumInspire not installed.
  return f(*args, **kwds)
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: UserWarning: Rigetti Forest not installed.
  return f(*args, **kwds)
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: UserWarning: qiskit-jku-provider not installed.
  return f(*args, **kwds)
Traceback (most recent call last):
  File "/Users/user/Documents/qis_job/QISJOB/bin/qisjob", line 244, in <module>
    QJ.do_it()
  File "qis_job/qis_job.pyx", line 301, in qis_job.qis_job.QisJob.do_it
  File "qis_job/qis_job.pyx", line 616, in qis_job.qis_job.QisJob.one_exp
  File "/Users/user/Documents/qis_job/QISJOB/lib/python3.7/site-packages/qiskit/execute.py", line 289, in execute
    **run_config)
  File "/Users/user/Documents/qis_job/QISJOB/lib/python3.7/site-packages/qiskit/compiler/assemble.py", line 141, in assemble
    rep_delay, **run_config)
  File "/Users/user/Documents/qis_job/QISJOB/lib/python3.7/site-packages/qiskit/compiler/assemble.py", line 226, in _parse_common_args
    'backend: %s.' % (shots, max_shots))
qiskit.exceptions.QiskitError: 'Number of shots specified: 200000 exceeds max_shots property of the backend: 65536.'
jwoehr commented 3 years ago

Yes, for some reason I invoked BasicAer in one if-branch. Fixed.

omarcostahamido commented 3 years ago

Thank you. That fixed it, yes.