diff --git a/dev_tools/docs/sphinx/.gitignore b/dev_tools/docs/sphinx/.gitignore deleted file mode 100644 index b7a6b022..00000000 --- a/dev_tools/docs/sphinx/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -tutorials/ -qaoa/*.ipynb -qaoa/images - -_static/g3618.png -_static/recirq_logo_notext.png -best_practices.md -data_collection_idioms.md diff --git a/dev_tools/docs/sphinx/Makefile b/dev_tools/docs/sphinx/Makefile deleted file mode 100644 index f5b10968..00000000 --- a/dev_tools/docs/sphinx/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line, and also -# from the environment for the first two. -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 clean Makefile - -clean: - rm -rf "$(BUILDDIR)" - -# 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) diff --git a/dev_tools/docs/sphinx/_static/custom.css b/dev_tools/docs/sphinx/_static/custom.css deleted file mode 100644 index 62aa155b..00000000 --- a/dev_tools/docs/sphinx/_static/custom.css +++ /dev/null @@ -1,19 +0,0 @@ -div.output_area img { - /* Prevent circuits from being scaled down; - instead, it will use a scroll bar */ - max-width: none; -} - -/* Make alabaster theme breathe a bit: */ -div.body { - max-width: 1000px; -} -div.document { - width: 1220px; -} - -/* nbsphinx strips the HTML from these cells - so they look bad */ -.tfo-notebook-buttons { - display: none; -} \ No newline at end of file diff --git a/dev_tools/docs/sphinx/appengine/.gcloudignore b/dev_tools/docs/sphinx/appengine/.gcloudignore deleted file mode 100644 index 82b25373..00000000 --- a/dev_tools/docs/sphinx/appengine/.gcloudignore +++ /dev/null @@ -1,8 +0,0 @@ -.gcloudignore -.git -.gitignore - -# Python pycache: -__pycache__/ -# Ignored by the build system -/setup.cfg \ No newline at end of file diff --git a/dev_tools/docs/sphinx/appengine/app.yaml b/dev_tools/docs/sphinx/appengine/app.yaml deleted file mode 100644 index 7cfb344d..00000000 --- a/dev_tools/docs/sphinx/appengine/app.yaml +++ /dev/null @@ -1,6 +0,0 @@ -runtime: python37 -handlers: - - url: /recirq/(.*) - static_files: built-docs/\1 - upload: built-docs/(.*) - secure: always \ No newline at end of file diff --git a/dev_tools/docs/sphinx/appengine/built-docs b/dev_tools/docs/sphinx/appengine/built-docs deleted file mode 120000 index b2f7649f..00000000 --- a/dev_tools/docs/sphinx/appengine/built-docs +++ /dev/null @@ -1 +0,0 @@ -../_build/html/ \ No newline at end of file diff --git a/dev_tools/docs/sphinx/appengine/main.py b/dev_tools/docs/sphinx/appengine/main.py deleted file mode 100644 index 4d5cd89d..00000000 --- a/dev_tools/docs/sphinx/appengine/main.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# [START gae_python37_app] -from flask import Flask - - -# If `entrypoint` is not defined in app.yaml, App Engine will look for an app -# called `app` in `main.py`. -app = Flask(__name__) - - -@app.route('/') -def hello(): - """Return a friendly HTTP greeting.""" - return 'Hello World!' - - -if __name__ == '__main__': - # This is used when running locally only. When deploying to Google App - # Engine, a webserver process such as Gunicorn will serve the app. This - # can be configured by adding an `entrypoint` to app.yaml. - app.run(host='127.0.0.1', port=8080, debug=True) -# [END gae_python37_app] \ No newline at end of file diff --git a/dev_tools/docs/sphinx/appengine/requirements.txt b/dev_tools/docs/sphinx/appengine/requirements.txt deleted file mode 100644 index 7883f5be..00000000 --- a/dev_tools/docs/sphinx/appengine/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -Flask==2.3.2 \ No newline at end of file diff --git a/dev_tools/docs/sphinx/conf.py b/dev_tools/docs/sphinx/conf.py deleted file mode 100644 index 5ce23171..00000000 --- a/dev_tools/docs/sphinx/conf.py +++ /dev/null @@ -1,181 +0,0 @@ -# Copyright 2020 Google -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import os -import re -import shutil -import subprocess - -project = 'ReCirq' -copyright = '2020, Google Quantum' -author = 'Google Quantum' - -extensions = [ - 'nbsphinx', - 'sphinx.ext.mathjax', - 'sphinx.ext.autodoc', - 'sphinx.ext.autosummary', - 'sphinx.ext.napoleon', - 'recommonmark', -] - -nbsphinx_allow_errors = False -nbsphinx_timeout = -1 # no timeout -autosummary_generate = True - -# Certain notebooks are saved pre-executed. Keeping this environment variable -# as "auto" prevents re-executing (which takes time!). The CI will -# not re-execute these notebooks. -# Set this to "always" to execute all notebooks. -# https://github.com/quantumlib/ReCirq/issues/15 -nbsphinx_execute = os.environ.get( - 'NBSPHINX_EXECUTE_NOTEBOOKS', 'auto') # can also be "always" or "never". - -napoleon_google_docstring = True -napoleon_numpy_docstring = False - -add_module_names = False - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', - '**.ipynb_checkpoints', 'appengine'] - -# -- Options for HTML output ------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -# -html_theme = 'alabaster' - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] - -html_css_files = [ - 'custom.css', -] - -html_favicon = 'favicon.ico' -html_logo = '_static/recirq_logo_notext.png' - - -def _rmtree_if_exists(dirname): - if os.path.exists(dirname): - shutil.rmtree(dirname) - - -def env_before_read_docs(app, env, docnames): - """Re-order `docnames` to respect the execution-order dependency - of notebooks. - - Dependencies: - Readout-Data-Collection <-- Readout-Analysis - qaoa/Tasks-Tutorial <-+-- qaoa/Precomputed-Analysis - +-- qaoa/Landscape-Analysis - - Data: - Readout-Data-Collection saves - cirq-results/readout-scan/2020-02-tutorial - - qaoa/Tasks-Tutorial saves - cirq-results/qaoa-problems/2020-03-tutorial - cirq-results/qaoa-precomputation/2020-03-tutorial - cirq-results/qaoa-precomputed/2020-03-tutorial - cirq-results/qaoa-p1-landscape/2020-03-tutorial - - """ - print("The following documents will be built:") - print(docnames) - - def _order(docname): - if docname == 'tutorials/data_collection': - # must come before others - return -1 - - if docname == 'qaoa/tasks': - # must come before others - return -1 - return 0 - - docnames.sort(key=_order) - - print("Since there are dependencies between them, they will be built in this order:") - print(docnames) - - if ('tutorials/data_collection' in docnames - and 'tutorials/data_analysis' not in docnames): - print("Since tutorials/data_collection has changed, " - "also re-running tutorials/data_analysis") - docnames.append('tutorials/data_analysis') - - if 'qaoa/tasks' in docnames: - if 'qaoa/precomputed_analysis' not in docnames: - # Mark the analysis notebook as changed - docnames.append('qaoa/precomputed_analysis') - if 'qaoa/landscape_analysis' not in docnames: - # Mark the analysis notebook as changed - docnames.append('qaoa/landscape_analysis') - - print(docnames) - - if 'tutorials/data_collection' in docnames: - print("Since tutorials/data_collection has changed, " - "deleting existing tutorial data.") - from recirq.readout_scan import tasks as rs_tasks - _rmtree_if_exists(f'{rs_tasks.DEFAULT_BASE_DIR}/2020-02-tutorial') - - if 'qaoa/tasks' in docnames and nbsphinx_execute == 'always': - # Clear data that's already been collected, but only if we're actually - # executing this notebook. This notebook is saved pre-executed, so - # set environment variable NBSPHINX_EXECUTE_NOTEBOOKS to 'auto' to - # prevent deleting the data and running from scratch (which can take - # a long time). - from recirq.qaoa.experiments import precomputed_execution_tasks as qaoa_pre_tasks - _rmtree_if_exists(f'{qaoa_pre_tasks.DEFAULT_PROBLEM_GENERATION_BASE_DIR}/2020-03-tutorial') - _rmtree_if_exists(f'{qaoa_pre_tasks.DEFAULT_PRECOMPUTATION_BASE_DIR}/2020-03-tutorial') - _rmtree_if_exists(f'{qaoa_pre_tasks.DEFAULT_BASE_DIR}/2020-03-tutorial') - - from recirq.qaoa.experiments import p1_landscape_tasks as qaoa_p1_tasks - _rmtree_if_exists(f'{qaoa_p1_tasks.DEFAULT_BASE_DIR}/2020-03-tutorial') - - - -REPO_DIR = subprocess.Popen(['git', 'rev-parse', '--show-toplevel'], - stdout=subprocess.PIPE).communicate()[0].rstrip().decode('utf-8') - - -def source_read(app, docname, source): - source[0] = re.sub(r'"##### (Copyright 20\d\d Google)"', r'"**\1**"', source[0]) - - -def setup(app): - FROM = f'{REPO_DIR}/docs' - TO = f'{REPO_DIR}/dev_tools/docs/sphinx' - shutil.copy(f'{FROM}/images/g3618.png', f'{TO}/_static/') - shutil.copy(f'{FROM}/images/recirq_logo_notext.png', f'{TO}/_static/') - - shutil.copy(f'{FROM}/data_collection_idioms.md', f'{TO}/') - shutil.copy(f'{FROM}/best_practices.md', f'{TO}/') - - from distutils.dir_util import copy_tree # allows overwriting - copy_tree(f'{FROM}/tutorials', f'{TO}/tutorials') - copy_tree(f'{FROM}/qaoa', f'{TO}/qaoa') - - app.connect('env-before-read-docs', env_before_read_docs) - app.connect('source-read', source_read) diff --git a/dev_tools/docs/sphinx/favicon.ico b/dev_tools/docs/sphinx/favicon.ico deleted file mode 100644 index 1c522795..00000000 Binary files a/dev_tools/docs/sphinx/favicon.ico and /dev/null differ diff --git a/dev_tools/docs/sphinx/index.rst b/dev_tools/docs/sphinx/index.rst deleted file mode 100644 index 17a01b32..00000000 --- a/dev_tools/docs/sphinx/index.rst +++ /dev/null @@ -1,53 +0,0 @@ -ReCirq -====== - -.. raw:: html - -
-
-.. toctree::
- :maxdepth: 1
- :hidden:
-
- data_collection_idioms
- tutorials/data_collection
- tutorials/data_analysis
- best_practices
-
-.. toctree::
- :maxdepth: 1
- :caption: Readout Scan
- :hidden:
-
- readout_scan_tasks
-
-.. toctree::
- :maxdepth: 1
- :caption: QAOA
- :hidden:
-
- qaoa/example_problems
- qaoa/tasks
- qaoa/precomputed_analysis
- qaoa/landscape_analysis
- qaoa/optimization_analysis
- qaoa/hardware_grid_circuits
- qaoa/problem_generation_tasks
- qaoa/angle_precomputation_tasks
- qaoa/routing_with_tket
diff --git a/dev_tools/docs/sphinx/qaoa/angle_precomputation_tasks.rst b/dev_tools/docs/sphinx/qaoa/angle_precomputation_tasks.rst
deleted file mode 100644
index 8b951a48..00000000
--- a/dev_tools/docs/sphinx/qaoa/angle_precomputation_tasks.rst
+++ /dev/null
@@ -1,18 +0,0 @@
-Angle Precomputation
-====================
-
-.. currentmodule:: recirq.qaoa.experiments.angle_precomputation_tasks
-
-Tasks
------
-.. autoclass:: AnglePrecomputationTask
-
-.. rubric:: Task execution functions
-.. autofunction:: precompute_angles
-
-Library Functions
------------------
-.. currentmodule:: recirq.qaoa.classical_angle_optimization
-.. autofunction:: optimize_instance_interp_heuristic
-.. autoclass:: OptimizationResult
-
diff --git a/dev_tools/docs/sphinx/qaoa/problem_generation_tasks.rst b/dev_tools/docs/sphinx/qaoa/problem_generation_tasks.rst
deleted file mode 100644
index b1ab4474..00000000
--- a/dev_tools/docs/sphinx/qaoa/problem_generation_tasks.rst
+++ /dev/null
@@ -1,14 +0,0 @@
-Problem Generation Tasks
-========================
-
-.. currentmodule:: recirq.qaoa.experiments.problem_generation_tasks
-
-.. autoclass:: HardwareGridProblemGenerationTask
-.. autoclass:: SKProblemGenerationTask
-.. autoclass:: ThreeRegularProblemGenerationTask
-
-.. rubric:: Functions
-.. autofunction:: generate_hardware_grid_problem
-.. autofunction:: generate_sk_problem
-.. autofunction:: generate_3_regular_problem
-
diff --git a/dev_tools/docs/sphinx/readout_scan_tasks.rst b/dev_tools/docs/sphinx/readout_scan_tasks.rst
deleted file mode 100644
index 8798283c..00000000
--- a/dev_tools/docs/sphinx/readout_scan_tasks.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-Readout Scan Tasks
-==================
-
-.. currentmodule:: recirq.readout_scan.tasks
-
-.. autoclass:: ReadoutScanTask
-
-.. rubric:: Functions
-.. autofunction:: run_readout_scan