Skip to content

Commit

Permalink
read the docs started!
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisRalli committed Aug 25, 2023
1 parent de41bf3 commit 4a85d4b
Show file tree
Hide file tree
Showing 22 changed files with 6,996 additions and 5 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file added docs/.DS_Store
Binary file not shown.
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 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 = source
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)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
Binary file added docs/source/.DS_Store
Binary file not shown.
Binary file added docs/source/_static/symmer_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 79 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

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


# -- Project information -----------------------------------------------------

project = 'Symmer'
copyright = '2023, Alexis Ralli, Tim Weaving'
author = 'Alexis Ralli, Tim Weaving'


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.intersphinx',
'sphinx.ext.extlinks',
'sphinx.ext.napoleon',
'sphinx.ext.linkcode',
'myst_nb',
"sphinx_design",
'sphinx_copybutton'
# 'autoapi.extension',
]

# msyt_nb configuration
nb_execution_mode = "off"
myst_heading_anchors = 4
myst_enable_extensions = [
"amsmath",
"colon_fence",
"deflist",
"dollarmath",
"html_image",
]

# 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 = []


# -- 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']

def linkcode_resolve(domain, info):
if domain != 'py':
return None
if not info['module']:
return None
filename = info['module'].replace('.', '/')
return "https://somesite/sourcerepo/%s.py" % filename
88 changes: 88 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
.. Symmer documentation master file, created by
sphinx-quickstart on Wed Aug 23 14:45:04 2023.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
.. image:: ./_static/symmer_logo.png
:width: 800px
Welcome to Symmer's documentation!
==================================
.. image:: https://github.com/UCL-CCS/symmer/actions/workflows/pull_request.yaml/badge.svg
:target: https://github.com/UCL-CCS/symmer/actions/workflows/pull_request.yaml
:alt: Continuous_Integration
.. image:: https://codecov.io/gh/UCL-CCS/symmer/branch/main/graph/badge.svg?token=PZzJNZuEEW
:target: https://codecov.io/gh/UCL-CCS/symmer
:alt: codecov
.. image:: https://img.shields.io/badge/Supported%20By-UNITARY%20FUND-brightgreen.svg?style=for-the-badge
:target: http://unitary.fund
:alt: Unitary Fund

`symmer <https://github.com/UCL-CCS/symmer>`_ is an easy and **fast** python library
for manipulations of *'Pauli operators and Quantum States'*. One of the primary
goals of the library is to reduce the qubit requirements of a quantum simulation problem
by tapering and/or mapping the problem into a contextual subspace. The most useful classes of
library, that form a base for all operations, are:

.. grid:: 2

.. grid-item-card:: PauliwordOp
:img-bottom: _images/noncontextual-graph.png

The :mod:`PauliwordOp` class contains tools for working with
**Pauli operators**. It has a particular focus on:

* fast operations (multiplication, addition, subtraction)
* fast expectation value determination
* output to various other backends:
`openfermion <https://github.com/quantumlib/OpenFermion>`_ and
`qiskit <https://github.com/Qiskit/qiskit>`_
* Find commutation relations between Pauli operators in an efficient manor.

.. grid-item-card:: QuantumState

The :mod:`QuantumState` class contains tools for working with
**'quantum states'**. With this you can:

* resample a state :math:`10^{15}` times in nanoseconds (useful for bootstrapping)
* evaluate expectation values with a :mod:`PauliwordOp` in linear time
* compute various quantities including entanglement measures
* Implement partial traces
* Plot quantum state
* Make examining real NISQ data more streamlined


User Guide
----------

The following guides give a basic introduction to the various parts:

.. toctree::
:maxdepth: 1

installation



.. _examples:


Examples
--------

The following guides, generated from the notebooks in `notebooks <https://github.com/UCL-CCS/symmer/tree/main/notebooks>`_,
provide a beginners guide and demonstrate some more advanced features or complete usage:

.. toctree::
:numbered:
:maxdepth: 2

./notebooks/1_Basic_Usage/1.1 PauliwordOp Usage.ipynb
./notebooks/1_Basic_Usage/1.2 QuantumState Usage.ipynb
./notebooks/1_Basic_Usage/1.3 Importing Hamiltonian Data.ipynb
./notebooks/1_Basic_Usage/1.4 QubitSubspaceManager Usage.ipynb

.. toctree::
:numbered:
:maxdepth: 2
./notebooks/2_Applications

18 changes: 18 additions & 0 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
============
Installation
============

Note `symmer <https://github.com/UCL-CCS/symmer>`_ is a pure python package and can now be found on `PyPI <https://pypi.org/project/symmer/>`_.
To install run the following:

.. code-block:: bash
pip install symmer
The code is hosted on `github <https://github.com/UCL-CCS/symmer>`_. A development version can be installed from source
by running:

.. code-block:: bash
git clone https://github.com/UCL-CCS/symmer.git
pip install .
Binary file added docs/source/notebooks/.DS_Store
Binary file not shown.
Loading

0 comments on commit 4a85d4b

Please sign in to comment.