Skip to content
This repository has been archived by the owner on Aug 19, 2023. It is now read-only.

Commit

Permalink
Fix most of the aqua docs lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mtreinish committed Jan 31, 2019
1 parent 66aee78 commit de27092
Show file tree
Hide file tree
Showing 26 changed files with 680 additions and 590 deletions.
63 changes: 39 additions & 24 deletions docs/aqua/algorithms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,15 @@ Additionally, VQE can be configured with the following parameters:
Quantum Approximate Optimization Algorithm (QAOA)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

`QAOA <https://arxiv.org/abs/1411.4028>`__ is a well-known algorithm for finding approximate solutions to
combinatorial-optimization problems.
The QAOA implementation in Aqua directly uses `VQE <#variational-quantum-eigensolver-vqe>`__ for its general hybrid optimization structure.
`QAOA <https://arxiv.org/abs/1411.4028>`__ is a well-known algorithm for finding approximate
solutions to combinatorial-optimization problems.
The QAOA implementation in Aqua directly uses `VQE <#variational-quantum-eigensolver-vqe>`__ for
its general hybrid optimization structure.
However, unlike VQE, which can be configured with arbitrary variational forms,
QAOA uses its own fine-tuned variational form, which comprises :math:`p` parameterized global :math:`x` rotations and
:math:`p` different parameterizations of the problem hamiltonian.
As a result, unlike VQE, QAOA does not need to have a variational form specified as an input parameter,
and is configured mainly by a single integer parameter, ``p``,
QAOA uses its own fine-tuned variational form, which comprises :math:`p` parameterized global
:math:`x` rotations and :math:`p` different parameterizations of the problem hamiltonian.
As a result, unlike VQE, QAOA does not need to have a variational form specified as an input
parameter, and is configured mainly by a single integer parameter, ``p``,
which dictates the depth of the variational form, and thus affects the approximation quality.
An initial state from Aqua's :ref:`initial-states` library may be supplied as well.

Expand Down Expand Up @@ -332,8 +333,8 @@ Quantum Phase Estimation (QPE)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

