Python | 3.9.1 (default, Feb 5 2021, 11:23:59) \n",
+ "Version InformationQiskit Software | Version |
---|
Qiskit | None | Terra | 0.17.1 | Aer | 0.8.2 | Ignis | None | Aqua | None | IBM Q Provider | 0.13.1 | System information |
---|
Python | 3.9.1 (default, Feb 5 2021, 11:23:59) \n",
"[Clang 12.0.0 (clang-1200.0.32.28)] | OS | Darwin | CPUs | 8 | Memory (Gb) | 16.0 | Fri May 07 09:22:18 2021 EDT | "
],
"text/plain": [
diff --git a/02_uploading_program.ipynb b/02_uploading_program.ipynb
index d17542bee..4e8a645df 100644
--- a/02_uploading_program.ipynb
+++ b/02_uploading_program.ipynb
@@ -96,7 +96,7 @@
"id": "2d6c91ec",
"metadata": {},
"source": [
- "There are several runtime programs in the `programs` directory in this repository. `runtime_simple.py` is one of them. It is a simple runtime program that submits random circuits for user-specified iterations:"
+ "There are several runtime programs in the `programs` directory in this repository. `sample_program.py` is one of them. It is a sample runtime program that submits random circuits for user-specified iterations:"
]
},
{
@@ -106,7 +106,7 @@
"metadata": {},
"outputs": [],
"source": [
- "\"\"\"A simple runtime program that submits random circuits for user-specified iterations.\"\"\"\n",
+ "\"\"\"A sample runtime program that submits random circuits for user-specified iterations.\"\"\"\n",
"\n",
"import random\n",
"\n",
@@ -377,7 +377,7 @@
"id": "d229d7cf",
"metadata": {},
"source": [
- "The following example tests the `runtime-simple` program we saw earlier. It uses the `qasm_simulator` from Qiskit Aer as the test backend. It serializes and unserializes input data using `RuntimeEncoder` and `RuntimeDecoder`, which are the default en/decoders used by runtime."
+ "The following example tests the `sample-program` program we saw earlier. It uses the `qasm_simulator` from Qiskit Aer as the test backend. It serializes and unserializes input data using `RuntimeEncoder` and `RuntimeDecoder`, which are the default en/decoders used by runtime."
]
},
{
@@ -398,7 +398,10 @@
}
],
"source": [
- "from qiskit_runtime.runtime_simple import runtime_simple\n",
+ "import sys\n",
+ "sys.path.insert(0, '..') # Add qiskit_runtime directory to the path\n",
+ "\n",
+ "from qiskit_runtime.sample_program import sample_program\n",
"from qiskit import Aer\n",
"from qiskit.providers.ibmq.runtime.utils import RuntimeEncoder, RuntimeDecoder\n",
"from qiskit.providers.ibmq.runtime import UserMessenger\n",
@@ -410,7 +413,7 @@
"serialized_inputs = json.dumps(inputs, cls=RuntimeEncoder)\n",
"unserialized_inputs = json.loads(serialized_inputs, cls=RuntimeDecoder)\n",
"\n",
- "runtime_simple.main(backend, user_messenger, **unserialized_inputs)"
+ "sample_program.main(backend, user_messenger, **unserialized_inputs)"
]
},
{
@@ -445,7 +448,7 @@
"id": "39e87075",
"metadata": {},
"source": [
- "Below shows the metadata JSON file of the `runtime-simple` program as an example:"
+ "Below shows the metadata JSON file of the `sample-program` program as an example:"
]
},
{
@@ -459,13 +462,13 @@
"output_type": "stream",
"text": [
"{\n",
- " \"name\": \"runtime-simple\",\n",
- " \"description\": \"Simple runtime program used for testing.\",\n",
+ " \"name\": \"sample-program\",\n",
+ " \"description\": \"A sample runtime program.\",\n",
" \"max_execution_time\": 300,\n",
- " \"version\": 1.0,\n",
+ " \"version\": \"1.0\",\n",
" \"backend_requirements\": {\"min_num_qubits\": 5},\n",
" \"parameters\": [\n",
- " {\"name\": \"iterations\", \"description\": \"Number of iterations to run. Each iteration generates a runs a random circuit.\", \"type\": \"int\", \"required\": true}\n",
+ " {\"name\": \"iterations\", \"description\": \"Number of iterations to run. Each iteration generates and runs a random circuit.\", \"type\": \"int\", \"required\": true}\n",
" ],\n",
" \"return_values\": [\n",
" {\"name\": \"-\", \"description\": \"A string that says 'All done!'.\", \"type\": \"string\"}\n",
@@ -482,9 +485,9 @@
"source": [
"import os\n",
"\n",
- "runtime_simple_json = os.path.join(os.getcwd(), \"../qiskit_runtime/runtime_simple/runtime_simple.json\")\n",
+ "sample_program_json = os.path.join(os.getcwd(), \"../qiskit_runtime/sample_program/sample_program.json\")\n",
"\n",
- "with open(runtime_simple_json, 'r') as file:\n",
+ "with open(sample_program_json, 'r') as file:\n",
" data = file.read()\n",
"\n",
"print(data)"
@@ -511,7 +514,7 @@
"id": "dfea7bc0",
"metadata": {},
"source": [
- "You can use the [`IBMRuntimeService.upload_program()`](https://qiskit.org/documentation/stubs/qiskit.providers.ibmq.runtime.IBMRuntimeService.html#qiskit.providers.ibmq.runtime.IBMRuntimeService.upload_program) method to upload your program. In the example below, the program data lives in the file `runtime-simple.py`, and its metadata, as described above, is in `runtime-simple.json`. "
+ "You can use the [`IBMRuntimeService.upload_program()`](https://qiskit.org/documentation/stubs/qiskit.providers.ibmq.runtime.IBMRuntimeService.html#qiskit.providers.ibmq.runtime.IBMRuntimeService.upload_program) method to upload your program. In the example below, the program data lives in the file `sample_program.py`, and its metadata, as described above, is in `sample_program.json`. "
]
},
{
@@ -519,7 +522,15 @@
"execution_count": 11,
"id": "6f11e0e0",
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "sample-program\n"
+ ]
+ }
+ ],
"source": [
"import os\n",
"from qiskit import IBMQ\n",
@@ -527,12 +538,12 @@
"IBMQ.load_account()\n",
"provider = IBMQ.get_provider(project='qiskit-runtime') # Substitute with your provider.\n",
"\n",
- "runtime_simple_data = os.path.join(os.getcwd(), \"../qiskit_runtime/runtime_simple/runtime_simple.py\")\n",
- "runtime_simple_json = os.path.join(os.getcwd(), \"../qiskit_runtime/runtime_simple/runtime_simple.json\")\n",
+ "sample_program_data = os.path.join(os.getcwd(), \"../qiskit_runtime/sample_program/sample_program.py\")\n",
+ "sample_program_json = os.path.join(os.getcwd(), \"../qiskit_runtime/sample_program/sample_program.json\")\n",
" \n",
"program_id = provider.runtime.upload_program(\n",
- " data=runtime_simple_data,\n",
- " metadata=runtime_simple_json\n",
+ " data=sample_program_data,\n",
+ " metadata=sample_program_json\n",
")\n",
"print(program_id)"
]
diff --git a/API_direct.ipynb b/API_direct.ipynb
index 98a271e44..82bab0517 100644
--- a/API_direct.ipynb
+++ b/API_direct.ipynb
@@ -97,7 +97,7 @@
"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",
"- 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",
+ "- sample-program: A sample runtime program. \n",
"- vqe: Variational Quantum Eigensolver (VQE) to find the minimal eigenvalue of a Hamiltonian. \n"
]
}
@@ -185,7 +185,7 @@
}
],
"source": [
- "Runtime_program = \"runtime-simple\"\n",
+ "Runtime_program = \"sample-program\"\n",
"\n",
"program_input = {\"iterations\":2} \n",
"\n",
|