Skip to content

Commit 5327e4f

Browse files
committed
added some content, edits, and fixes for broken xrefs & todos
1 parent b8f3cc2 commit 5327e4f

14 files changed

+179
-176
lines changed

docs/bibliography.rst

+4-6
Original file line numberDiff line numberDiff line change
@@ -491,14 +491,12 @@ Bibliography
491491
M. W. Johnson et al. "Quantum annealing with manufactured spins."
492492
*Nature* 473 (May 12, 2011), pp. 194--198.
493493
494-
.. todo:: find a place to reference this link, it's a nice one
495494
496-
.. removed the section that used this but
497495
498-
.. [Jor2011]
499-
Stephen Jordan.
500-
"Quantum Algorithm Zoo."
501-
https://math.nist.gov/quantum/zoo/
496+
.. [Jor2011]
497+
Stephen Jordan.
498+
"Quantum Algorithm Zoo."
499+
https://quantumalgorithmzoo.org
502500
503501
.. [Jue2016]
504502
Juexiao Su, Tianheng Tu, and Lei He.

docs/concepts/index.rst

+6-55
Original file line numberDiff line numberDiff line change
@@ -361,24 +361,9 @@ Concepts and Terminology
361361
A state in which the values of variables violate a :term:`constraint`.
362362

363363
Ising
364-
Traditionally used in statistical mechanics. Variables are "spin up"
365-
(:math:`\uparrow`) and "spin down" (:math:`\downarrow`), states that
366-
correspond to :math:`+1` and :math:`-1` values. Relationships between
367-
the spins, represented by couplings, are correlations or
368-
anti-correlations. The :term:`objective function` expressed as an Ising
369-
model is as follows:
370-
371-
.. math::
372-
:nowrap:
373-
374-
\begin{equation}
375-
\text{E}_{ising}(\pmb{s}) = \sum_{i=1}^N h_i s_i +
376-
\sum_{i=1}^N \sum_{j=i+1}^N J_{i,j} s_i s_j
377-
\end{equation}
378-
379-
where the linear coefficients corresponding to qubit biases
380-
are :math:`h_i`, and the quadratic coefficients corresponding to
381-
coupling strengths are :math:`J_{i,j}`.
364+
.. include:: ../shared/models.rst
365+
:start-after: start_models_ising_formula
366+
:end-before: end_models_ising_formula
382367

383368
Learn more:
384369

@@ -560,43 +545,9 @@ Concepts and Terminology
560545
`Qubit on Wikipedia <https://en.wikipedia.org/wiki/Qubit>`_.
561546

562547
QUBO
563-
Quadratic unconstrained binary optimization.
564-
QUBO problems are traditionally used in computer science. Variables
565-
are TRUE and FALSE, states that correspond to 1 and 0 values.
566-
A QUBO problem is defined using an upper-diagonal matrix :math:`Q`,
567-
which is an :math:`N` x :math:`N` upper-triangular matrix of real
568-
weights, and :math:`x`, a vector of binary variables, as minimizing the
569-
function
570-
571-
.. math::
572-
:nowrap:
573-
574-
\begin{equation}
575-
f(x) = \sum_{i} {Q_{i,i}}{x_i} + \sum_{i<j} {Q_{i,j}}{x_i}{x_j}
576-
\end{equation}
577-
578-
where the diagonal terms :math:`Q_{i,i}` are the linear coefficients and
579-
the nonzero off-diagonal terms are the quadratic coefficients
580-
:math:`Q_{i,j}`.
581-
This can be expressed more concisely as
582-
583-
.. math::
584-
:nowrap:
585-
586-
\begin{equation}
587-
\min_{{x} \in {\{0,1\}^n}} {x}^{T} {Q}{x}.
588-
\end{equation}
589-
590-
In scalar notation, the :term:`objective function` expressed as a QUBO
591-
is as follows:
592-
593-
.. math::
594-
:nowrap:
595-
596-
\begin{equation}
597-
\text{E}_{qubo}(a_i, b_{i,j}; q_i) = \sum_{i} a_i q_i +
598-
\sum_{i<j} b_{i,j} q_i q_j.
599-
\end{equation}
548+
.. include:: ../shared/models.rst
549+
:start-after: start_models_qubo_formula
550+
:end-before: end_models_qubo_formula
600551

601552
See also `QUBO on Wikipedia <https://en.wikipedia.org/wiki/Quadratic_unconstrained_binary_optimization>`_.
602553

