Skip to content

Commit a86a835

Browse files
committed
better docs
1 parent 07c2cdd commit a86a835

File tree

8 files changed

+47
-17
lines changed

8 files changed

+47
-17
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
![snake equation](docs/_static/snake-equation.png)
2+
![snake equation](https://github.com/discopy/discopy/blob/main/docs/_static/snake-equation.png)
33

44
# DisCoPy
55

@@ -35,7 +35,7 @@ DisCoPy began as an implementation of [DisCoCat](https://en.wikipedia.org/wiki/D
3535

3636
Software dependencies between modules go top-to-bottom, left-to-right and [forgetful functors](https://en.wikipedia.org/wiki/Forgetful_functor) between categories go the other way.
3737

38-
[![architecture](docs/api/architecture.png)](https://docs.discopy.org#architecture)
38+
[![architecture](https://github.com/discopy/discopy/blob/main/docs/api/architecture.png)](https://docs.discopy.org#architecture)
3939

4040
## Install
4141

discopy/quantum/__init__.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
DisCoPy quantum modules: channel, circuit, gates, tk and zx.
55
"""
66

7-
from discopy.quantum import (
8-
circuit, gates, channel, ansatze, zx)
7+
from discopy.quantum import circuit, gates, channel, ansatze, zx
98

109
from discopy.quantum.channel import C, Q, CQ, Channel
1110

discopy/quantum/pennylane.py

+29-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,31 @@
33
"""
44
Interface with PennyLane.
55
6+
Summary
7+
-------
8+
9+
.. autosummary::
10+
:template: class.rst
11+
:nosignatures:
12+
:toctree:
13+
14+
PennyLaneCircuit
15+
16+
.. admonition:: Functions
17+
18+
.. autosummary::
19+
:template: function.rst
20+
:nosignatures:
21+
:toctree:
22+
23+
tk_op_to_pennylane
24+
extract_ops_from_tk
25+
get_post_selection_dict
26+
to_pennylane
27+
28+
Notes
29+
-----
30+
631
If `probabilities` is set to False, the output states of the PennyLane
732
circuit will be exactly equivalent to those of the DisCoPy circuit
833
(for the same parameters).
@@ -22,15 +47,17 @@
2247
"""
2348

2449

25-
from discopy.quantum import Circuit
26-
from discopy.quantum.gates import Scalar
2750
from itertools import product
51+
2852
import numpy as np
2953
import pennylane as qml
3054
from pytket import OpType
3155
import sympy
3256
import torch
3357

58+
from discopy.quantum import Circuit
59+
from discopy.quantum.gates import Scalar
60+
3461

3562
OP_MAP = {
3663
OpType.X: qml.PauliX,

discopy/quantum/tk.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
from unittest.mock import Mock
2828

2929
import pytket as tk
30-
from pytket.circuit import (Bit, Op, OpType,
31-
Qubit) # pylint: disable=no-name-in-module
30+
from pytket.circuit import Bit, Op, OpType, Qubit
3231
from pytket.utils import probs_from_counts
3332

3433
from discopy import messages

discopy/rigid.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
3535
>>> from discopy.drawing import Equation
3636
>>> Equation(left_snake, Id(n), right_snake).draw(
37-
... figsize=(4, 2), path='docs/_static/rigid/snake-equation.png')
37+
... figsize=(4, 2), path='docs/_static/rigid/typed-snake-equation.png')
3838
39-
.. image:: /_static/rigid/snake-equation.png
39+
.. image:: /_static/rigid/typed-snake-equation.png
4040
:align: center
4141
"""
4242

docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def get_version():
5252

5353
autosummary_generate = True
5454

55-
autodoc_mock_imports = ["pytket", "pennylane", "torch"]
55+
autodoc_mock_imports = ["pytket", "pennylane", "torch", "sympy"]
5656

5757
autodoc_typehints = "description"
5858
autodoc_typehints_format = "short"

setup.py

+11-6
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,20 @@ def get_reqs(filename):
3333
version=VERSION,
3434
package_dir={'discopy': 'discopy'},
3535
packages=find_packages(),
36-
description='Distributional Compositional Python',
36+
description='The Python toolkit for computing with string diagrams.',
3737
long_description=open("README.md", "r").read(),
3838
long_description_content_type="text/markdown",
39-
url='https://github.com/discopy/discopy',
39+
url='https://discopy.org',
40+
project_urls={
41+
'Documentation': 'https://docs.discopy.org',
42+
'Source': 'https://github.com/discopy/discopy',
43+
'Tracker': 'https://github.com/discopy/discopy/issues',
44+
},
45+
keywords='diagrams category-theory quantum-computing nlp',
4046
author='Alexis Toumi',
41-
author_email='alexis.toumi@cs.ox.ac.uk',
42-
download_url='https://github.com/'
43-
'discopy/discopy/archive/'
44-
'{}.tar.gz'.format(VERSION),
47+
author_email='alexis@toumi.email',
48+
download_url='https://github.com/discopy/discopy/archive/'
49+
f'{VERSION}.tar.gz',
4550
install_requires=[
4651
l.strip() for l in open('requirements.txt').readlines()],
4752
tests_require=TEST_REQS,

0 commit comments

Comments
 (0)