Skip to content

Commit 7f2fb4f

Browse files
authored
Merge pull request #1400 from JoelPasvolsky/unifieddocs
Restructure and update references for unified documentation
2 parents 2e187a4 + 455f1d1 commit 7f2fb4f

41 files changed

Lines changed: 566 additions & 2187 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,6 @@ jobs:
231231
command: |
232232
. env/bin/activate
233233
make -C docs/ linkcheck
234-
- run:
235-
# If we add more notebooks in the future we can make this more general.
236-
# We avoid a (slow) dimod install by playing around with the path.
237-
name: test scaling guide
238-
command: |
239-
. env/bin/activate
240-
PYTHONPATH=$(pwd):$PYTHONPATH jupyter nbconvert --to notebook --execute docs/intro/intro_scaling.ipynb
241234
242235
test-linux:
243236
parameters:

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,11 @@ instance/
6363

6464
# Sphinx documentation
6565
docs/build/
66+
docs/_build/
6667
docs/build-cpp/
67-
docs/reference/generated/
68+
docs/generated/
6869
docs/intro/generated/
69-
docs/reference/*/generated/
70+
docs/*/generated/
7071

7172
# PyBuilder
7273
target/

README.rst

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,20 @@
1010
.. image:: https://codecov.io/gh/dwavesystems/dimod/branch/main/graph/badge.svg
1111
:target: https://codecov.io/gh/dwavesystems/dimod
1212

13+
=====
1314
dimod
1415
=====
1516

16-
.. index-start-marker1
17+
.. start_dimod_about
1718
1819
`dimod` is a shared API for samplers. It provides:
1920

20-
* classes for quadratic models---such as the binary quadratic model (BQM) class that
21-
contains Ising and QUBO models used by samplers such as the D-Wave system---and
22-
higher-order (non-quadratic) models.
23-
* reference examples of samplers and composed samplers.
24-
* `abstract base classes <https://docs.python.org/3/library/abc.html>`_ for
25-
constructing new samplers and composed samplers.
26-
27-
.. index-end-marker1
28-
29-
(For explanations of the terminology, see the
30-
`Ocean glossary <https://docs.ocean.dwavesys.com/en/stable/concepts/index.html>`_.)
31-
32-
Example Usage
33-
-------------
34-
35-
.. index-start-marker2
21+
* Classes for quadratic models---such as the binary quadratic model (BQM)
22+
class that contains Ising and QUBO models used by samplers such as the
23+
D-Wave quantum computer---and higher-order (non-quadratic) models.
24+
* Reference examples of samplers and composed samplers.
25+
* `Abstract base classes <https://docs.python.org/3/library/abc.html>`_ for
26+
constructing new samplers and composed samplers.
3627

3728
>>> import dimod
3829
...
@@ -49,40 +40,40 @@ Example Usage
4940
2 1 1 2.0 1
5041
['BINARY', 4 rows, 4 samples, 2 variables]
5142

52-
.. index-end-marker2
43+
.. end_dimod_about
44+
45+
For explanations of the terminology, see the
46+
`Ocean glossary <https://docs.dwavequantum.com/en/latest/concepts/index.html>`_.
5347

54-
See the `documentation <https://docs.ocean.dwavesys.com/en/stable/docs_dimod/>`_
48+
See the `documentation <https://docs.dwavequantum.com/en/latest/index.html>`_
5549
for more examples.
5650

5751
Installation
58-
------------
59-
60-
.. installation-start-marker
52+
============
6153

6254
Installation from `PyPI <https://pypi.org/project/dimod>`_:
6355

6456
.. code-block:: bash
6557
6658
pip install dimod
6759
68-
.. installation-end-marker
69-
7060
License
71-
-------
61+
=======
7262

7363
Released under the Apache License 2.0. See LICENSE file.
7464

7565
Contributing
76-
------------
66+
============
7767

78-
Ocean's `contributing guide <https://docs.ocean.dwavesys.com/en/stable/contributing.html>`_
79-
has guidelines for contributing to Ocean packages.
68+
Ocean's
69+
`contributing <https://docs.dwavequantum.com/en/latest/ocean/contribute.html>`_
70+
section has guidelines for contributing to Ocean packages.
8071

8172
dimod includes some formatting customization in the
8273
`.clang-format <.clang-format>`_ and `setup.cfg <setup.cfg>`_ files.
8374

8475
Release Notes
85-
~~~~~~~~~~~~~
76+
-------------
8677

8778
dimod makes use of `reno <https://docs.openstack.org/reno/>`_ to manage its
8879
release notes.
@@ -98,5 +89,6 @@ You can then edit the file created under ``releasenotes/notes/``.
9889
Remove any sections not relevant to your changes.
9990
Commit the file along with your changes.
10091

101-
See reno's `user guide <https://docs.openstack.org/reno/latest/user/usage.html>`_
102-
for details.
92+
See reno's
93+
`user guide <https://docs.openstack.org/reno/latest/user/usage.html>`_ for
94+
details.