docs/concepts/models.rst

+6-21
Original file line numberDiff line numberDiff line change
@@ -136,33 +136,18 @@ can represent both.
136136
Ising Model
137137
-----------
138138

139-
The :term:`Ising` model is an :term:`objective function` of :math:`N` variables
140-
:math:`s=[s_1,...,s_N]` corresponding to physical Ising spins, where :math:`h_i`
141-
are the biases and :math:`J_{i,j}` the couplings (interactions) between spins.
142-
143-
.. math::
144-
145-
\text{Ising:} \qquad
146-
E(\bf{s})
147-
= \sum_{i=1} h_i s_i +
148-
\sum_{i<j} J_{i,j} s_i s_j
149-
\qquad\qquad s_i\in\{-1,+1\}
139+
.. include:: ../shared/models.rst
140+
:start-after: start_models_ising_formula
141+
:end-before: end_models_ising_formula
150142

151143
.. _concept_models_qubo:
152144

153145
QUBO
154146
----
155147

156-
The :term:`QUBO` model is an objective function of :math:`N` binary variables
157-
represented as an upper-diagonal matrix :math:`Q`, where diagonal terms are the
158-
linear coefficients and the nonzero off-diagonal terms the quadratic
159-
coefficients.
160-
161-
.. math::
162-
163-
\text{QUBO:} \qquad E(\bf{x})
164-
= \sum_{i\le j} x_i Q_{i,j} x_j
165-
\qquad\qquad x_i\in \{0,1\}
148+
.. include:: ../shared/models.rst
149+
:start-after: start_models_qubo_formula
150+
:end-before: end_models_qubo_formula
166151

167152
Other Models
168153
============

docs/concepts/variables.rst

+22-20
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,34 @@
44
Variables
55
=========
66

