Skip to content

Commit

Permalink
Move api direct tutorial from 05 to 01 (Qiskit#32)
Browse files Browse the repository at this point in the history
* move api direct tutorial

* number uploading

* renumber
  • Loading branch information
jyu00 authored May 10, 2021
1 parent 3081031 commit a4e946f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
File renamed without changes.
File renamed without changes.
37 changes: 25 additions & 12 deletions 05_API_direct.ipynb → API_direct.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,47 @@
"cells": [
{
"cell_type": "markdown",
"id": "b4263208",
"metadata": {},
"source": [
"# Qiskit Runtime API"
]
},
{
"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": [
"<div class=\"alert alert-block alert-info\">\n",
"<b>Note:</b> You need to have a IBM Quantum Computing API Token, you get it sign up in https://quantum-computing.ibm.com/\n",
"<b>Note:</b> You need to have an IBM Quantum API token. You can get one by signing up at https://quantum-computing.ibm.com/\n",
"</div>"
]
},
{
"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": [
Expand All @@ -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": [
Expand All @@ -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": [
{
Expand All @@ -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"
]
}
Expand All @@ -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": [
{
Expand Down Expand Up @@ -155,6 +164,7 @@
},
{
"cell_type": "markdown",
"id": "a1d812fd",
"metadata": {},
"source": [
"## Run a Qiskit Runtime program on the Cloud"
Expand All @@ -163,6 +173,7 @@
{
"cell_type": "code",
"execution_count": 83,
"id": "61922aeb",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -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": [
{
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -291,7 +304,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
"version": "3.9.1"
}
},
"nbformat": 4,
Expand Down

0 comments on commit a4e946f

Please sign in to comment.