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

Add doc8 run to CI and lint checks #52

Merged
merged 7 commits into from
Feb 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/advanced_use_of_ibm_q_devices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
Advanced Use of IBM Q Devices
=============================

In Qiskit we have an interface for backends and jobs that will be useful for running circuits and extending to third-party backends. In this section, we will review the core components of Qiskit’s base backend framework, using the IBM Q provider as an example.
In Qiskit we have an interface for backends and jobs that will be useful for running circuits and
extending to third-party backends. In this section, we will review the core components of
Qiskit’s base backend framework, using the IBM Q provider as an example.

The interface has three parts: the provider, the backend, and the job:

Expand Down
5 changes: 4 additions & 1 deletion docs/aer/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ Overview

A high performance simulator framework for quantum circuits

Qiskit Aer provides a high performance simulator framework for the Qiskit software stack. It contains optimized C++ simulator backends for executing circuits compiled in Qiskit Terra, and tools for constructing highly configurable noise models for performing realistic noisy simulations of the errors that occur during execution on real devices.
Qiskit Aer provides a high performance simulator framework for the Qiskit software stack. It
contains optimized C++ simulator backends for executing circuits compiled in Qiskit Terra, and
tools for constructing highly configurable noise models for performing realistic noisy simulations
of the errors that occur during execution on real devices.


*This project uses the* |emphasized hyperlink|_.
Expand Down
9 changes: 5 additions & 4 deletions docs/aqua/ai/qiskit_ai.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,16 @@ Research and developers interested in :ref:`aqua-extending` with new AI-specific
capabilities can take advantage
of the modular architecture of Aqua and easily extend Aqua with more algorithms
and algorithm components, such as new :ref:`oracles` for the :ref:`grover` algorithm,
:ref:`optimizers` and :ref:`variational-forms` for :ref:`vqe`, :ref:`qaoa`, and :ref:`svm-variational`,
:ref:`iqfts` for :ref:`qpe`, :ref:`initial-states` for :ref:`variational-forms`,
as well as :ref:`feature-maps` and :ref:`multiclass-extensions` for Support Vector Machine
:ref:`optimizers` and :ref:`variational-forms` for :ref:`vqe`, :ref:`qaoa`, and
:ref:`svm-variational`, :ref:`iqfts` for :ref:`qpe`, :ref:`initial-states` for
:ref:`variational-forms`, as well as :ref:`feature-maps` and
:ref:`multiclass-extensions` for Support Vector Machine
(SVM) algorithms, such as :ref:`svm-variational` and :ref:`svm-q-kernel`.


--------
Examples
--------
--------

The ``artificial_intelligence`` folder of the `Aqua Tutorials GitHub Repository
<https://github.com/Qiskit/aqua-tutorials>`__ contains numerous
Expand Down
74 changes: 46 additions & 28 deletions docs/aqua/algorithms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,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 @@ -404,8 +405,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 @@ -440,7 +441,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 @@ -449,16 +451,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 @@ -477,7 +480,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 @@ -507,9 +511,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 @@ -537,7 +543,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 @@ -683,8 +690,9 @@ The algorithm determines whether the given function
function maps all inputs to 0 or 1, and a balanced function maps half of its
inputs to 0 and the other half to 1.
Any of the oracles provided by Aqua can be used with the Deutsch-Jozsa algorithm,
as long as the boolean function implemented by the oracle indeed satisfies the constraint of being either constant or balanced.
Above said, a :ref:`truth-table-oracle` instance might be easier to construct to meet the constraint, but a :ref:`logic-expr-oracle` can certainly also be used.
as long as the boolean function implemented by the oracle indeed satisfies the constraint of being
either constant or balanced. Above said, a :ref:`truth-table-oracle` instance might be easier to
construct to meet the constraint, but a :ref:`logic-expr-oracle` can certainly also be used.

.. topic:: Declarative Name

Expand Down Expand Up @@ -733,7 +741,8 @@ if :math:`y=x \oplus s` for all :math:`x \in \{0,1\}^n`. Thus, if
1-to-1 (or, permutation) function. Otherwise, if :math:`s \neq 0\ldots 0`,
then :math:`f_s` is a 2-to-1 function.
Of Aqua's included oracles,
:ref:`truth-table-oracle` should be the easiest to use to create one that can be used with the Simon algorith.
:ref:`truth-table-oracle` should be the easiest to use to create one that can be used with the
Simon algorith.

.. topic:: Declarative Name

Expand Down Expand Up @@ -827,7 +836,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 All @@ -851,7 +861,8 @@ HHL algorithm for solving linear systems (HHL)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The *HHL algorithm* (after the author's surnames Harrow-Hassidim-Lloyd) is a
quantum algorithm to solve systems of linear equations :math:`A\overrightarrow{x}=\overrightarrow{b}`.
quantum algorithm to solve systems of linear equations
:math:`A\overrightarrow{x}=\overrightarrow{b}`.
Using the Quantum Phase Estimation algorithm (:ref:`QPE`), the linear system
is transformed into diagonal form in which the matrix :math:`A` is easily
invertible. The inversion is achieved by rotating an ancillary qubit by an angle
Expand Down Expand Up @@ -911,15 +922,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 @@ -959,11 +973,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 @@ -983,6 +1000,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
4 changes: 2 additions & 2 deletions docs/aqua/chemistry/qiskit_chemistry.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Qiskit Chemistry
****************

Qiskit Chemistry is the only end-to-end quantum software stack that allows for mapping high-level
classical chemistry computational software problems all the way down to a quantum machine (a simulator or a
real quantum device).
classical chemistry computational software problems all the way down to a quantum machine (a
simulator or a real quantum device).

.. toctree::
:maxdepth: 3
Expand Down
Loading