7-
.. todo:: this section can do with some work, especially related to nonlinear
8-
models
7+
This section mainly relates to the :term:`quadratic models <quadratic model>`
8+
submitted to |cloud|_ service solvers such as the :term:`hybrid` :term:`CQM`
9+
solver.\ [#]_ For the variables in :term:`nonlinear models <nonlinear model>`,
10+
see an introduction in the :ref:`opt_model_construction_nl` section and the
11+
reference documentation under the :ref:`index_optimization` section.
912

10-
|dwave_short|'s :term:`samplers <sampler>` mostly\ [#]_ solve
11-
:ref:`quadratic models <concept_models_quadratic>` of various sorts. Quadratic
12-
models are characterized by having one or two variables per term. A simple
13-
example of a quadratic model is,
14-
15-
.. math::
16-
17-
D = Ax + By + Cxy
18-
19-
where :math:`A`, :math:`B`, and :math:`C` are constants. Single variable
20-
terms---:math:`Ax` and :math:`By` here---are *linear* with the constant biasing
21-
the term's variable. Two-variable terms---:math:`Cxy` here---are *quadratic*
22-
with a relationship between the variables.
23-
24-
The variables in these models may be of the following types.
13+
The variables in :ref:`supported models <concept_models>` may be of the
14+
following types.
2515

2616
.. |variables_table| replace:: Supported Variables
2717

2818
.. include:: ../shared/variables.rst
2919
:start-after: start_variables_table
3020
:end-before: end_variables_table
3121

32-
.. [#] :ref:`Ocean <index_ocean_sdk>` software also provides some higher-order
33-
tools for developing and testing your code; for example, the
34-
:class:`~dimod.reference.samplers.ExactPolySolver` class.
22+
.. [#]
23+
24+
These models are characterized by having one or two variables per term. A simple
25+
example of a quadratic model is,
26+
27+
.. math::
28+
29+
D = Ax + By + Cxy
30+
31+
where :math:`A`, :math:`B`, and :math:`C` are constants. Single variable
32+
terms---:math:`Ax` and :math:`By` here---are *linear* with the constant biasing
33+
the term's variable. Two-variable terms---:math:`Cxy` here---are *quadratic*
34+
with a relationship between the variables.
3535
3636
Variable Representations and Labels
3737
===================================
@@ -81,3 +81,5 @@ Related Information
8181
nonlinear models.
8282
* The :ref:`opt_model_construction_qm` section describes the construction of
8383
quadratic models.
84+
* :ref:`quadratic models <concept_models_quadratic>` describes supported
85+
models.

docs/industrial_optimization/developing_quantum_applications.rst

+1-2
Original file line numberDiff line numberDiff line change
@@ -734,8 +734,7 @@ Your application will likely have multiple parts, including the following:
734734
it to a |dwave_short| solver for solution. It is recommended that you
735735
implement the :ref:`model <concept_models>` representing your
736736
problem, formulated as described in the previous section, and manage the
737-
submission using the
738-
`Ocean SDK <index_ocean_sdk>`.
737+
submission using the :ref:`Ocean SDK <index_ocean_sdk>`.
739738

740739
* Handling inputs and presenting results
741740

docs/industrial_optimization/dwave_hybrid.rst

-2
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,6 @@ branches.
188188

189189
Racing Branches
190190

191-
.. todo:: consider modifying this pulled-in example (markers will change)
192-
193191
.. include:: ../ocean/api_ref_hybrid/README.rst
194192
:start-after: start_hybrid_example
195193
:end-before: end_hybrid_example

docs/leap_sapi/admin.rst

+3
Original file line numberDiff line numberDiff line change
@@ -1535,6 +1535,9 @@ one of the following:
15351535
* - **Completed**
15361536
- The solver has successfully completed its work on the problem.
15371537

1538+
* - **Cancelling**
1539+
- A request to cancel work on a problem is being processed.
1540+
15381541
* - **Cancelled**
15391542
- Work on the problem has been cancelled. Cancelled problems do not
15401543
use any solver-access time.

docs/quantum_research/example_not.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ unstructured problem (variables such as :math:`x_2` etc.) to the sampler's
150150
:ref:`graph structure <qpu_topologies>` (the QPU's numerically indexed qubits)
151151
in a process known as :term:`minor-embedding`.
152152

153-
The next code sets up a D-Wave system as the sampler.
153+
The next code sets up a D-Wave quantum computer as the sampler.
154154

155155
.. include:: ../shared/examples.rst
156156
:start-after: start_default_solver_config

docs/quantum_research/gate_model_intro.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@ Further Information
1818
===================
1919

2020
* `Wikipedia's quantum circuit <https://en.wikipedia.org/wiki/Quantum_circuit>`_
21-
* [Nel2010]_
21+
* [Nel2010]_ is an introduction to the main ideas and techniques of the field
22+
of quantum computation and quantum information.
23+
* [Jor2011]_ is an online catalog of quantum algorithms.

docs/quantum_research/qubo_ising.rst

+6-48
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ Finally, the :ref:`qpu_qubo_ising_example` subsection gives a simple example and
1919
the :ref:`qpu_qubo_ising_transformations` subsection shows how to convert
2020
between :term:`Ising` models and :term:`QUBOs <QUBO>`.
2121

22-
.. todo:: consider consolidating and importing the ising & qubo definitions from
23-
concepts/models
24-
2522
.. _qpu_qubo_ising_bqm:
2623

2724
Binary Quadratic Models
@@ -37,57 +34,18 @@ trivial, as shown in the :ref:`qpu_qubo_ising_transformations` section.
3734
Ising Model
3835
-----------
3936

40-
The Ising model is traditionally used in statistical mechanics. Variables are
41-
"spin up" (:math:`\uparrow`) and "spin down" (:math:`\downarrow`), states that
42-
correspond to :math:`+1` and :math:`-1` values. Relationships between the spins,
43-
represented by couplings, are correlations or anti-correlations. The objective
44-
function expressed as an Ising model is as follows:
45-
46-
.. math::
47-
48-
\text{E}_{ising}(\vc s) = \sum_{i=1}^N h_i s_i +
49-
\sum_{i=1}^N \sum_{j=i+1}^N J_{i,j} s_i s_j
50-
51-
where the linear coefficients corresponding to qubit biases are :math:`h_i`,
52-
and the quadratic coefficients corresponding to coupling strengths are
53-
:math:`J_{i,j}`.
37+
.. include:: ../shared/models.rst
38+
:start-after: start_models_ising_formula
39+
:end-before: end_models_ising_formula
5440

5541
.. _qpu_qubo_ising_qubo:
5642

5743
QUBO
5844
----
5945

60-
QUBO problems are traditionally used in computer science, with variables taking
61-
values 1 (TRUE) and 0 (FALSE).
62-
63-
A QUBO problem is defined using an upper-diagonal matrix :math:`Q`, which is an
64-
:math:`N` x :math:`N` upper-triangular matrix of real weights, and :math:`x`, a
65-
vector of binary variables, as minimizing the function
66-
67-
.. math::
68-
69-
f(x) = \sum_{i} {Q_{i,i}}{x_i} + \sum_{i<j} {Q_{i,j}}{x_i}{x_j}
70-
71-
where the diagonal terms :math:`Q_{i,i}` are the linear coefficients and the
72-
nonzero off-diagonal terms :math:`Q_{i,j}` are the quadratic coefficients.
73-
74-
This can be expressed more concisely as
75-
76-
.. math::
77-
78-
\min_{{x} \in {\{0,1\}^n}} {x}^{T} {Q}{x}.
79-
80-
In scalar notation, the objective function expressed as a QUBO is as follows:
81-
82-
.. math::
83-
84-
\text{E}_{qubo}(a_i, b_{i,j}; q_i) = \sum_{i} a_i q_i +
85-
\sum_{i<j} b_{i,j} q_i q_j.
86-
87-
.. note::
88-
Quadratic unconstrained binary optimization problems---QUBOs---are
89-
*unconstrained* in that there are no constraints on the variables other
90-
than those expressed in *Q*.
46+
.. include:: ../shared/models.rst
47+
:start-after: start_models_qubo_formula
48+
:end-before: end_models_qubo_formula
9149

9250
.. _qpu_qubo_ising_example:
9351

docs/quantum_research/workflow.rst

+53-3
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,56 @@ Simple Sampling Example
9090

9191
.. _qpu_workflow_simple_example:
9292

93-
.. todo:: add example: Simple Workflow Example
94-
95-
Simple Workflow Example (title)
93+
Simple Workflow Example
94+
=======================
95+
96+
This example uses the :ref:`Ocean software <index_ocean_sdk>` package,
97+
:ref:`index_dimod`, to formulate a small objective function: the
98+
:func:`~dimod.generators.combinations` function generates a :term:`BQM` that
99+
represents the problem of selecting exactly :math:`k` of :math:`n` binary
100+
variables.
101+
102+
The following code creates a BQM that is minimized when exactly two
103+
(:math:`k=2`) of the three (:math:`n=3`) variables :code:`a, b, c` are
104+
:math:`1`:
105+
106+
>>> import dimod
107+
>>> bqm = dimod.generators.combinations(['a', 'b', 'c'], 2)
108+
109+
Now solve on a |dwave_short| quantum computer using the
110+
:class:`~dwave.system.samplers.DWaveSampler` sampler from Ocean software's
111+
:ref:`index_system` package. Also use its
112+
:class:`~dwave.system.composites.EmbeddingComposite` composite to map the
113+
unstructured problem (variables such as :math:`a` etc.) to the sampler's
114+
:ref:`graph structure <qpu_topologies>` (the QPU's numerically indexed qubits)
115+
in a process known as :term:`minor-embedding`.
116+
117+
The next code sets up a D-Wave quantum computer as the sampler.
118+
119+
.. include:: ../shared/examples.rst
120+
:start-after: start_default_solver_config
121+
:end-before: end_default_solver_config
122+
123+
>>> from dwave.system import DWaveSampler, EmbeddingComposite
124+
>>> sampler = EmbeddingComposite(DWaveSampler())
125+
126+
Because the sampled solution is probabilistic, returned solutions may differ
127+
between runs. Typically, when submitting a problem to the system, you ask for
128+
many samples, not just one. This way, you see multiple “best” answers and reduce
129+
the probability of settling on a suboptimal answer. Below, ask for 1000 samples.
130+
131+
>>> sampleset = sampler.sample(bqm, num_reads=1000, label='SDK Examples - QPU Workflow')
132+
>>> print(sampleset) # doctest: +SKIP
133+
a b c energy num_oc. chain_.
134+
0 1 1 0 0.0 323 0.0
135+
1 1 0 1 0.0 339 0.0
136+
2 0 1 1 0.0 336 0.0
137+
3 1 1 1 1.0 1 0.0
138+
4 1 0 0 1.0 1 0.0
139+
['BINARY', 5 rows, 1000 samples, 3 variables]
140+
141+
Almost all the returned samples represent valid value assignments for the
142+
:math:`\binom{N}{k}` problem, and minima (low-energy states) of the BQM, and
143+
with high likelihood the best (lowest-energy: here :math:`0.0` in the
144+
:code:`energy` column) samples satisfy the formulation (two :math:`1`\ s among
145+
the three variables columns, :code:`a, b, c`).

0 commit comments

Comments
 (0)