-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
## Changes ### Adds index page This page is important so that `docs.quantum.ibm.com/api/qiskit-addon-obp` does not 404. It should simply be a flat list of every documented module. ### Flattens submodules We've gotten prior user complaints that they don't like when docs have a lot of nesting. So, docs.quantum.ibm.com expects all modules to be flattened to the same level in the left ToC. This means that users access submodules via the left ToC, rather than through the parent module's page. Due to this change, we delete qiskit_addon_obp.utils because it does not actually have any importable interfaces. If the module list ever gets too big, the qiskit/documentation repository has a mechanism to let you group modules into parent folders (see https://docs.quantum.ibm.com/api/qiskit). ### Sets module metadata & moves structural directives to RST The script in `qiskit/documentation` expects you to set ``(:mod:`qiskit_addon_obp`)`` at the top of every module page. We need this to extract metadata, which we use to set up the left ToC and `<head>` metadata for the page. We also now set all the `.. autodoc` directives like `.. autosummary` in RST. Sphinx [doesn't mix well](https://stackoverflow.com/questions/62855567/headings-when-using-autodoc-in-sphinx) when you have some structural elements like headings in RST and some in Python, so it's important to be consistent with where those structural elements go. Putting it in RST is more conventional, and it avoids us having to disable three Ruff lint rules. For modules, most the docs should be in the RST file other than a one-sentence summary of the module. ### Inlines functions and some classes We've gotten prior user complaints that they don't like when you have to click to a bunch of subpages to see individual functions and classes. So, we've generally adopted the approach of inlining functions and smaller classes. Larger classes and functions can still live on dedicated pages. The right page ToC makes it so that users can still jump around the page. This change is subjective. Feel free to push back if you think any particular interface should be a dedicated page! We set up client-redirects using sphinx-reredirects to avoid 404s. We used this extension well with Qiskit SDK. ## Results <details><summary>docs.quantum.ibm.com</summary> <img width="976" alt="Screenshot 2024-10-22 at 3 22 32 PM" src="https://github.com/user-attachments/assets/33bc2458-397f-4541-a7ba-2655b32c8c80"> </details> <details><summary>GitHub Pages</summary> <img width="289" alt="Screenshot 2024-10-22 at 3 31 20 PM" src="https://github.com/user-attachments/assets/70bd5d2a-fd05-4fd8-ad0d-efed379688bf"> <img width="625" alt="Screenshot 2024-10-22 at 3 31 23 PM" src="https://github.com/user-attachments/assets/9de98b41-d0b0-44b9-bcce-dbb1844b1057"> </details> <hr>This is an automatic backport of pull request #24 done by [Mergify](https://mergify.com).
- Loading branch information
1 parent
26108db
commit 472badc
Showing
18 changed files
with
124 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
********************************** | ||
``qiskit-addon-obp`` API reference | ||
********************************** | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
qiskit_addon_obp | ||
qiskit_addon_obp.utils.metadata | ||
qiskit_addon_obp.utils.operations | ||
qiskit_addon_obp.utils.simplify | ||
qiskit_addon_obp.utils.truncating | ||
qiskit_addon_obp.utils.visualization |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
============================================ | ||
Qiskit addon: operator backpropagation (OBP) | ||
============================================ | ||
|
||
.. _qiskit_addon_obp: | ||
================================================== | ||
Operator backpropagation (:mod:`qiskit_addon_obp`) | ||
================================================== | ||
|
||
.. automodule:: qiskit_addon_obp | ||
:no-members: | ||
:no-inherited-members: | ||
:no-special-members: | ||
|
||
.. currentmodule:: qiskit_addon_obp | ||
|
||
.. autofunction:: backpropagate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
======== | ||
metadata | ||
======== | ||
|
||
.. _qiskit_addon_obp-utils-metadata: | ||
=========================================================== | ||
Metadata utilities (:mod:`qiskit_addon_obp.utils.metadata`) | ||
=========================================================== | ||
|
||
.. automodule:: qiskit_addon_obp.utils.metadata | ||
:no-members: | ||
:no-inherited-members: | ||
:no-special-members: | ||
|
||
.. currentmodule:: qiskit_addon_obp.utils.metadata | ||
|
||
.. autosummary:: | ||
:toctree: ../stubs/ | ||
:nosignatures: | ||
|
||
OBPMetadata | ||
SliceMetadata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
========== | ||
operations | ||
========== | ||
|
||
.. _qiskit_addon_obp-utils-operations: | ||
============================================================= | ||
Operator utilities (:mod:`qiskit_addon_obp.utils.operations`) | ||
============================================================= | ||
|
||
.. automodule:: qiskit_addon_obp.utils.operations | ||
:no-members: | ||
:no-inherited-members: | ||
:no-special-members: | ||
|
||
.. currentmodule:: qiskit_addon_obp.utils.operations | ||
|
||
.. autofunction:: apply_op_to | ||
.. autofunction:: apply_reset_to | ||
.. autofunction:: to_global_op | ||
.. autofunction:: reduce_op |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
======== | ||
simplify | ||
======== | ||
|
||
.. _qiskit_addon_obp-utils-simplify: | ||
====================================================================== | ||
Pauli operator simplification (:mod:`qiskit_addon_obp.utils.simplify`) | ||
====================================================================== | ||
|
||
.. automodule:: qiskit_addon_obp.utils.simplify | ||
:no-members: | ||
:no-inherited-members: | ||
:no-special-members: | ||
|
||
.. currentmodule:: qiskit_addon_obp.utils.simplify | ||
|
||
.. autoclass:: OperatorBudget | ||
.. autoclass:: SimplifyMetadata | ||
.. autofunction:: simplify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
========== | ||
truncating | ||
========== | ||
|
||
.. _qiskit_addon_obp-utils-truncating: | ||
=============================================================== | ||
Truncation utilities (:mod:`qiskit_addon_obp.utils.truncating`) | ||
=============================================================== | ||
|
||
.. automodule:: qiskit_addon_obp.utils.truncating | ||
:no-members: | ||
:no-inherited-members: | ||
:no-special-members: | ||
|
||
.. currentmodule:: qiskit_addon_obp.utils.truncating | ||
|
||
.. autoclass:: TruncationErrorBudget | ||
.. autofunction:: setup_budget | ||
.. autofunction:: truncate_binary_search |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
============= | ||
visualization | ||
============= | ||
|
||
.. _qiskit_addon_obp-utils-visualization: | ||
===================================================================== | ||
Visualization utilities (:mod:`qiskit_addon_obp.utils.visualization`) | ||
===================================================================== | ||
|
||
.. automodule:: qiskit_addon_obp.utils.visualization | ||
:no-members: | ||
:no-inherited-members: | ||
:no-special-members: | ||
|
||
.. currentmodule:: qiskit_addon_obp.utils.visualization | ||
|
||
.. autofunction:: plot_accumulated_error | ||
.. autofunction:: plot_left_over_error_budget | ||
.. autofunction:: plot_slice_errors | ||
.. autofunction:: plot_num_paulis | ||
.. autofunction:: plot_num_truncated_paulis | ||
.. autofunction:: plot_sum_paulis | ||
.. autofunction:: plot_num_qwc_groups |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters