Skip to content

Commit 66912da

Browse files
committed
port docs infrastructure from quantum-prototype-template
1 parent edf0672 commit 66912da

22 files changed

+510
-2
lines changed

docs/.nojekyll

Whitespace-only changes.

docs/_static/custom.css

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
.toggle .header {
2+
display: block;
3+
clear: both;
4+
background-color: #785EF0;
5+
color: #f9f9f9;
6+
height: 40px;
7+
padding-top: 10px;
8+
padding-left: 5px;
9+
margin-bottom: 20px;
10+
}
11+
12+
.toggle .header:before {
13+
float: left;
14+
content: "▶ ";
15+
font-size: 20px;
16+
17+
}
18+
19+
.toggle .header.open:before {
20+
float: left;
21+
content: "▼ ";
22+
font-size: 20px;
23+
}
24+
25+
.toggle{
26+
background: #FBFBFB;
27+
}

docs/_static/images/logo.png

2.26 KB
Loading

docs/apidocs/index.rst

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.. qiskit_research:
2+
3+
.. module:: qiskit_research
4+
5+
=============================
6+
Template API References
7+
=============================
8+
9+
.. toctree::
10+
:maxdepth: 1
11+
12+
mzm_generation
13+
utils

docs/apidocs/mzm_generation.rst

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.. automodule:: qiskit_research.mzm_generation
2+
:no-members:
3+
:no-inherited-members:
4+
:no-special-members:

docs/apidocs/utils.rst

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.. automodule:: qiskit_research.utils
2+
:no-members:
3+
:no-inherited-members:
4+
:no-special-members:

docs/beginners_guide.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Quantum Prototype Beginner's Guide
2+
3+
This document should be a one-stop-shop for new users of the quantum prototype. It should pull together much of the other documentation into a single guide. Prototype users that go through the Beginner's Guide will be given some background on the project and software, walked through the installation process, shown the basics of the API, and given a small example problem to solve.
4+
5+
## About the Project
6+
Give a succinct statement about the project and what problems this software aims to solve. Give light mathematical/scientific justification for the solution, but save the gory details for the project overview document.
7+
8+
## Installation
9+
Provide users detailed instructions on how to install prototype dependencies and the prototype itself.
10+
11+
## Usage
12+
Give a brief but thorough overview of the basic API. What does the user *need* to know to use this software?
13+
14+
## Example Problem
15+
To help pull all the concepts together, provide a small problem and solve it using the API.
16+
17+
## Conclusion
18+
19+
This document is designed to pull together the highlights from the rest of the documentation into a single document. New users should be able to quickly spin up on the prototype software using this document alone.

docs/conf.py

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# This code is part of Qiskit.
2+
#
3+
# (C) Copyright IBM 2022.
4+
#
5+
# This code is licensed under the Apache License, Version 2.0. You may
6+
# obtain a copy of this license in the LICENSE.txt file in the root directory
7+
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8+
#
9+
# Any modifications or derivative works of this code must retain this
10+
# copyright notice, and modified files need to carry a notice indicating
11+
# that they have been altered from the originals.
12+
13+
# pylint: disable=invalid-name
14+
15+
"""
16+
Sphinx documentation builder
17+
"""
18+
19+
# General options:
20+
from pathlib import Path
21+
22+
from importlib_metadata import version as metadata_version
23+
24+
project = "Qiskit Research"
25+
copyright = "2022" # pylint: disable=redefined-builtin
26+
author = ""
27+
28+
_rootdir = Path(__file__).parent.parent
29+
30+
# The full version, including alpha/beta/rc tags
31+
release = metadata_version("qiskit_research")
32+
# The short X.Y version
33+
version = ".".join(release.split(".")[:2])
34+
35+
extensions = [
36+
"sphinx.ext.napoleon",
37+
"sphinx.ext.autodoc",
38+
"sphinx.ext.autosummary",
39+
"sphinx.ext.mathjax",
40+
"sphinx.ext.viewcode",
41+
"sphinx.ext.extlinks",
42+
"jupyter_sphinx",
43+
"sphinx_autodoc_typehints",
44+
"reno.sphinxext",
45+
"nbsphinx",
46+
]
47+
templates_path = ["_templates"]
48+
numfig = True
49+
numfig_format = {"table": "Table %s"}
50+
language = None
51+
pygments_style = "colorful"
52+
add_module_names = False
53+
modindex_common_prefix = ["template_project."]
54+
55+
# html theme options
56+
html_static_path = ["_static"]
57+
html_logo = "_static/images/logo.png"
58+
59+
# autodoc/autosummary options
60+
autosummary_generate = True
61+
autosummary_generate_overwrite = False
62+
autoclass_content = "both"
63+
64+
# nbsphinx options (for tutorials)
65+
nbsphinx_timeout = 180
66+
nbsphinx_execute = "always"
67+
nbsphinx_widgets_path = ""
68+
exclude_patterns = ["_build", "**.ipynb_checkpoints"]

