Skip to content

Commit

Permalink
Add link to API reference in running docs (Qiskit#731)
Browse files Browse the repository at this point in the history
* add links to API reference in Running docs

Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com>
  • Loading branch information
akihikokuroda authored Jun 28, 2023
1 parent e809798 commit 90dcafa
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions docs/running/notebooks/01_running_program.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@
"id": "4dd85621-9ab0-4f34-9ab4-07ad773c5e00",
"metadata": {},
"source": [
"After importing the necessary classes and configuring them, we can run the program by calling the `run()` method of the `QuantumServerless` object:\n",
"After importing the necessary classes and configuring them, we can run the program by calling the `run()` method of the [QuantumServerless](https://qiskit-extensions.github.io/quantum-serverless/stubs/quantum_serverless.QuantumServerless.html#quantum_serverless.QuantumServerless) object:\n",
"\n",
"`Program` accepts couple of required parameters:\n",
"[Program](https://qiskit-extensions.github.io/quantum-serverless/stubs/quantum_serverless.core.Program.html#quantum_serverless.core.Program) accepts couple of required parameters:\n",
"- title - name of the program\n",
"- entrypoint - name of python file you want to execute\n",
"- working_dir - folder where your script is located. This is optional parameter and will be current folder by default. "
Expand Down Expand Up @@ -112,7 +112,7 @@
"id": "39ee31d2-3553-4e19-bcb9-4cccd0df0e4c",
"metadata": {},
"source": [
"`Job` instances have a `status()` method to check status of program execution."
"[Job](https://qiskit-extensions.github.io/quantum-serverless/stubs/quantum_serverless.core.Job.html#quantum_serverless.core.Job) instances have a `status()` method to check status of program execution."
]
},
{
Expand Down
8 changes: 4 additions & 4 deletions docs/running/notebooks/02_distributed_workloads.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@
"\n",
"There are a lot of new concepts introduced in this program, so let's go over them in more detail:\n",
"\n",
"The `distribute_task` decorator converts a function into a distributed task. This means that the function will be executed on compute resources asynchronously and in parallel to the main context of the program.\n",
"The [distribute_task](https://qiskit-extensions.github.io/quantum-serverless/stubs/quantum_serverless.core.distribute_task.html#quantum_serverless.core.distribute_task) decorator converts a function into a distributed task. This means that the function will be executed on compute resources asynchronously and in parallel to the main context of the program.\n",
"\n",
"When you call a converted function, it will return a reference to the function execution instead of the result. In order to get the result back, you need to call the `get` function on the function reference. `get` will wait until the function is finished and return the result of the function execution.\n",
"When you call a converted function, it will return a reference to the function execution instead of the result. In order to get the result back, you need to call the [get](https://qiskit-extensions.github.io/quantum-serverless/stubs/quantum_serverless.core.get.html#quantum_serverless.core.get) function on the function reference. `get` will wait until the function is finished and return the result of the function execution.\n",
"\n",
"In the program above, we have applied the `distribute_task` decorator to the `distributed_sample` function. This function takes a `QuantumCircuit` as input and returns the quasi distribution for that circuit.\n",
"\n",
"After we have defined the `distributed_sample` function, we read the circuits from the program arguments using the `get_arguments` function. We then call the `distributed_sample` function for each of the circuits, which creates a reference to each of the function executions.\n",
"After we have defined the `distributed_sample` function, we read the circuits from the program arguments using the [get_arguments](https://qiskit-extensions.github.io/quantum-serverless/stubs/quantum_serverless.serializers.get_arguments.html#quantum_serverless.serializers.get_arguments) function. We then call the `distributed_sample` function for each of the circuits, which creates a reference to each of the function executions.\n",
"\n",
"These function executions will run in parallel on compute resources, and we get task references as the return type. We store these task references in the `sample_task_references` list.\n",
"\n",
"After we have created the task references for each of the function executions, we need to collect the results from these tasks. We do this by calling the `get` function on the list of task references, which waits until all the tasks have completed and returns the results.\n",
"\n",
"Once we have the results, we can save them using the `save_result` function.\n",
"Once we have the results, we can save them using the [save_result](https://qiskit-extensions.github.io/quantum-serverless/stubs/quantum_serverless.core.save_result.html#quantum_serverless.core.save_result) function.\n",
"\n",
"Essentially, this program reads the circuits from the program arguments, executes the `distributed_sample` function on each circuit in parallel, collects the results from the function executions, and saves the results."
]
Expand Down
4 changes: 2 additions & 2 deletions docs/running/notebooks/03_arguments_and_results.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"\n",
"Let's create another file with our program [./source_files/program_3.py](./source_files/program_3.py). \n",
"\n",
"Instead of having the circuit defined inside the program (like we did in first example), we will pass it as an argument. We will also save the results, so we can access them later by calling `save_result`.\n",
"Instead of having the circuit defined inside the program (like we did in first example), we will pass it as an argument. We will also save the results, so we can access them later by calling [save_result](https://qiskit-extensions.github.io/quantum-serverless/stubs/quantum_serverless.core.save_result.html#quantum_serverless.core.save_result).\n",
"\n",
"Here is the program:\n",
"\n",
Expand Down Expand Up @@ -39,7 +39,7 @@
"})\n",
"```\n",
"\n",
"As you can see, the circuit construction is not inside the program anymore. Instead, we parse the arguments by calling the `get_arguments()` function."
"As you can see, the circuit construction is not inside the program anymore. Instead, we parse the arguments by calling the [get_arguments](https://qiskit-extensions.github.io/quantum-serverless/stubs/quantum_serverless.serializers.get_arguments.html#quantum_serverless.serializers.get_arguments) function."
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/running/notebooks/04_dependencies.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"To install a custom dependency that our program might use we need to pass it as the `dependencies` argument to the `Program` class constructor. \n",
"To install a custom dependency that our program might use we need to pass it as the `dependencies` argument to the [Program](https://qiskit-extensions.github.io/quantum-serverless/stubs/quantum_serverless.core.Program.html#quantum_serverless.core.Program) class constructor. \n",
"You can pass multiple dependencies and specify versions. "
]
},
Expand Down
6 changes: 3 additions & 3 deletions docs/running/notebooks/05_retrieving_past_results.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"id": "37322958-a029-46bb-bc46-82b7ded329b5",
"metadata": {},
"source": [
"First, create ``Provider`` and ``QuantumServerless`` instances."
"First, create [Provider](https://qiskit-extensions.github.io/quantum-serverless/stubs/quantum_serverless.core.Provider.html#quantum_serverless.core.Provider) and [QuantumServerless](https://qiskit-extensions.github.io/quantum-serverless/stubs/quantum_serverless.QuantumServerless.html#quantum_serverless.QuantumServerless) instances."
]
},
{
Expand Down Expand Up @@ -101,7 +101,7 @@
"id": "675f9b7a-7d44-43e3-baea-0289cf29e573",
"metadata": {},
"source": [
"Call the blocking comand, ``Job.result()``, to ensure the results are ready in the following cells."
"Call the blocking comand, [Job](https://qiskit-extensions.github.io/quantum-serverless/stubs/quantum_serverless.core.Job.html#quantum_serverless.core.Job)``.result()``, to ensure the results are ready in the following cells."
]
},
{
Expand Down Expand Up @@ -158,7 +158,7 @@
"id": "24942f00-680e-4cea-b0e7-bc75b19565fe",
"metadata": {},
"source": [
"To inspect the logs from a program, access them from the ``Job`` instance."
"To inspect the logs from a program, access them from the [Job](https://qiskit-extensions.github.io/quantum-serverless/stubs/quantum_serverless.core.Job.html#quantum_serverless.core.Job) instance."
]
},
{
Expand Down

0 comments on commit 90dcafa

Please sign in to comment.