QPE (also sometimes abbreviated
as PEA, for *Phase Estimation Algorithm*), takes two quantum registers, *control* and *target*, where the
control consists of several qubits initially put in uniform
as PEA, for *Phase Estimation Algorithm*), takes two quantum registers, *control* and *target*,
where the control consists of several qubits initially put in uniform
superposition, and the target a set of qubits prepared in an eigenstate
(or, oftentimes, a guess of the eigenstate) of the unitary operator of
a quantum system. QPE then evolves the target under the control using
Expand Down Expand Up @@ -368,7 +369,8 @@ configuration, QPE also exposes the following parameter settings:
expansion_mode = "trotter" | "suzuki"
Two ``str`` values are permitted: ``"trotter"`` (Lloyd's method) or ``"suzuki"`` (for Trotter-Suzuki expansion),
Two ``str`` values are permitted: ``"trotter"`` (Lloyd's method) or ``"suzuki"``
(for Trotter-Suzuki expansion),
with ``"trotter"`` being the default one.

- The expansion order:
Expand All @@ -377,16 +379,17 @@ configuration, QPE also exposes the following parameter settings:
expansion_order = 1 | 2 | ...
This parameter sets the Trotter-Suzuki expansion order. A positive ``int`` value is expected. The default value is ``2``.
This parameter sets the Trotter-Suzuki expansion order. A positive ``int`` value is expected.
The default value is ``2``.

- The number of ancillae:

.. code:: python
num_ancillae = 1 | 2 | ...
This parameter sets the number of ancillary qubits to be used by QPE. A positive ``int`` value is expected.
The default value is ``1``.
This parameter sets the number of ancillary qubits to be used by QPE. A positive ``int``
value is expected. The default value is ``1``.

.. topic:: Declarative Name

Expand All @@ -405,7 +408,8 @@ Iterative Quantum Phase Estimation (IQPE)

IQPE, as its name
suggests, iteratively computes the phase so as to require fewer qubits.
It takes in the same set of parameters as `QPE <#quantum-phase-estimation-qpe>`__, except for the number of
It takes in the same set of parameters as `QPE <#quantum-phase-estimation-qpe>`__, except
for the number of
ancillary qubits ``num_ancillae``, which is replaced by
``num_iterations`` (a positive ``int``, also defaulted to ``1``), and for the fact that an
Inverse Quantum Fourier Transform (IQFT) is not used for IQPE.
Expand Down Expand Up @@ -435,9 +439,11 @@ applied to a particular operator :math:`A`.
:math:`A` is assumed to operate on :math:`n + 1` qubits (plus possible ancillary qubits)
where the :math:`n` qubits represent the uncertainty (in the form of a random distribution from the
:ref:`random-distributions` library)
and the last qubit, called the *objective qubit*, is used to represent the normalized objective value as its amplitude.
and the last qubit, called the *objective qubit*, is used to represent the normalized objective
value as its amplitude.
In other words,
:math:`A` is constructed such that the probability of measuring a '1' in the objective qubit is equal to the
:math:`A` is constructed such that the probability of measuring a '1' in the objective qubit is
equal to the
value of interest.

.. seealso::
Expand Down Expand Up @@ -465,7 +471,8 @@ expects the following inputs:
a_factory
A ``CircuitFactory`` object that represents the uncertainty problem, i.e., the :math:`A` operator mentioned above.
A ``CircuitFactory`` object that represents the uncertainty problem, i.e., the :math:`A`
operator mentioned above.

- The optional problem unitary:

Expand Down Expand Up @@ -735,7 +742,8 @@ QSVM Variational can be configured with the following parameters:
An integer value greater than or equal to ``3`` is expected. The default is ``3``.

- A Boolean indicating whether or not to print additional information when the algorithm is running:
- A Boolean indicating whether or not to print additional information when the algorithm is
running:

.. code:: python
Expand Down Expand Up @@ -776,15 +784,18 @@ algorithms.
Exact Eigensolver
^^^^^^^^^^^^^^^^^

Exact Eigensolver computes up to the first :math:`k` eigenvalues of a complex square matrix of dimension
Exact Eigensolver computes up to the first :math:`k` eigenvalues of a complex square matrix of
dimension
:math:`n \times n`, with :math:`k \leq n`.
It can be configured with an ``int`` parameter ``k`` indicating the number of eigenvalues to compute:
It can be configured with an ``int`` parameter ``k`` indicating the number of eigenvalues to
compute:

.. code:: python
k = 1 | 2 | ... | n
Specifically, the value of this parameter must be an ``int`` value ``k`` in the range :math:`[1,n]`. The default is ``1``.
Specifically, the value of this parameter must be an ``int`` value ``k`` in the range
:math:`[1,n]`. The default is ``1``.

.. topic:: Declarative Name

Expand Down Expand Up @@ -824,11 +835,14 @@ CPLEX Ising can be configured with the following parameters:
thread = 0 | 1 | 2 | ...
A non-negative ``int`` value is expected. Setting ``thread`` to ``0`` lets CPLEX decide the number of threads to allocate, but this may
A non-negative ``int`` value is expected. Setting ``thread`` to ``0`` lets CPLEX decide the
number of threads to allocate, but this may
not be ideal for small problems. Any value
greater than ``0`` specifically sets the thread count. The default value is ``1``, which is ideal for small problems.
greater than ``0`` specifically sets the thread count. The default value is ``1``, which is
ideal for small problems.

- Decides what CPLEX reports to the screen and records in a log during mixed integer optimization (MIP).
- Decides what CPLEX reports to the screen and records in a log during mixed integer
optimization (MIP).

.. code:: python
Expand All @@ -848,6 +862,7 @@ CPLEX Ising can be configured with the following parameters:
In Aqua, CPLEX supports the ``ising`` problem.

.. _avm-rbf-kernel:

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Support Vector Machine Radial Basis Function Kernel (SVM Classical)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
3 changes: 2 additions & 1 deletion docs/aqua/aqua.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ created :ref:`aqua-library` that can be invoked directly or via domain-specific
applications:
:ref:`aqua-chemistry`, :ref:`aqua-ai`, :ref:`aqua-optimization` and
:ref:`aqua-finance`.
Finally, :ref:`aqua-tutorials` is a companion library of notebooks, input files and sample code made available in the form of a
Finally, :ref:`aqua-tutorials` is a companion library of notebooks, input files
and sample code made available in the form of a
`GitHub repository <https://github.com/Qiskit/aqua-tutorials>`__.

This part of the documentation will first cover Aqua as a library of quantum applications,
Expand Down
Loading

0 comments on commit de27092

Please sign in to comment.