docs/file-map-and-description.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
File descriptions for template
2+
==============================
3+
4+
- [.github](../.github) - folder for configuring anything related to GitHub.
5+
For example how issues and pull requests are looking like or CI processes setup (automatic tests, style checks).
6+
Currently, we have
7+
- [issue templates](../.github/ISSUE_TEMPLATE)
8+
- [pull request template](../.github/PULL_REQUEST_TEMPLATE.md)
9+
- [continuous integration (CI) workflows](../.github/workflows)
10+
- [.gitignore](../.gitignore) - git-specific file that tells which files to ignore
11+
when tracking/pushing/commiting code (those files will not be tracked by git)
12+
- [.pylintrc](../.pylintrc) - standard style checks configuration file. Content of file is
13+
self-explanatory. During automatic style checks CI processes are referring to this file
14+
to get guidelines.
15+
- [.travis.yml](../.travis.yml) - for internal repositories we use Travis - CI framework.
16+
This is similar framework to GitHub Actions which are described in [CI workflows](../.github/workflows).
17+
- [CODE_OF_CONDUCT.md](../CODE_OF_CONDUCT.md) - one of the standard recommendations for open source repositories, including those on GitHub.
18+
Name speaks for itself.
19+
- [CONTRIBUTING.md](../CONTRIBUTING.md) - one of the standard recommendations for GitHub repositories.
20+
Contributing guidelines for developers.
21+
- [LICENSE.txt](../LICENSE.txt) - one of the standard requirements for an open source project.
22+
There are different types of [licenses for software](https://en.wikipedia.org/wiki/Software_license).
23+
[Most popular open-source licenses](https://opensource.org/licenses).
24+
- [README.md](../README.md) - main readme for repository.
25+
- [docs](../docs) - documentation for repository.
26+
- [requirements.txt](../requirements.txt) - list of required 3rd party packages to run your project.
27+
- [requirements-dev.txt](../requirements-dev.txt) - list of required 3rd party packages that are
28+
NOT required to run your project, but which might benefit developers. It can include specific test
29+
libraries, style checks packages etc.
30+
- [setup.cfg](../setup.cfg) - configuration metadata for project.
31+
- [setup.py](../setup.py) - file that tells package managers how to use your project.
32+
This is the main configuration file for all Python projects.
33+
- [tests](../tests) - folder where all project tests are located.
34+
It is a good practice to cover your project with tests to ensure correctness of implementation.
35+
- [tox.ini](../tox.ini) - configuration file for [tox](https://tox.readthedocs.io/en/latest/) framework that
36+
aims to automate and standardize testing in Python.
37+
Eases the packaging, testing and release process of Python software.

docs/how_tos/example_how_to.ipynb

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"id": "55c4879d",
6+
"metadata": {},
7+
"source": [
8+
"# Quantum Prototype How-To\n",
9+
"\n",
10+
"How-to guides take the user through the steps required to solve a real-world problem.\n",
11+
"\n",
12+
"They are recipes, directions to achieve a specific end."
13+
]
14+
},
15+
{
16+
"cell_type": "markdown",
17+
"id": "bc98f5cf",
18+
"metadata": {},
19+
"source": [
20+
"## How to write good how-to guides\n",
21+
"\n",
22+
"### Provide a series of steps\n",
23+
"\n",
24+
"**How-to guides must contain a list of steps, that need to be followed in order** (just like tutorials to). You don’t have to start at the very beginning, just at a reasonable starting point. How-to guides should be reliable, but they don’t need to have the cast-iron repeatability of a tutorial.\n",
25+
"\n",
26+
"### Focus on results\n",
27+
"\n",
28+
"**How-to guides must focus on achieving a practical goal.** Anything else is a distraction. As in tutorials, detailed explanations are out of place here.\n",
29+
"\n",
30+
"### Solve a particular problem\n",
31+
"\n",
32+
"**A how-to guide must address a specific question or problem:** How do I …?\n",
33+
"\n",
34+
"This is one way in which how-to guides are distinct from tutorials: when it comes to a how-to guide, the reader can be assumed to know what they should achieve, but don’t yet know how - whereas in the tutorial, you are responsible for deciding what things the reader needs to know about.\n",
35+
"\n",
36+
"### Don’t explain concepts\n",
37+
"\n",
38+
"**A how-to guide should not explain things.** It’s not the place for discussions of that kind; they will simply get in the way of the action. If explanations are important, link to them.\n",
39+
"\n",
40+
"### Allow for some flexibility\n",
41+
"\n",
42+
"**A how-to guide should allow for slightly different ways of doing the same thing.** It needs just enough flexibility in it that the user can see how it will apply to slightly different examples from the one you describe, or understand how to adapt it to a slightly different system or configuration from the one you’re assuming. Don’t be so specific that the guide is useless for anything except the exact purpose you have in mind.\n",
43+
"\n",
44+
"### Leave things out\n",
45+
"\n",
46+
"**Practical usability is more valuable than completeness.** Tutorials need to be complete, end-to-end guides; how-to guides do not. They can start and end where it seems appropriate to you. They don’t need to mention everything that there is to mention either, just because it is related to the topic. A bloated how-to guide doesn’t help the user get speedily to their solution.\n",
47+
"\n",
48+
"### Name guides well\n",
49+
"\n",
50+
"**The title of a how-to document should tell the user exactly what it does.** How to create a class-based view is a good title. Creating a class-based view or worse, Class-based views, are not."
51+
]
52+
}
53+
],
54+
"metadata": {
55+
"kernelspec": {
56+
"display_name": "Python 3",
57+
"language": "python",
58+
"name": "python3"
59+
},
60+
"language_info": {
61+
"codemirror_mode": {
62+
"name": "ipython",
63+
"version": 3
64+
},
65+
"file_extension": ".py",
66+
"mimetype": "text/x-python",
67+
"name": "python",
68+
"nbconvert_exporter": "python",
69+
"pygments_lexer": "ipython3",
70+
"version": "3.8.10"
71+
}
72+
},
73+
"nbformat": 4,
74+
"nbformat_minor": 5
75+
}

