From 219917ea3b3f75ff6391cd2d1c39860abf2e8b80 Mon Sep 17 00:00:00 2001 From: Rebecca Dimock <66339736+beckykd@users.noreply.github.com> Date: Tue, 5 Dec 2023 14:59:47 -0600 Subject: [PATCH] Add links to Transpile section (#475) Closes #439 --------- Co-authored-by: abbycross --- docs/api/migration-guides/qiskit-runtime.mdx | 2 +- docs/run/advanced-runtime-options.mdx | 2 +- docs/run/configure-runtime-compilation.mdx | 2 +- docs/transpile/_toc.json | 4 ++-- docs/transpile/ai-transpiler-passes.mdx | 5 +++++ docs/transpile/common-parameters.mdx | 8 +++++--- docs/transpile/custom-transpiler-pass.ipynb | 13 +++++++++++++ .../defaults-and-configuration-options.mdx | 14 ++++++++------ .../dynamical-decoupling-pass-manager.ipynb | 17 +++++++++++++++-- docs/transpile/index.mdx | 12 ++++++++++-- docs/transpile/qiskit-transpiler-service.mdx | 8 +++++++- .../representing_quantum_computers.mdx | 10 +++++++++- docs/transpile/set-optimization.mdx | 14 +++++++++++++- .../transpile-with-pass-managers.ipynb | 8 ++++++-- docs/transpile/transpiler-stages.ipynb | 14 ++++++++++++++ 15 files changed, 110 insertions(+), 23 deletions(-) diff --git a/docs/api/migration-guides/qiskit-runtime.mdx b/docs/api/migration-guides/qiskit-runtime.mdx index 98964362bd6..8f7cb2e3d47 100644 --- a/docs/api/migration-guides/qiskit-runtime.mdx +++ b/docs/api/migration-guides/qiskit-runtime.mdx @@ -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) \ No newline at end of file diff --git a/docs/run/advanced-runtime-options.mdx b/docs/run/advanced-runtime-options.mdx index 65c02d68952..6cc973e94ac 100644 --- a/docs/run/advanced-runtime-options.mdx +++ b/docs/run/advanced-runtime-options.mdx @@ -106,7 +106,7 @@ See the Optimization level table in the [Runtime compilation topic](configure-runtime-compilation#set-the-optimization-level) for further details. - 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. The optimization level option is a "first-level option", and can be set as follows: diff --git a/docs/run/configure-runtime-compilation.mdx b/docs/run/configure-runtime-compilation.mdx index 13e9fc5128e..c3cacc5144e 100644 --- a/docs/run/configure-runtime-compilation.mdx +++ b/docs/run/configure-runtime-compilation.mdx @@ -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. diff --git a/docs/transpile/_toc.json b/docs/transpile/_toc.json index 2e5c66ce4af..d2f354d5736 100644 --- a/docs/transpile/_toc.json +++ b/docs/transpile/_toc.json @@ -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" }, { @@ -34,7 +34,7 @@ "url": "/transpile/set-optimization" }, { - "title": "Representing quantum computers", + "title": "Represent quantum computers", "url": "/transpile/representing_quantum_computers" }, { diff --git a/docs/transpile/ai-transpiler-passes.mdx b/docs/transpile/ai-transpiler-passes.mdx index 34ab7c2a06a..61e9a9e35d3 100644 --- a/docs/transpile/ai-transpiler-passes.mdx +++ b/docs/transpile/ai-transpiler-passes.mdx @@ -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. + + + - 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) + diff --git a/docs/transpile/common-parameters.mdx b/docs/transpile/common-parameters.mdx index 7d12006684b..7c72dd5cb5b 100644 --- a/docs/transpile/common-parameters.mdx +++ b/docs/transpile/common-parameters.mdx @@ -100,7 +100,9 @@ These options influence how the transpiler works and are used to try and get bet ## Next steps - - [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) + diff --git a/docs/transpile/custom-transpiler-pass.ipynb b/docs/transpile/custom-transpiler-pass.ipynb index 6cd780c6bc8..80778aafe23 100644 --- a/docs/transpile/custom-transpiler-pass.ipynb +++ b/docs/transpile/custom-transpiler-pass.ipynb @@ -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", + "\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", + "" + ] } ], "metadata": { diff --git a/docs/transpile/defaults-and-configuration-options.mdx b/docs/transpile/defaults-and-configuration-options.mdx index 20098d9e318..3c7c06deb3e 100644 --- a/docs/transpile/defaults-and-configuration-options.mdx +++ b/docs/transpile/defaults-and-configuration-options.mdx @@ -206,10 +206,12 @@ qiskit.compiler.transpile(unitary_synthesis_method='default', translation_method ## Next steps - - [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). diff --git a/docs/transpile/dynamical-decoupling-pass-manager.ipynb b/docs/transpile/dynamical-decoupling-pass-manager.ipynb index 6407b66a9ef..0a9527e5fc1 100644 --- a/docs/transpile/dynamical-decoupling-pass-manager.ipynb +++ b/docs/transpile/dynamical-decoupling-pass-manager.ipynb @@ -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", + "\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", + "" + ] } ], "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", @@ -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 diff --git a/docs/transpile/index.mdx b/docs/transpile/index.mdx index 81217b1dbb1..5e3fa018ee6 100644 --- a/docs/transpile/index.mdx +++ b/docs/transpile/index.mdx @@ -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. \ No newline at end of file +## Next steps + + + - 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) + diff --git a/docs/transpile/qiskit-transpiler-service.mdx b/docs/transpile/qiskit-transpiler-service.mdx index 1199eb85e0b..d664af58c3a 100644 --- a/docs/transpile/qiskit-transpiler-service.mdx +++ b/docs/transpile/qiskit-transpiler-service.mdx @@ -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 + + + - 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) + diff --git a/docs/transpile/representing_quantum_computers.mdx b/docs/transpile/representing_quantum_computers.mdx index b7c1b09b5c9..9a6e27dcd6a 100644 --- a/docs/transpile/representing_quantum_computers.mdx +++ b/docs/transpile/representing_quantum_computers.mdx @@ -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. @@ -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 + + + - 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) + diff --git a/docs/transpile/set-optimization.mdx b/docs/transpile/set-optimization.mdx index 37f4a559024..2267a88ab7d 100644 --- a/docs/transpile/set-optimization.mdx +++ b/docs/transpile/set-optimization.mdx @@ -151,5 +151,17 @@ Adjusting the optimization level can change other aspects of the circuit too, no - [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. + + +## Next steps + + + - 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) + \ No newline at end of file diff --git a/docs/transpile/transpile-with-pass-managers.ipynb b/docs/transpile/transpile-with-pass-managers.ipynb index e531a886c07..a4a930d8fdf 100644 --- a/docs/transpile/transpile-with-pass-managers.ipynb +++ b/docs/transpile/transpile-with-pass-managers.ipynb @@ -242,8 +242,12 @@ "## Next steps\n", "\n", "\n", - "- [Write a custom transpiler pass](custom-transpiler-pass).\n", - "" + " - [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", + "\n" ] } ], diff --git a/docs/transpile/transpiler-stages.ipynb b/docs/transpile/transpiler-stages.ipynb index 5cff1cb4343..22f240a6d48 100644 --- a/docs/transpile/transpiler-stages.ipynb +++ b/docs/transpile/transpiler-stages.ipynb @@ -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", + "\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", + "\n" + ] } ], "metadata": {