dimod/binary/binary_quadratic_model.py

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -577,8 +577,8 @@ def spin(self) -> 'BinaryQuadraticModel':
577577
This example exploits the simplicity of the Ising representation of
578578
a Boolean NOT gate, :math:`s_1s_2`, relative to its QUBO counterpart,
579579
:math:`2x_1x_2−x_1−x_2+1`, to change a QUBO representation of an AND
580-
gate, derived in the :std:doc:`Ocean documentation's <oceandocs:index>`
581-
:ref:`AND example <oceandocs:and>`, to represent a NAND gate.
580+
gate, derived in the :ref:`AND example <qpu_example_and>`, to
581+
represent a NAND gate.
582582
583583
>>> Q = [[0, 1, -2], [0, 0, -2], [0, 0, 3]]
584584
>>> x = dimod.BinaryArray(["in1", "in2", "out_and"])
@@ -1135,7 +1135,7 @@ def maximum_energy_delta(self) -> Bias:
11351135
result from flipping a single variable in a binary quadratic model.
11361136
11371137
The bound is useful as a starting point for determining the values of
1138-
`penalty parameters`_ in a `penalty model`_.
1138+
`penalty parameters`_ in a :ref:`penalty model <concept_penalty>`.
11391139
11401140
Returns:
11411141
Bound on change in energy.
@@ -1147,8 +1147,6 @@ def maximum_energy_delta(self) -> Bias:
11471147
5.5
11481148
11491149
.. _`penalty parameters`: https://en.wikipedia.org/wiki/Penalty_method
1150-
.. _`penalty model`: https://docs.ocean.dwavesys.com/en/stable/concepts/index.html#term-Penalty-model
1151-
11521150
"""
11531151
if not self.num_variables:
11541152
return 0
@@ -2656,11 +2654,11 @@ def Binaries(labels: Union[int, Iterable[Variable]],
26562654
26572655
Examples:
26582656
This example generates a BQM that represents a Boolean NOT gate as a
2659-
penalty model, :math:`2xy - x - y`, described in
2660-
:std:doc:`Ocean documentation's <oceandocs:index>`
2661-
:ref:`NOT example <oceandocs:not>`. The output of the brute-force solver,
2662-
:class:`~dimod.reference.samplers.ExactSolver`, shows that best
2663-
solutions are for assignments of the variables where :math:`z = \overline{x}`.
2657+
penalty model, :math:`2xy - x - y`, described in the
2658+
:ref:`NOT example <qpu_example_not>` section. The output of the
2659+
brute-force solver, :class:`~dimod.reference.samplers.ExactSolver`,
2660+
shows that best solutions are for assignments of the variables where
2661+
:math:`z = \overline{x}`.
26642662
26652663
>>> x, y = dimod.Binaries(["x", "y"])
26662664
>>> bqm = 2*x*y - x - y
@@ -2704,8 +2702,7 @@ def BinaryArray(labels: Union[int, Iterable[Variable]],
27042702
0 & 0 & 3
27052703
\\end{bmatrix},
27062704
2707-
derived in the :std:doc:`Ocean documentation's <oceandocs:index>`
2708-
:ref:`AND example <oceandocs:and>`.
2705+
derived in the :ref:`AND example <qpu_example_and>` section.
27092706
27102707
>>> Q = [[0, 1, -2], [0, 0, -2], [0, 0, 3]]
27112708
>>> x = dimod.BinaryArray(["in1", "in2", "out"])
@@ -2758,8 +2755,7 @@ def Spins(labels: Union[int, Iterable[Variable]],
27582755
Examples:
27592756
This example generates a BQM that represents the constraint :math:`s_1 = s_2`
27602757
as a penalty model, :math:`-\\frac{1}{2}s_1s_2`, described in the
2761-
:std:doc:`system documentation's <sysdocs_gettingstarted:index>`
2762-
:std:doc:`sysdocs_gettingstarted:doc_getting_started` guide.
2758+
:ref:`concept_penalty` section.
27632759
The output of the brute-force solver,
27642760
:class:`~dimod.reference.samplers.ExactSolver`, shows that best
27652761
solutions are for eqaul assignments of the variables' values.

dimod/constrained/constrained.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ def add_constraint_from_comparison(self,
286286
r"""Add a constraint from a symbolic comparison.
287287
288288
For a more detailed discussion of symbolic model manipulation, see
289-
:ref:`intro_symbolic_math`.
289+
the :ref:`concept_symbolic_math` section.
290290
291291
Args:
292292
comp: Comparison object, generally constructed using symbolic math.

dimod/core/composite.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
>>> set(sampleset.first.sample.values()) == {-1}
4343
True
4444
45-
For more examples, see the source code for the composed
46-
documented in :ref:`quadratic_composites`.
45+
For more examples, see the source code for the composed samplers
46+
documented in the :ref:`dimod_composites` section.
4747
"""
4848
import abc
4949

docs/LICENSE

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/_static/cookie_notice.css

Lines changed: 0 additions & 31 deletions
This file was deleted.

docs/_static/cookie_notice.js

Lines changed: 0 additions & 29 deletions
This file was deleted.

docs/api_ref.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.. _dimod_api_ref:
2+
3+
=============
4+
API Reference
5+
=============
6+
7+
.. toctree::
8+
:maxdepth: 2
9+
10+
models
11+
generators
12+
utilities
13+
sampleset
14+
vartypes
15+
sampler_composites
16+
api_samplers_composites
17+
variables
18+
exceptions
19+
typing
20+
cpp

0 commit comments

Comments
 (0)