From a44bdbe11dbd9e2a10ab5d4233f84c8904e0c1c1 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 12 Nov 2020 14:35:31 +0000 Subject: [PATCH] Use sphinx-panels for accordion content (#5354) (#5390) * move to new qiskit theme * Move to sphinx-panels for accordian content * add transpiler part * bump theme version (cherry picked from commit 42531aaea4a152942797bd5054b4887a5d4b70b9) Co-authored-by: Paul Nation --- docs/_static/style.css | 12 ------------ docs/conf.py | 7 +++---- qiskit/circuit/__init__.py | 7 ++----- qiskit/transpiler/__init__.py | 28 ++++++++-------------------- requirements-dev.txt | 3 ++- 5 files changed, 15 insertions(+), 42 deletions(-) delete mode 100644 docs/_static/style.css diff --git a/docs/_static/style.css b/docs/_static/style.css deleted file mode 100644 index 84980a3a4a60..000000000000 --- a/docs/_static/style.css +++ /dev/null @@ -1,12 +0,0 @@ -.wy-nav-content { - max-width: 90% !important; -} - -.wy-side-scroll { - background:#8c8c8c; -} - -.pre -{ -color:#BE8184; -} diff --git a/docs/conf.py b/docs/conf.py index 7c841246becc..a7a76bae3449 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -65,10 +65,11 @@ 'jupyter_sphinx', 'sphinx_autodoc_typehints', 'reno.sphinxext', + 'sphinx_panels', ] html_static_path = ['_static'] templates_path = ['_templates'] -html_css_files = ['style.css', 'custom.css'] +html_css_files = [] # ----------------------------------------------------------------------------- # Autosummary @@ -130,9 +131,8 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'sphinx_rtd_theme' # use the theme in subdir 'theme' +html_theme = 'qiskit_sphinx_theme' # use the theme in subdir 'theme' -html_logo = 'images/logo.png' #html_sidebars = {'**': ['globaltoc.html']} html_last_updated_fmt = '%Y/%m/%d' @@ -141,7 +141,6 @@ 'display_version': True, 'prev_next_buttons_location': 'bottom', 'style_external_links': True, - 'style_nav_header_background': '#212121', } autoclass_content = 'both' diff --git a/qiskit/circuit/__init__.py b/qiskit/circuit/__init__.py index a55c4eca4bc3..f150f1458f67 100644 --- a/qiskit/circuit/__init__.py +++ b/qiskit/circuit/__init__.py @@ -56,11 +56,8 @@ Supplementary Information ========================= -.. container:: toggle - - .. container:: header - - **Quantum Circuit Properties** +.. dropdown:: Quantum Circuit Properties + :animate: fade-in-slide-down When constructing quantum circuits, there are several properties that help quantify the "size" of the circuits, and their ability to be run on a noisy quantum device. diff --git a/qiskit/transpiler/__init__.py b/qiskit/transpiler/__init__.py index abded4d459dd..ac6b7b34432e 100644 --- a/qiskit/transpiler/__init__.py +++ b/qiskit/transpiler/__init__.py @@ -46,11 +46,8 @@ Supplementary Information ========================= -.. container:: toggle - - .. container:: header - - **Basis Gates** +.. dropdown:: Basis gates + :animate: fade-in-slide-down When writing a quantum circuit you are free to use any quantum gate (unitary operator) that you like, along with a collection of non-gate operations such as qubit measurements and @@ -152,11 +149,8 @@
-.. container:: toggle - - .. container:: header - - **Initial Layout** +.. dropdown:: Initial layout + :animate: fade-in-slide-down Quantum circuits are abstract entities whose qubits are "virtual" representations of actual qubits used in computations. We need to be able to map these virtual qubits in a one-to-one @@ -247,11 +241,8 @@
-.. container:: toggle - - .. container:: header - - **Mapping Circuits to Hardware Topology** +.. dropdown:: Mapping circuits to hardware topology + :animate: fade-in-slide-down In order to implement a CNOT gate between qubits in a quantum circuit that are not directly connected on a quantum device one or more SWAP gates must be inserted into the circuit to @@ -317,11 +308,8 @@
-.. container:: toggle - - .. container:: header - - **Gate Optimization** +.. dropdown:: Gate optimization + :animate: fade-in-slide-down Decomposing quantum circuits into the basis gate set of the IBM Quantum devices, and the addition of SWAP gates needed to match hardware topology, conspire to diff --git a/requirements-dev.txt b/requirements-dev.txt index e6f7791e4359..2c6b8318f2f3 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -17,8 +17,9 @@ ddt>=1.2.0,!=1.4.0 seaborn>=0.9.0 reno>=3.2.0 Sphinx>=1.8.3,<3.1.0 -sphinx-rtd-theme>=0.4.0 +qiskit-sphinx-theme>=1.6 sphinx-autodoc-typehints jupyter-sphinx +sphinx-panels pygments>=2.4 tweedledum