|
537 | 537 | "## Running circuits using the IBM Q provider <a id='ibmq_provider'></a>\n", |
538 | 538 | "\n", |
539 | 539 | "To faciliate access to real quantum computing hardware, we have provided a simple API interface.\n", |
540 | | - "To access IBM Q devices, you'll need an API token. For the public IBM Q devices, you can generate an API token [here](https://quantumexperience.ng.bluemix.net/qx/account/advanced) (create an account if you don't already have one). For Q Network devices, login to the q-console, click your hub, group, and project, and expand \"Get Access\" to generate your API token and access url.\n", |
| 540 | + "To access IBM Q devices, you'll need an API token. For the public IBM Q devices, you can generate an API token [here](https://quantum-computing.ibm.com/account) (create an account if you don't already have one). For Q Network devices, login to the q-console, click your hub, group, and project, and expand \"Get Access\" to generate your API token and access url.\n", |
541 | 541 | "\n", |
542 | 542 | "Our IBM Q provider lets you run your circuit on real devices or on our HPC simulator. Currently, this provider exists within Qiskit, and can be imported as shown below. For details on the provider, see [The IBM Q Provider](2_the_ibmq_provider.ipynb)." |
543 | 543 | ] |
|
560 | 560 | "cell_type": "markdown", |
561 | 561 | "metadata": {}, |
562 | 562 | "source": [ |
563 | | - "After generating your API token, call: `IBMQ.save_account('MY_TOKEN')`. For Q Network users, you'll also need to include your access url: `IBMQ.save_account('MY_TOKEN', 'URL')`\n", |
| 563 | + "After generating your API token, call: `IBMQ.save_account('MY_TOKEN')`.\n", |
564 | 564 | "\n", |
565 | 565 | "This will store your IBM Q credentials in a local file. Unless your registration information has changed, you only need to do this once. You may now load your accounts by calling," |
566 | 566 | ] |
|
576 | 576 | }, |
577 | 577 | "outputs": [], |
578 | 578 | "source": [ |
579 | | - "IBMQ.load_accounts(hub=None)" |
| 579 | + "provider = IBMQ.load_account()" |
580 | 580 | ] |
581 | 581 | }, |
582 | 582 | { |
583 | 583 | "cell_type": "markdown", |
584 | 584 | "metadata": {}, |
585 | 585 | "source": [ |
586 | | - "Once your account has been loaded, you can view the list of backends available to you." |
| 586 | + "Once your account has been loaded, you can view the list of backends available to you using the `provider` instance.\n", |
| 587 | + "\n", |
| 588 | + "<div class=\"alert alert-block alert-info\">\n", |
| 589 | + "<b>Note:</b> The use of `provider` instances is the default way of retrieving backends from Qiskit 0.11 onwards - if you have been using earlier versions of Qiskit, check the next notebook for more detailed instructions on updating and using the different options.</div>" |
587 | 590 | ] |
588 | 591 | }, |
589 | 592 | { |
|
614 | 617 | ], |
615 | 618 | "source": [ |
616 | 619 | "print(\"Available backends:\")\n", |
617 | | - "IBMQ.backends()" |
| 620 | + "provider.backends()" |
618 | 621 | ] |
619 | 622 | }, |
620 | 623 | { |
|
654 | 657 | "source": [ |
655 | 658 | "from qiskit.providers.ibmq import least_busy\n", |
656 | 659 | "\n", |
657 | | - "large_enough_devices = IBMQ.backends(filters=lambda x: x.configuration().n_qubits < 10 and\n", |
658 | | - " not x.configuration().simulator)\n", |
| 660 | + "large_enough_devices = provider.backends(filters=lambda x: x.configuration().n_qubits < 10 and\n", |
| 661 | + " not x.configuration().simulator)\n", |
659 | 662 | "backend = least_busy(large_enough_devices)\n", |
660 | 663 | "print(\"The best backend is \" + backend.name())" |
661 | 664 | ] |
|
770 | 773 | "metadata": {}, |
771 | 774 | "outputs": [], |
772 | 775 | "source": [ |
773 | | - "simulator_backend = IBMQ.get_backend('ibmq_qasm_simulator', hub=None)" |
| 776 | + "simulator_backend = provider.get_backend('ibmq_qasm_simulator')" |
774 | 777 | ] |
775 | 778 | }, |
776 | 779 | { |
|
846 | 849 | } |
847 | 850 | ], |
848 | 851 | "source": [ |
849 | | - "jobID = job_exp.job_id()\n", |
| 852 | + "job_id = job_exp.job_id()\n", |
850 | 853 | "\n", |
851 | | - "print('JOB ID: {}'.format(jobID)) " |
| 854 | + "print('JOB ID: {}'.format(job_id))" |
852 | 855 | ] |
853 | 856 | }, |
854 | 857 | { |
|
864 | 867 | "metadata": {}, |
865 | 868 | "outputs": [], |
866 | 869 | "source": [ |
867 | | - "job_get=backend.retrieve_job(jobID)" |
| 870 | + "retrieved_job = backend.retrieve_job(job_id)" |
868 | 871 | ] |
869 | 872 | }, |
870 | 873 | { |
|
898 | 901 | } |
899 | 902 | ], |
900 | 903 | "source": [ |
901 | | - "job_get.result().get_counts(qc)" |
| 904 | + "retrieved_job.result().get_counts(qc)" |
902 | 905 | ] |
903 | 906 | }, |
904 | 907 | { |
|
0 commit comments