docs/how_tos/index.rst

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.. nbgallery::
2+
:glob:
3+
4+
*

docs/index.rst

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
##############################
2+
Template project documentation
3+
##############################
4+
5+
This template repository makes creating new quantum prototype projects much easier for our team. It reduces the overhead of implementing the "bones" of a project -- including package setup, testing, and CI/CD. The code examples in this template repository are written in accordance with pylint style checks, and the sample prototype_template module has an associated unit test module. We have also included examples of coverage testing, notebook tests, and notebook lint checks and wrapped all of these using tox automated testing software.
6+
7+
.. toctree::
8+
:maxdepth: 1
9+
10+
Majorana zero mode generation <mzm_generation/index>
11+
Tutorials <tutorials/index>
12+
User Guide <how_tos/index>
13+
API References <apidocs/index>
14+
15+
.. Hiding - Indices and tables
16+
:ref:`genindex`
17+
:ref:`modindex`
18+
:ref:`search`

docs/mzm_generation/index.rst

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.. nbgallery::
2+
:glob:
3+
4+
*

docs/project_overview.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Project Overview
2+
3+
## Background
4+
5+
Give some background on the problem and the research that inspired this software. Explain what real-world problem this software intends to solve.
6+
7+
## Solution Explanation
8+
9+
Give mathematical/scientific justification for why this software/research is useful. Provide a digested breakdown of the research behind this project.
10+

docs/quickstart_guide.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Quickstart Guide
2+
3+
The quickstart guide is similar to the beginner's guide. The key difference is that the quickstart guide assumes the user already understands what the software intends to do and generally how they would like to use it, and they just need to quickly get spun up on the API. To that end, this document won't provide any scientific background or detailed tutorials/how-tos. It will focus more on installation and usage.
4+
5+
## Installation
6+
7+
Explain to the user how to install dependencies and the quantum prototype. It is likely best to just link to the installation guide here.
8+
9+
## Usage
10+
11+
Demonstrate the API usage here. Since the user is assumed to have some background on the software capabilities, more detailed/advanced usage can be provided here than in the beginner's guide.

docs/technical_docs.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Quantum Prototype Technical Docs
2+
3+
Use this document provide or link to documentation geared toward more technical users. Something like a full API could be provided here.

0 commit comments

Comments
 (0)