Skip to content

Commit 184643b

Browse files
adding notebooks to the doc
1 parent 38b046e commit 184643b

11 files changed

+111
-42
lines changed

docs/_static/custom.css

+64-37
Original file line numberDiff line numberDiff line change
@@ -30,97 +30,124 @@ div.document {
3030

3131
/* *** fix for rtd dark *** */
3232

33+
html[data-theme="dark"] div.nboutput.container div.output_area.stderr {
34+
background: rgb(103, 23, 23);
35+
}
36+
3337
html[data-theme="dark"] .sig > .sig-name > .pre {
34-
color: white;
38+
color: white;
3539
}
3640

3741
html[data-theme="dark"] .highlight > pre > span.go {
38-
color: rgb(173, 173, 173);
42+
color: rgb(173, 173, 173);
3943
}
4044

41-
html[data-theme="dark"].writer-html5 .rst-content
42-
dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)
43-
dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) > dt {
44-
background-color: #0f0f0f;
45-
color: #959595;
46-
border-color: #2b2b2b;
45+
html[data-theme="dark"].writer-html5
46+
.rst-content
47+
dl[class]:not(.option-list):not(.field-list):not(.footnote):not(
48+
.citation
49+
):not(.glossary):not(.simple)
50+
dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(
51+
.glossary
52+
):not(.simple)
53+
> dt {
54+
background-color: #0f0f0f;
55+
color: #959595;
56+
border-color: #2b2b2b;
4757
}
4858

49-
html[data-theme="dark"].writer-html5
50-
.rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not( .glossary ):not(.simple)
51-
dl:not(.field-list) > dt {
52-
color: #c6c6c6!important;
59+
html[data-theme="dark"].writer-html5
60+
.rst-content
61+
dl[class]:not(.option-list):not(.field-list):not(.footnote):not(
62+
.glossary
63+
):not(.simple)
64+
dl:not(.field-list)
65+
> dt {
66+
color: #c6c6c6 !important;
5367
}
5468

5569
html[data-theme="dark"] .highlight > pre > span.n {
56-
color: #80cb53;
70+
color: #80cb53;
5771
}
5872

5973
html[data-theme="dark"] .highlight > pre > span.o {
60-
color: #cbcbcb;
74+
color: #cbcbcb;
6175
}
6276

6377
html[data-theme="dark"] .highlight > pre > span.nf,
6478
html[data-theme="dark"] .viewcode-block > span.nf {
65-
color: #9975ec;
79+
color: #9975ec;
6680
}
6781

6882
html[data-theme="dark"] .highlight > .copybtn {
69-
background-color: transparent;
70-
color: aliceblue;
71-
border: 1px solid aliceblue;
83+
background-color: transparent;
84+
color: aliceblue;
85+
border: 1px solid aliceblue;
7286
}
7387

7488
html[data-theme="dark"] .highlight > pre {
75-
font-size: medium;
89+
font-size: medium;
7690
}
7791

7892
.wy-nav-content {
79-
max-width: 1200px;
93+
max-width: 1200px;
8094
}
8195

82-
.class.enum > dd > dl:not(.method) .sig-name ~ *:not(:last-child):not(:nth-last-child(2)),
96+
.class.enum
97+
> dd
98+
> dl:not(.method)
99+
.sig-name
100+
~ *:not(:last-child):not(:nth-last-child(2)),
83101
.class.enum > dd > .attribute > dt > .property,
84102
.attribute .sig-name ~ * {
85-
display: none!important;
103+
display: none !important;
86104
}
87105

88-
89-
[role='contentinfo'] {
90-
float: right
106+
[role="contentinfo"] {
107+
float: right;
91108
}
92109

93-
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .py.attribute,
94-
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .py.property {
95-
display: block;
96-
margin-inline-end: 2em;
110+
html.writer-html5
111+
.rst-content
112+
dl[class]:not(.option-list):not(.field-list):not(.footnote):not(
113+
.citation
114+
):not(.glossary):not(.simple)
115+
.py.attribute,
116+
html.writer-html5
117+
.rst-content
118+
dl[class]:not(.option-list):not(.field-list):not(.footnote):not(
119+
.citation
120+
):not(.glossary):not(.simple)
121+
.py.property {
122+
display: block;
123+
margin-inline-end: 2em;
97124
}
98125

99126
.class:not(.enum) .py.attribute .sig-name::before {
100-
content: 'attribute ';
101-
font-style: italic;
102-
color: #c6c6c6;
127+
content: "attribute ";
128+
font-style: italic;
129+
color: #c6c6c6;
103130
}
104131

105132
.wy-nav-side {
106-
padding-bottom: 0;
133+
padding-bottom: 0;
107134
}
108135

109136
.class.enum > dd > .attribute,
110137
.class.enum > dd > .attribute * {
111-
margin-bottom: 5px!important;
138+
margin-bottom: 5px !important;
112139
}
113140

114141
html[data-theme="dark"] .wy-nav-content > a {
115-
color: #80cb53;
142+
color: #80cb53;
116143
}
117144

118145
html[data-theme="dark"] .wy-menu-vertical > p.caption {
119-
color: #80cb53;
146+
color: #80cb53;
120147
}
121148

122149
html[data-theme="dark"] .wy-side-nav-search {
123-
background-color: #0d0d0d;
150+
background-color: #0d0d0d;
124151
}
125152

126153
/*html[data-theme="dark"] .rst-content .admonition .admonition-title,

docs/conf.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
from __future__ import annotations
2+
3+
import os
4+
import sys
25
from typing import Literal
6+
37
import dotenv
8+
from pygments.formatters.latex import LatexFormatter
49

510
# Configuration file for the Sphinx documentation builder.
611
from sphinx.application import Sphinx
712
from sphinx.highlighting import PygmentsBridge
8-
from pygments.formatters.latex import LatexFormatter
913

1014
# -- Path setup --------------------------------------------------------------
1115

1216
# If extensions (or modules to document with autodoc) are in another directory,
1317
# add these directories to sys.path here. If the directory is relative to the
1418
# documentation root, use os.path.abspath to make it absolute, like shown here.
1519

16-
import os
17-
import sys
1820

1921
sys.path.insert(0, os.path.abspath("../"))
2022

@@ -37,6 +39,8 @@
3739
"sphinx.ext.mathjax",
3840
"sphinx_rtd_dark_mode",
3941
"sphinx_copybutton",
42+
"nbsphinx", # requires pandoc ?
43+
"nbsphinx_link",
4044
]
4145
default_dark_mode = True
4246
autodoc_typehints = "description"
@@ -183,7 +187,8 @@
183187
# html_split_index = False
184188

185189
# If true, links to the reST sources are added to the pages.
186-
# html_show_sourcelink = True
190+
html_show_sourcelink = True
191+
html_sourcelink_suffix = ""
187192

188193
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
189194
html_show_sphinx = False

docs/examples.rst

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Examples
2+
========
3+
4+
On this page, you will find a few notebooks we provide as examples for various
5+
MPQP features.
6+
7+
.. toctree::
8+
:maxdepth: 1
9+
:caption: Notebooks:
10+
11+
notebooks_link/1_Basics_of_circuit
12+
notebooks_link/2_Execution_Bell_circuit
13+
notebooks_link/3_Expectation_value_of_observables
14+
notebooks_link/4_Quantum_Fourier_Transform
15+
notebooks_link/5_Variational_Quantum_Algorithms
16+
notebooks_link/6_Pauli_string_observable

docs/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ fluently.
2323
qasm
2424
tools
2525
changelog
26+
examples
2627

2728
Α full index can be found in the :ref:`genindex` page and a map of the module
2829
can be found in the :doc:`all-modules` page.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"path": "../../examples/notebooks/1_Basics_of_circuit.ipynb"
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"path": "../../examples/notebooks/2_Execution_Bell_circuit.ipynb"
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"path": "../../examples/notebooks/1_Basics_of_circuit.ipynb"
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"path": "../../examples/notebooks/4_Quantum_Fourier_Transform.ipynb"
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"path": "../../examples/notebooks/5_Variational_Quantum_Algorithms.ipynb"
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"path": "../../examples/notebooks/6_Pauli_string_observable.ipynb"
3+
}

requirements-dev.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ pytest==7.1.1
44
sphinx<5.2
55
sphinx-rtd-dark-mode
66
sphinx-copybutton
7-
sphinx_github_changelog
7+
sphinx_github_changelog
8+
nbsphinx
9+
nbsphinx_link

0 commit comments

Comments
 (0)