Skip to content

Commit

Permalink
Add links to Transpile section (#475)
Browse files Browse the repository at this point in the history
Closes #439

---------

Co-authored-by: abbycross <[email protected]>
  • Loading branch information
beckykd and abbycross authored Dec 5, 2023
1 parent 40ded0a commit 219917e
Show file tree
Hide file tree
Showing 15 changed files with 110 additions and 23 deletions.
2 changes: 1 addition & 1 deletion docs/api/migration-guides/qiskit-runtime.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,6 @@ an algorithm, you might want to tune certain primitive options. For details, see
- [Get started with Sampler.](../../run/primitives-get-started#start-sampler)
- Explore [sessions.](../../run/sessions)
- [Run a primitive in a session.](../../run/run-jobs-in-session)
- Experiment with the [Run custom transpiled circuits with primitives tutorial.](https://learning.quantum.ibm.com/tutorial/submitting-user-transpiled-circuits-using-primitives)
- Experiment with the [Submit pre-transpiled circuits tutorial.](https://learning.quantum.ibm.com/tutorial/submitting-user-transpiled-circuits-using-primitives)

</Admonition>
2 changes: 1 addition & 1 deletion docs/run/advanced-runtime-options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ See the Optimization level table in the
[Runtime compilation topic](configure-runtime-compilation#set-the-optimization-level) for further details.

<Admonition>
In the currently deployed Qiskit Runtime primitives, optimization levels 2 and 3 behave identically to level 1. If you want to use more advanced optimization, use the Qiskit transpiler locally, set [`skip_transpilation=True`](../api/qiskit-ibm-runtime/qiskit_ibm_runtime.options.TranspilationOptions#skip_transpilation), and then pass the transpiled circuits to the primitives. For instructions see the [Submitting user-transpiled circuits using primitives](https://learning.quantum.ibm.com/tutorial/submitting-user-transpiled-circuits-using-primitives) tutorial.
In the currently deployed Qiskit Runtime primitives, optimization levels 2 and 3 behave identically to level 1. If you want to use more advanced optimization, use the Qiskit transpiler locally, set [`skip_transpilation=True`](../api/qiskit-ibm-runtime/qiskit_ibm_runtime.options.TranspilationOptions#skip_transpilation), and then pass the transpiled circuits to the primitives. For instructions see the [Submit pre-transpiled circuits](https://learning.quantum.ibm.com/tutorial/submitting-user-transpiled-circuits-using-primitives) tutorial.
</Admonition>

The optimization level option is a "first-level option", and can be set as follows:
Expand Down
2 changes: 1 addition & 1 deletion docs/run/configure-runtime-compilation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ The `optimization_level` setting specifies how much optimization to perform on t

At present, the primitives will attempt low-cost transformations if given a circuit that is not already in target form, but in the future, primitives will error on such circuits. It is therefore recommended that users take advantage of the local compilation capabilities of the Qiskit transpiler wherever possible.

For instructions on preparing circuits for primitive queries, see the [Submitting user-transpiled circuits using primitives](https://learning.quantum.ibm.com/tutorial/submitting-user-transpiled-circuits-using-primitives) tutorial.
For instructions on preparing circuits for primitive queries, see the [Submit pre-transpiled circuits](https://learning.quantum.ibm.com/tutorial/submitting-user-transpiled-circuits-using-primitives) tutorial.
</Admonition>

<Admonition type="note">
Expand Down
4 changes: 2 additions & 2 deletions docs/transpile/_toc.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"url": "/transpile/dynamical-decoupling-pass-manager"
},
{
"title": "Write your own transpiler pass",
"title": "Write a custom transpiler pass",
"url": "/transpile/custom-transpiler-pass"
},
{
Expand All @@ -34,7 +34,7 @@
"url": "/transpile/set-optimization"
},
{
"title": "Representing quantum computers",
"title": "Represent quantum computers",
"url": "/transpile/representing_quantum_computers"
},
{
Expand Down
5 changes: 5 additions & 0 deletions docs/transpile/ai-transpiler-passes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,8 @@ The `layout_mode` includes the following options:
- `keep`: This respects the layout set by the previous transpiler passes (or uses the trivial layout if not set). It is typically only used when the circuit must be run on specific qubits of the device. It often produces worse results because it has less room for optimization.
- `improve`: This uses the layout set by the previous transpiler passes as a starting point. It is useful when you have a good initial guess for the layout; for example, for circuits that are built in a way that approximately follows the device's coupling map. It is also useful if you want to try other specific layout passes combined with the `AIRouting` pass.
- `optimize`: This is the default mode. It works best for general circuits where you might not have good layout guesses. This mode ignores previous layout selections.

<Admonition type="tip" title="Recommendations">
- Use transpilation with Qiskit Patterns in the [Reduce transpiled circuit depth, with circuit cutting](https://learning.quantum.ibm.com/tutorial/reduce-transpiled-circuit-depth-with-circuit-cutting) tutorial.
- Review the [Qiskit transpiler service API documentation.](https://cloud-transpiler-experimental.quantum-computing.ibm.com/docs)
</Admonition>
8 changes: 5 additions & 3 deletions docs/transpile/common-parameters.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ These options influence how the transpiler works and are used to try and get bet
## Next steps

<Admonition type="tip" title="Recommendation">
- [Default options and configuration settings](defaults-and-configuration-options)
- [Set the optimization level](set-optimization)
- [Submit transpiled circuits](https://learning.quantum.ibm.com/tutorial/submit-transpiled-circuits) with Qiskit Runtime on IBM Quantum Learning
- Review the [Default options and configuration settings](defaults-and-configuration-options) topic.
- Learn how to [Set the optimization level.](set-optimization)
- Try the [Submit transpiled circuits](https://learning.quantum.ibm.com/tutorial/submit-transpiled-circuits) tutorial.
- Review the [Transpile API documentation.](/api/qiskit/transpiler)

</Admonition>
13 changes: 13 additions & 0 deletions docs/transpile/custom-transpiler-pass.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,19 @@
"source": [
"np.alltrue([Operator(twirled_qc).equiv(qc) for twirled_qc in twirled_qcs])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Next steps\n",
"\n",
"<Admonition type=\"tip\" title=\"Recommendations\">\n",
" - To learn how to use the `transpile` function, start with the [Transpilation default settings and configuration options](defaults-and-configuration-options) topic.\n",
" - Try the [Submit transpiled circuits](https://learning.quantum.ibm.com/tutorial/submit-transpiled-circuits) tutorial.\n",
" - Review the [Transpile API documentation.](https://docs.quantum-computing.ibm.com/api/qiskit/transpiler)\n",
"</Admonition>"
]
}
],
"metadata": {
Expand Down
14 changes: 8 additions & 6 deletions docs/transpile/defaults-and-configuration-options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,12 @@ qiskit.compiler.transpile(unitary_synthesis_method='default', translation_method
## Next steps

<Admonition type="tip" title="Recommendations">
- [Set the optimization level](set-optimization)
- [Commonly used parameters](common-parameters)
- [Set the optimization level when using Qiskit Runtime.](../run/advanced-runtime-options)
- [Transpile with pass managers](transpile-with-pass-managers)
- For examples, see [Representing quantum computers](representing_quantum_computers)
- [Transpile API](/api/qiskit/transpiler)
- Learn how to [Set the optimization level](set-optimization).
- Review more [Commonly used parameters](common-parameters).
- Learn how to [Set the optimization level when using Qiskit Runtime.](../run/advanced-runtime-options)
- Visit the [Transpile with pass managers](transpile-with-pass-managers) topic.
- For examples, see [Representing quantum computers.](representing_quantum_computers)
- Try the [Submit transpiled circuits](https://learning.quantum.ibm.com/tutorial/submit-transpiled-circuits) tutorial.
- Use transpilation with Qiskit Patterns in the [Reduce transpiled circuit depth, with circuit cutting](https://learning.quantum.ibm.com/tutorial/reduce-transpiled-circuit-depth-with-circuit-cutting) tutorial.
- Review the [Transpile API documentation](/api/qiskit/transpiler).
</Admonition>
17 changes: 15 additions & 2 deletions docs/transpile/dynamical-decoupling-pass-manager.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,22 @@
"source": [
"Now, `YGate`s are absent from our circuit, and there is explicit timing information in the form of `Delay` gates. This transpiled circuit with dynamical decoupling is not ready to be sent to the backend. When doing so, remember to set the `skip_transpilation=True` option (See [Advanced runtime compilation options](/run/configure-runtime-compilation#advanced-runtime-compilation-options).)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Next steps\n",
"\n",
"<Admonition type=\"tip\" title=\"Recommendations\">\n",
" - To learn how to use the `transpile` function, start with the [Transpilation default settings and configuration options](defaults-and-configuration-options) topic.\n",
" - Try the [Submit transpiled circuits](https://learning.quantum.ibm.com/tutorial/submit-transpiled-circuits) tutorial.\n",
" - See the [Transpile API documentation.](https://docs.quantum-computing.ibm.com/api/qiskit/transpiler)\n",
"</Admonition>"
]
}
],
"metadata": {
"title": "Create a pass manager for dynamical decoupling",
"description": "How to create a pass manager for dynamical decoupling in Qiskit.",
"kernelspec": {
"display_name": "documentation--fuetTj0",
Expand All @@ -266,7 +278,8 @@
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
}
},
"title": "Create a pass manager for dynamical decoupling"
},
"nbformat": 4,
"nbformat_minor": 4
Expand Down
12 changes: 10 additions & 2 deletions docs/transpile/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,13 @@ For an overview of transpiling using pass managers, see [Transpile with pass man

For a simpler , but less customizable, "out-of-the-box" way to use the transpiler, use the [`qiskit.compiler.transpile`](/api/qiskit/compiler#qiskit.compiler.transpile) function. This generates and runs one of the preset `StagedPassManager`s based on, among other options, an `optimization_level` flag that can be set to 0, 1, 2, or 3. Higher levels generate more optimized circuits, at the expense of longer transpilation times.


For more information about the preset pass managers or the transpiler stages, see the [Transpiler stages and preset PassManagers](transpiler-stages) page. To learn how to use the `transpile` function, start with the [Transpilation default settings and configuration options](defaults-and-configuration-options) topic.
## Next steps

<Admonition type="tip" title="Recommendations">
- To learn how to use the `transpile` function, start with the [Transpilation default settings and configuration options](defaults-and-configuration-options) topic.
- Continue learning about transpilation with the [Transpiler stages](transpiler-stages) topic.
- Try the [Submit transpiled circuits](https://learning.quantum.ibm.com/tutorial/submit-transpiled-circuits) tutorial.
- Use transpilation with Qiskit Patterns in the [Reduce transpiled circuit depth, with circuit cutting](https://learning.quantum.ibm.com/tutorial/reduce-transpiled-circuit-depth-with-circuit-cutting) tutorial.
- Try an end-to-end example that uses transpiled circuits in the [Variational quantum eigensolver (VQE)](https://learning.quantum.ibm.com/tutorial/variational-quantum-eigensolver) tutorial.
- See the [Transpile API documentation.](https://docs.quantum-computing.ibm.com/api/qiskit/transpiler)
</Admonition>
8 changes: 7 additions & 1 deletion docs/transpile/qiskit-transpiler-service.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,10 @@ The following examples demonstrate how to transpile circuits using the Qiskit tr
)
transpiled_circuit = cloud_transpiler_service.run(random_circ)
```
​## Next steps

<Admonition type="tip" title="Recommendations">
- Learn how to create [AI transpiler passes.](ai-transpiler-passes)
- Use transpilation with Qiskit Patterns in the [Reduce transpiled circuit depth, with circuit cutting](https://learning.quantum.ibm.com/tutorial/reduce-transpiled-circuit-depth-with-circuit-cutting) tutorial.
- Review the [Qiskit transpiler service API documentation.](https://cloud-transpiler-experimental.quantum-computing.ibm.com/docs)
</Admonition>
10 changes: 9 additions & 1 deletion docs/transpile/representing_quantum_computers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Learn about coupling maps, basis gates and backend errors for trans

---

# Representing quantum computers
# Represent quantum computers

To construct an equivalent circuit that can run on a specific backend, the transpiler needs certain details about the backend. Typically, this information is found in the `backend` or `target = backend.target` class, so you don't need to pass anything further to the transpiler. However, if more infomation is provided, the transpiler can use it to try to produce the best circuit to run on that hardware.

Expand Down Expand Up @@ -159,3 +159,11 @@ qc_t_cm_bg_et.draw('mpl', style='iqp', fold=-1, idle_wires=False)

Note that by including the error information, the `VF2PostLayout` pass tries to find the optimal qubits to use, resulting in the same circuit that we found originally with the same physical qubits.

## Next steps

<Admonition type="tip" title="Recommendations">
- Understand [Transpilation default settings and configuration options.](defaults-and-configuration-options)
- Review the [Commonly used parameters for transpilation](common-parameters) topic.
- Try the [Submit transpiled circuits](https://learning.quantum.ibm.com/tutorial/submit-transpiled-circuits) tutorial.
- See the [Transpile API documentation.](/api/qiskit/transpiler)
</Admonition>
14 changes: 13 additions & 1 deletion docs/transpile/set-optimization.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -151,5 +151,17 @@ Adjusting the optimization level can change other aspects of the circuit too, no

<Admonition type="tip" title="Recommendation">
- [Default options and configuration settings](defaults-and-configuration-options)
- [Other commonly used parameters](common-parameters)
- [Commonly used parameters](common-parameters)
- Try the [Submit transpiled circuits](https://learning.quantum.ibm.com/tutorial/submit-transpiled-circuits) tutorial.

</Admonition>

## Next steps

<Admonition type="tip" title="Recommendations">
- To learn how to use the `transpile` function, start with the [Transpilation default settings and configuration options](defaults-and-configuration-options) topic.
- Continue learning about transpilation with the [Transpiler stages](transpiler-stages) topic.
- Try the [Submit transpiled circuits](https://learning.quantum.ibm.com/tutorial/submit-transpiled-circuits) tutorial.
- Try the [Build repetition codes](https://learning.quantum.ibm.com/tutorial/build-repetition-codes) tutorial.
- See the [Transpile API documentation.](/api/qiskit/transpiler)
</Admonition>
8 changes: 6 additions & 2 deletions docs/transpile/transpile-with-pass-managers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,12 @@
"## Next steps\n",
"\n",
"<Admonition type=\"tip\" title=\"Recommendation\">\n",
"- [Write a custom transpiler pass](custom-transpiler-pass).\n",
"</Admonition>"
" - [Write a custom transpiler pass](custom-transpiler-pass).\n",
" - [Create a pass manager for dynamical decoupling](dynamical-decoupling-pass-manager).\n",
" - To learn how to use the `transpile` function, start with the [Transpilation default settings and configuration options](defaults-and-configuration-options) topic.\n",
" - Try the [Submit transpiled circuits](https://learning.quantum.ibm.com/tutorial/submit-transpiled-circuits) tutorial.\n",
" - See the [Transpile API documentation.](https://docs.quantum-computing.ibm.com/api/qiskit/transpiler)\n",
"</Admonition>\n"
]
}
],
Expand Down
14 changes: 14 additions & 0 deletions docs/transpile/transpiler-stages.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,20 @@
"source": [
"Scheduling a circuit involves two parts: analysis and constraint mapping, followed by a padding pass. The first part requires running a scheduling analysis pass (by default this is [`ALAPSchedulingAnalysis`](../api/qiskit/qiskit.transpiler.passes.ALAPScheduleAnalysis)), which analyzes the circuit and records the start time of each instruction in the circuit into a schedule. Once the circuit has an initial schedule, additional passes can be run to account for any timing constraints on the target backend. Finally, a padding pass such as [`PadDelay`](../api/qiskit/qiskit.transpiler.passes.PadDelay) or [`PadDynamicalDecoupling`](../api/qiskit/qiskit.transpiler.passes.PadDynamicalDecoupling) can be executed."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Next steps\n",
"\n",
"<Admonition type=\"tip\" title=\"Recommendations\">\n",
" - To learn how to use the `transpile` function, start with the [Transpilation default settings and configuration options](defaults-and-configuration-options) topic.\n",
" - Continue learning about transpilation with the [Transpiler with pass managers](transpile-with-pass-managers) topic.\n",
" - Try the [Submit transpiled circuits](https://learning.quantum.ibm.com/tutorial/submit-transpiled-circuits) tutorial.\n",
" - See the [Transpile API documentation.](https://docs.quantum-computing.ibm.com/api/qiskit/transpiler)\n",
"</Admonition>\n"
]
}
],
"metadata": {
Expand Down

0 comments on commit 219917e

Please sign in to comment.