Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various documentation improvements #98

Merged
merged 6 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions docs/guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -273,15 +273,20 @@ The built-in transpiler largely leverages the :mod:`qiskit.transpiler`. Custom p
* in the translation stage, the :class:`WrapRxxAngles <qiskit_aqt_provider.transpiler_plugin.WrapRxxAngles>` pass exploits the periodicity of the :class:`RXXGate <qiskit.circuit.library.RXXGate>` to wrap its angle :math:`\theta` to the :math:`[0,\,\pi/2]` range. This may come at the expense of extra single-qubit rotations.
* in the scheduling stage, the :class:`RewriteRxAsR <qiskit_aqt_provider.transpiler_plugin.RewriteRxAsR>` pass rewrites :class:`RXGate <qiskit.circuit.library.RXGate>` operations as :class:`RGate <qiskit.circuit.library.RGate>` and wraps the angles :math:`\theta\in[0,\,\pi]` and :math:`\phi\in[0,\,2\pi]`. This does not restrict the generality of quantum circuits and enables efficient native implementations.

.. warning:: Circuits accepted by the AQT API are executed after applying one further transformation. Small-angle :math:`\theta` instances of :class:`RGate <qiskit.circuit.library.RGate>` are substituted as

:math:`R(\theta,\,\phi)\ \to\ R(\pi, \pi)\cdot R(\theta+\pi,\,\phi)`.

The threshold for triggering this transformation is an implementation detail, typically around :math:`\theta=\pi/5`. Please contact AQT for details.
.. tip:: AQT computing resources natively implement :class:`RXXGate <qiskit.circuit.library.RXXGate>` with :math:`\theta` continuously varying in :math:`(0,\,\pi/2]`. For optimal performance, the transpiler output should be inspected to make sure :class:`RXXGate <qiskit.circuit.library.RXXGate>` instances are not transpiled to unified angles (often :math:`\theta=\pi/2`).

Transpilation in Qiskit primitives
----------------------------------

The generic implementations of the Qiskit primitives :class:`Sampler <qiskit.primitives.BaseSampler>` and :class:`Estimator <qiskit.primitives.BaseEstimator>` cache transpilation results to improve their runtime performance. This is particularly effective when evaluating batches of circuits that differ only in their parametrization.

However, some passes registered by the AQT :ref:`transpiler plugin <transpiler-plugin>` require knowledge of the bound parameter values. The specialized implementations :class:`AQTSampler <qiskit_aqt_provider.primitives.sampler.AQTSampler>` and :class:`AQTEstimator <qiskit_aqt_provider.primitives.estimator.AQTEstimator>` use a hybrid approach, where the transpilation results of passes that do not require bound parameters are cached, while the small subset of passes that require fixed parameter values is executed before each circuit submission to the execution backend.

Circuit modifications behind the remote API
-------------------------------------------

Circuits accepted by the AQT API are executed exactly as they were transmitted, with the only exception that small-angle :math:`\theta` instances of :class:`RGate <qiskit.circuit.library.RGate>` are substituted with

:math:`R(\theta,\,\phi)\ \to\ R(\pi, \pi)\cdot R(\theta+\pi,\,\phi)`.

The threshold for triggering this transformation is an implementation detail, typically around :math:`\theta=\pi/5`. Please contact AQT for details.
13 changes: 11 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ hardware.
Quick start
-----------

Install the latest release from the `PyPI <https://pypi.org/project/qiskit-aqt-provider>`_:

.. code-block:: bash

pip install qiskit-aqt-provider

fg-aqt marked this conversation as resolved.
Show resolved Hide resolved
.. warning:: Some dependencies might be pinned or tightly constrained to ensure optimal performance. If you encounter conflicts for your use case, please `open an issue <https://github.com/qiskit-community/qiskit-aqt-provider/issues/new/choose>`_.

Define a circuit that generates 2-qubit Bell state and sample it on a simulator backend running on the local machine:

.. jupyter-execute::
Expand Down Expand Up @@ -40,7 +48,7 @@ Define a circuit that generates 2-qubit Bell state and sample it on a simulator
quasi_dist = result.quasi_dists[0]
print(quasi_dist)

For more details see the :ref:`user guide <user-guide>`, a selection of `examples <https://github.com/qiskit-community/qiskit-aqt-provider/tree/master/examples>`_, or the API reference.
For more details see the :ref:`user guide <user-guide>`, a selection of `examples <https://github.com/qiskit-community/qiskit-aqt-provider/tree/master/examples>`_, or the reference documentation.

.. toctree::
:maxdepth: 1
Expand All @@ -51,7 +59,7 @@ For more details see the :ref:`user guide <user-guide>`, a selection of `example

.. toctree::
:maxdepth: 1
:caption: API Reference
:caption: Reference
:hidden:

AQTProvider <apidoc/provider>
Expand All @@ -67,3 +75,4 @@ For more details see the :ref:`user guide <user-guide>`, a selection of `example

Repository <https://github.com/qiskit-community/qiskit-aqt-provider>
AQT <https://www.aqt.eu/qc-systems>
API reference <https://arnica-stage.aqt.eu/api/v1/docs>