Skip to content
This repository has been archived by the owner on Dec 14, 2024. It is now read-only.

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

Closed
omarcostahamido opened this issue Feb 12, 2021 · 2 comments

Comments

@omarcostahamido
Copy link
Contributor

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 jwoehr closed this as completed in c201272 Feb 12, 2021
@jwoehr
Copy link
Owner

jwoehr commented Feb 12, 2021

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

@omarcostahamido
Copy link
Contributor Author

Thank you. That fixed it, yes.

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

No branches or pull requests

2 participants