From 9825a5e5a38d676a6310a922ac81b7020f15ce77 Mon Sep 17 00:00:00 2001 From: Jessie Yu Date: Mon, 10 May 2021 13:53:12 -0400 Subject: [PATCH] Move api direct tutorial from 05 to 01 (#32) * move api direct tutorial * number uploading * renumber --- ...t_runner.ipynb => 01_circuit_runner.ipynb} | 0 ...ogram.ipynb => 02_uploading_program.ipynb} | 0 .../{05_API_direct.ipynb => API_direct.ipynb} | 37 +++++++++++++------ 3 files changed, 25 insertions(+), 12 deletions(-) rename tutorials/{02_circuit_runner.ipynb => 01_circuit_runner.ipynb} (100%) rename tutorials/{Uploading_program.ipynb => 02_uploading_program.ipynb} (100%) rename tutorials/{05_API_direct.ipynb => API_direct.ipynb} (89%) diff --git a/tutorials/02_circuit_runner.ipynb b/tutorials/01_circuit_runner.ipynb similarity index 100% rename from tutorials/02_circuit_runner.ipynb rename to tutorials/01_circuit_runner.ipynb diff --git a/tutorials/Uploading_program.ipynb b/tutorials/02_uploading_program.ipynb similarity index 100% rename from tutorials/Uploading_program.ipynb rename to tutorials/02_uploading_program.ipynb diff --git a/tutorials/05_API_direct.ipynb b/tutorials/API_direct.ipynb similarity index 89% rename from tutorials/05_API_direct.ipynb rename to tutorials/API_direct.ipynb index 7ed272e09..98a271e44 100644 --- a/tutorials/05_API_direct.ipynb +++ b/tutorials/API_direct.ipynb @@ -2,6 +2,7 @@ "cells": [ { "cell_type": "markdown", + "id": "b4263208", "metadata": {}, "source": [ "# Qiskit Runtime API" @@ -9,35 +10,39 @@ }, { "cell_type": "markdown", + "id": "fa65772b", "metadata": {}, "source": [ "Qiskit Runtime is a cloud service that allow you upload and run Qiskit programs in a Qiskit Runtimes near to the QPUs. \n", "\n", - "In this example we are going to explore how integrate this Qiskit Runtime in any app only using basic HTTP request and interact with a the program running in the service.\n", + "In this example we are going to explore how to integrate this Qiskit Runtime in any application using only basic HTTP requests and interact with a the program running in the service.\n", "\n" ] }, { "cell_type": "markdown", + "id": "b756372c", "metadata": {}, "source": [ "
\n", - "Note: You need to have a IBM Quantum Computing API Token, you get it sign up in https://quantum-computing.ibm.com/\n", + "Note: You need to have an IBM Quantum API token. You can get one by signing up at https://quantum-computing.ibm.com/\n", "
" ] }, { "cell_type": "markdown", + "id": "3ee2485c", "metadata": {}, "source": [ - "For this tutorial we are going to use que HTTP library requests to facilitate the API calls.\n", + "For this tutorial we are going to use the Python HTTP library `requests` to facilitate the API calls.\n", "\n", - "You can have access to the online interactive documentation here: https://runtime-us-east.quantum-computing.ibm.com/openapi/" + "You can access the online interactive runtime API documentation here: https://runtime-us-east.quantum-computing.ibm.com/openapi/" ] }, { "cell_type": "code", "execution_count": 70, + "id": "ddb6c73b", "metadata": {}, "outputs": [], "source": [ @@ -48,14 +53,16 @@ }, { "cell_type": "markdown", + "id": "11a669e0", "metadata": {}, "source": [ - "## authenticate in the service " + "## Authenticate with the service " ] }, { "cell_type": "code", "execution_count": 51, + "id": "90b25676", "metadata": {}, "outputs": [], "source": [ @@ -71,14 +78,16 @@ }, { "cell_type": "markdown", + "id": "92c99e95", "metadata": {}, "source": [ - "## Get the list of program that you can invoke " + "## Get a list of program that you can invoke " ] }, { "cell_type": "code", "execution_count": 52, + "id": "e30e589d", "metadata": {}, "outputs": [ { @@ -87,10 +96,8 @@ "text": [ "Qiskit Runtime Programs:\n", "- circuit-runner: A runtime program that takes one or more circuits, compiles them, executes them, and optionally applies measurement error mitigation. \n", - "- mit-6: \n", "- quantum-kernel-alignment: Quantum kernel alignment algorithm that learns, on a given dataset, a quantum kernel maximizing the SVM classification margin. \n", "- runtime-simple: Simple runtime program used for testing. \n", - "- simple: \n", "- vqe: Variational Quantum Eigensolver (VQE) to find the minimal eigenvalue of a Hamiltonian. \n" ] } @@ -116,14 +123,16 @@ }, { "cell_type": "markdown", + "id": "048da401", "metadata": {}, "source": [ - "## show info from one of the programs" + "## Display information about a specific program" ] }, { "cell_type": "code", "execution_count": 53, + "id": "94493809", "metadata": {}, "outputs": [ { @@ -155,6 +164,7 @@ }, { "cell_type": "markdown", + "id": "a1d812fd", "metadata": {}, "source": [ "## Run a Qiskit Runtime program on the Cloud" @@ -163,6 +173,7 @@ { "cell_type": "code", "execution_count": 83, + "id": "61922aeb", "metadata": {}, "outputs": [ { @@ -211,14 +222,16 @@ }, { "cell_type": "markdown", + "id": "ad5fa5f6", "metadata": {}, "source": [ - "## Getting the result" + "## Get the result" ] }, { "cell_type": "code", "execution_count": 81, + "id": "dc385e66", "metadata": {}, "outputs": [ { @@ -253,7 +266,7 @@ } ], "source": [ - "# while the Qiskit Quantum program is executed, and is not the final result, you are going to obtain a 204 status code\n", + "# You are going to get a 204 status code while the Qiskit program is still running.\n", "\n", "final_result = False\n", "\n", @@ -291,7 +304,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.4" + "version": "3.9.1" } }, "nbformat": 4,