Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
4410ed1
Add docs from terra + dummy tutorial
ElePT Jul 24, 2023
c1440b9
Update requirements-dev
ElePT Jul 24, 2023
4df457b
Update index
ElePT Jul 24, 2023
7b78664
Update init
ElePT Jul 24, 2023
836903f
Update config
ElePT Jul 24, 2023
3343012
Fix copyright
ElePT Jul 24, 2023
4bee472
Add config to makefile
ElePT Jul 24, 2023
4e5ea25
Add config to tox
ElePT Jul 24, 2023
ac0b99e
Update workflows
ElePT Jul 24, 2023
9fa5dbc
Bump tutorials python
ElePT Jul 24, 2023
5242b34
Update deploy docs
ElePT Jul 24, 2023
987c15e
Add docs deploy to tools
ElePT Jul 24, 2023
bd2c87e
Add ignore untagged
ElePT Jul 24, 2023
2433d27
Apply suggestions from Eric's code review
ElePT Jul 24, 2023
bee2d0c
Apply suggestions from Eric's code review
ElePT Jul 24, 2023
cefe5b1
Apply suggestions from code review
ElePT Jul 24, 2023
c05062f
Merge branch 'add-docs-1' of https://github.com/ElePT/qiskit-algorith…
ElePT Jul 24, 2023
3c74953
Add nbsphinx to config
ElePT Jul 24, 2023
af620dd
Add executable attribute
ElePT Jul 24, 2023
684e4be
Fix headers
ElePT Jul 24, 2023
71e3650
Update reqs
ElePT Jul 24, 2023
0c985c5
Remove earliest version
ElePT Jul 24, 2023
268c479
Merge branch 'add-docs-1' of https://github.com/ElePT/qiskit-algorith…
ElePT Jul 24, 2023
546ee09
Update reqs
ElePT Jul 24, 2023
9892b71
Add nbsphinx config
ElePT Jul 25, 2023
9ed17ea
Remove OptimizerSupportLevel
ElePT Jul 25, 2023
8cdda77
Add index and getting started page
ElePT Jul 25, 2023
0aa2198
Merge branch 'main' into add-docs-1
woodsp-ibm Jul 25, 2023
128a0c4
Fix release note and add intersphinx mappings
woodsp-ibm Jul 25, 2023
9958d7a
Apply suggestions from code review
ElePT Jul 26, 2023
bc50a8d
Merge branch 'add-docs-1' of https://github.com/ElePT/qiskit-algorith…
ElePT Jul 26, 2023
385a5bd
Add first release note (#19)
ElePT Jul 25, 2023
e33ddfb
Remove deprecated logic from algorithms (#18)
ElePT Jul 25, 2023
6d797ba
Fix release note and add intersphinx mappings
woodsp-ibm Jul 25, 2023
8e4f83f
Add manual CSS config
ElePT Jul 26, 2023
d6f7499
Merge branch 'add-docs-1' of https://github.com/ElePT/qiskit-algorith…
ElePT Jul 26, 2023
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
28 changes: 28 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
31 changes: 31 additions & 0 deletions docs/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{#
We show all the class's methods and attributes on the same page. By default, we document
all methods, including those defined by parent classes.
-#}

{{ objname | escape | underline }}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
:no-members:
:show-inheritance:

{% block attributes_summary %}
{% if attributes %}
.. rubric:: Attributes
{% for item in attributes %}
.. autoattribute:: {{ item }}
{%- endfor %}
{% endif %}
{% endblock -%}

{% block methods_summary %}
{% set wanted_methods = (methods | reject('==', '__init__') | list) %}
{% if wanted_methods %}
.. rubric:: Methods
{% for item in wanted_methods %}
.. automethod:: {{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
28 changes: 28 additions & 0 deletions docs/_templates/autosummary/class_no_inherited_members.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{# This is identical to class.rst, except for the filtering in `set wanted_methods`. -#}

{{ objname | escape | underline }}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
:no-members:
:show-inheritance:

{% block attributes_summary %}
{% if attributes %}
.. rubric:: Attributes
{% for item in attributes %}
.. autoattribute:: {{ item }}
{%- endfor %}
{% endif %}
{% endblock -%}

{% block methods_summary %}
{% set wanted_methods = (methods | reject('in', inherited_members) | reject('==', '__init__') | list) %}
{% if wanted_methods %}
.. rubric:: Methods
{% for item in wanted_methods %}
.. automethod:: {{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
6 changes: 6 additions & 0 deletions docs/apidocs/algorithms.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _qiskit-algorithms:

.. automodule:: qiskit_algorithms
:no-members:
:no-inherited-members:
:no-special-members:
124 changes: 124 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# This code is part of Qiskit.
Comment thread
ElePT marked this conversation as resolved.
Outdated
#
# (C) Copyright IBM 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

# pylint: disable=invalid-name

"""Sphinx documentation builder."""

# -- General configuration ---------------------------------------------------
import datetime
import doctest

import os
import sys

sys.path.insert(0, os.path.abspath(".."))
sys.path.append(os.path.abspath("."))
Comment thread
ElePT marked this conversation as resolved.

project = "Qiskit Algorithms"
copyright = f"2017-{datetime.date.today().year}, Qiskit Algorithms Development Team" # pylint: disable=redefined-builtin
Comment thread
woodsp-ibm marked this conversation as resolved.
author = "Qiskit Algorithms Development Team"

# The short X.Y version
version = "0.1"
# The full version, including alpha/beta/rc tags
release = "0.1.0"

extensions = [
"sphinx.ext.napoleon",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.mathjax",
"sphinx.ext.viewcode",
"sphinx.ext.extlinks",
"sphinx.ext.intersphinx",
"sphinx.ext.doctest",
"reno.sphinxext",
"sphinx_design",
"matplotlib.sphinxext.plot_directive",
"sphinx.ext.doctest"
]
Comment thread
ElePT marked this conversation as resolved.

templates_path = ["_templates"]

# Number figures, tables and code-blocks if they have a caption.
numfig = True
# Available keys are 'figure', 'table', 'code-block' and 'section'. '%s' is the number.
numfig_format = {"table": "Table %s"}

# The language for content autogenerated by Sphinx or the default for gettext content translation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally find all of these comments noisy.

language = "en"

# Relative to source directory, affects general discovery, and html_static_path and html_extra_path.
exclude_patterns = ["_build", "**.ipynb_checkpoints"]

pygments_style = "colorful"

# Whether module names are included in crossrefs of functions, classes, etc.
add_module_names = False

# A list of prefixes that are ignored for sorting the Python module index
# (e.g., if this is set to ['foo.'], then foo.bar is shown under B, not F).
modindex_common_prefix = ["qiskit."]

intersphinx_mapping = {
"rustworkx": ("https://qiskit.org/ecosystem/rustworkx/", None),
"qiskit-ibm-runtime": ("https://qiskit.org/ecosystem/ibm-runtime/", None),
"qiskit-aer": ("https://qiskit.org/ecosystem/aer/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"matplotlib": ("https://matplotlib.org/stable/", None),
Comment thread
ElePT marked this conversation as resolved.
Outdated
}

# -- Options for HTML output -------------------------------------------------

html_theme = "qiskit_sphinx_theme"
html_last_updated_fmt = "%Y/%m/%d"
html_theme_options = {
"logo_only": True,
"display_version": True,
"prev_next_buttons_location": "bottom",
"style_external_links": True,
}
Comment thread
ElePT marked this conversation as resolved.
Outdated


# -- Options for Autosummary and Autodoc -------------------------------------

# Note that setting autodoc defaults here may not have as much of an effect as you may expect; any
# documentation created by autosummary uses a template file (in autosummary in the templates path),
# which likely overrides the autodoc defaults.

# Move type hints from signatures to the parameter descriptions (except in overload cases, where
# that's not possible).
autodoc_typehints = "description"
# Only add type hints from signature to description body if the parameter has documentation. The
# return type is always added to the description (if in the signature).
autodoc_typehints_description_target = "documented_params"

autosummary_generate = True
autosummary_generate_overwrite = False
autoclass_content = "both"


# -- Options for Doctest --------------------------------------------------------

doctest_default_flags = (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you using doctest?

@ElePT ElePT Jul 24, 2023

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ran but not used anywhere yet. I think it could be useful if we added a "getting started" page with a code example like the apps modules do.

doctest.ELLIPSIS
| doctest.NORMALIZE_WHITESPACE
| doctest.IGNORE_EXCEPTION_DETAIL
| doctest.DONT_ACCEPT_TRUE_FOR_1
)

# Leaving this string empty disables testing of doctest blocks from docstrings.
# Doctest blocks are structures like this one:
# >> code
# output
doctest_test_doctest_blocks = ""
17 changes: 17 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
################################
Qiskit Algorithms documentation
################################


Comment on lines +4 to +21

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this really ought to have something in it as otherwise one is looking more or less a blank page when things start out. An overview for example like we have in the apps.

We should also have a Getting Started too.

(Once CI is running ok with what is already here of course!)

.. toctree::
:hidden:

API References <apidocs/algorithms>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
API References <apidocs/algorithms>
About Qiskit Algorithms <self>
Getting Started <getting_started>
API References <apidocs/algorithms>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A minor comment. In the apps the reference text is 'Overview' which is also what is on the page. As Qiskit Algorithms is at the top of the sidebar there and on the page, having it yet again there in the text seems rather repetitive as hopefully the context is clear. But its easy enough to change at any point of course, at least this adds the link back to the start which was missing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a strong preference :) Others use Documentation Home for that reason. Overview works for me too.

Tutorials <tutorials/index>
Release Notes <release_notes>
GitHub <https://github.com/qiskit-community/qiskit-algorithms>

.. Hiding - Indices and tables
:ref:`genindex`
:ref:`modindex`
:ref:`search`
1 change: 1 addition & 0 deletions docs/release_notes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.. release-notes:: Release Notes
Loading