Skip to content

Commit

Permalink
Rename runtime-simple to sample-program (Qiskit#52)
Browse files Browse the repository at this point in the history
* rename simple program to sample

* fix import
  • Loading branch information
jyu00 committed Jun 4, 2021
1 parent 9ea20ab commit 0217689
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions tutorials/00_introduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,11 @@
" Description: The aligned quantum kernel matrix evaluated with the optimized kernel parameters on the training data.\n",
" Type: numpy.ndarray\n",
"==================================================\n",
"runtime-simple:\n",
" Name: runtime-simple\n",
" Description: Simple runtime program used for testing.\n",
"sample-program:\n",
" Name: sample-program\n",
" Description: A sample runtime program.\n",
" Version: 1\n",
" Creation date: 2021-05-05T23:30:21Z\n",
" Creation date: 2021-06-04T14:11:19Z\n",
" Max execution time: 300\n",
" Input parameters:\n",
" - iterations:\n",
Expand Down Expand Up @@ -311,7 +311,7 @@
"id": "7090db0f",
"metadata": {},
"source": [
"To print the metadata of the program `runtime-simple`:"
"To print the metadata of the program `sample-program`:"
]
},
{
Expand All @@ -324,11 +324,11 @@
"name": "stdout",
"output_type": "stream",
"text": [
"runtime-simple:\n",
" Name: runtime-simple\n",
" Description: Simple runtime program used for testing.\n",
"sample-program:\n",
" Name: sample-program\n",
" Description: A sample runtime program.\n",
" Version: 1\n",
" Creation date: 2021-05-05T23:30:21Z\n",
" Creation date: 2021-06-04T14:11:19Z\n",
" Max execution time: 300\n",
" Input parameters:\n",
" - iterations:\n",
Expand All @@ -350,7 +350,7 @@
}
],
"source": [
"program = provider.runtime.program('runtime-simple')\n",
"program = provider.runtime.program('sample-program')\n",
"print(program)"
]
},
Expand All @@ -359,7 +359,7 @@
"id": "dc4339b3",
"metadata": {},
"source": [
"As you can see from above, the program `runtime-simple` is a simple program that has only 1 input parameter `iterations`, which indicates how many iterations to run. For each iteration it generates and runs a random 5-qubit circuit and returns the counts as well as the iteration number as the interim results. When the program finishes, it returns the sentence `All done!`. This program can only run for 300 seconds (5 minutes), and requires a backend that has at least 5 qubits."
"As you can see from above, the program `sample-program` is a simple program that has only 1 input parameter `iterations`, which indicates how many iterations to run. For each iteration it generates and runs a random 5-qubit circuit and returns the counts as well as the iteration number as the interim results. When the program finishes, it returns the sentence `All done!`. This program can only run for 300 seconds (5 minutes), and requires a backend that has at least 5 qubits."
]
},
{
Expand Down Expand Up @@ -391,7 +391,7 @@
"source": [
"Before we run a quantum program, we may want to define a callback function that would process interim results, which are intermediate data provided by a program while its still running. \n",
"\n",
"As we saw earlier, the metadata of `runtime-simple` says that its interim results are the iteration number and the counts of the randomly generated circuit. Here we define a simple callback function that just prints these interim results:"
"As we saw earlier, the metadata of `sample-program` says that its interim results are the iteration number and the counts of the randomly generated circuit. Here we define a simple callback function that just prints these interim results:"
]
},
{
Expand All @@ -410,7 +410,7 @@
"id": "e2a98178",
"metadata": {},
"source": [
"The following example runs the `runtime-simple` program with 3 iterations on `ibmq_montreal` and waits for its result. You can also use a different backend that supports Qiskit Runtime:"
"The following example runs the `sample-program` program with 3 iterations on `ibmq_montreal` and waits for its result. You can also use a different backend that supports Qiskit Runtime:"
]
},
{
Expand All @@ -437,7 +437,7 @@
" 'iterations': 3\n",
"}\n",
"options = {'backend_name': backend.name()}\n",
"job = provider.runtime.run(program_id=\"runtime-simple\",\n",
"job = provider.runtime.run(program_id=\"sample-program\",\n",
" options=options,\n",
" inputs=program_inputs,\n",
" callback=interim_result_callback\n",
Expand Down Expand Up @@ -489,7 +489,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Job c2ajo0m0lb0ph8orsprg is an execution instance of runtime program runtime-simple.\n",
"Job c2ajo0m0lb0ph8orsprg is an execution instance of runtime program sample-program.\n",
"This job ran on backend ibmq_montreal and had input parameters {'iterations': 3}\n"
]
}
Expand Down Expand Up @@ -524,7 +524,7 @@
}
],
"source": [
"retrieved_jobs = provider.runtime.jobs(limit=2)\n",
"retrieved_jobs = provider.runtime.jobs(limit=1)\n",
"for rjob in retrieved_jobs:\n",
" print(rjob.job_id())"
]
Expand Down Expand Up @@ -564,7 +564,7 @@
{
"data": {
"text/html": [
"<h3>Version Information</h3><table><tr><th>Qiskit Software</th><th>Version</th></tr><tr><td>Qiskit</td><td>None</td></tr><tr><td>Terra</td><td>0.17.1</td></tr><tr><td>Aer</td><td>0.8.2</td></tr><tr><td>Ignis</td><td>None</td></tr><tr><td>Aqua</td><td>None</td></tr><tr><td>IBM Q Provider</td><td>0.13.0</td></tr><tr><th>System information</th></tr><tr><td>Python</td><td>3.9.1 (default, Feb 5 2021, 11:23:59) \n",
"<h3>Version Information</h3><table><tr><th>Qiskit Software</th><th>Version</th></tr><tr><td>Qiskit</td><td>None</td></tr><tr><td>Terra</td><td>0.17.1</td></tr><tr><td>Aer</td><td>0.8.2</td></tr><tr><td>Ignis</td><td>None</td></tr><tr><td>Aqua</td><td>None</td></tr><tr><td>IBM Q Provider</td><td>0.13.1</td></tr><tr><th>System information</th></tr><tr><td>Python</td><td>3.9.1 (default, Feb 5 2021, 11:23:59) \n",
"[Clang 12.0.0 (clang-1200.0.32.28)]</td></tr><tr><td>OS</td><td>Darwin</td></tr><tr><td>CPUs</td><td>8</td></tr><tr><td>Memory (Gb)</td><td>16.0</td></tr><tr><td colspan='2'>Fri May 07 09:22:18 2021 EDT</td></tr></table>"
],
"text/plain": [
Expand Down

0 comments on commit 0217689

Please sign in to comment.