Guest User

Untitled

a guest
Jun 20th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. import time
  2. from qiskit.backends.ibmq import IBMQProvider
  3.  
  4. # Create a job for the "ibmqx4" online IBM Q backend
  5. ibmq_provider = IBMQProvider('TOKEN_FOR_IBMQ')
  6. backend = ibmq_provider.get_backend('ibmqx4')
  7.  
  8. # Run the job - note that this call is async, and execution continues.
  9. job = backend.run(q_job)
  10.  
  11. # Perform instructions while waiting for the job to finish.
  12. while not job.done:
  13. print('Waiting for job %s ...' % job.job_id)
  14. if job.queued:
  15. print('Job is queued.')
  16. elif job.running:
  17. print('Job is running')
  18. time.sleep(10)
  19.  
  20. result = job.result()
  21. counts = result.get_counts()
  22. print(counts)
Add Comment
Please, Sign In to add comment