Skip to content
This repository was archived by the owner on Dec 7, 2021. It is now read-only.

Commit ca7c792

Browse files
Merge pull request #511 from manoelmarques/stable-0.5.0
Stable 0.5.0
2 parents 7426e0c + c12a209 commit ca7c792

File tree

455 files changed

+24107
-19296
lines changed

Some content is hidden

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

455 files changed

+24107
-19296
lines changed

.github/CONTRIBUTING.rst

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -166,17 +166,46 @@ you need to have some libraries, which can be installed in this way:
166166
pip install -r requirements.txt
167167
pip install -r requirements-dev.txt
168168
169-
To install Qiskit Aqua locally, execute the following command from the `qiskit-aqua` root
170-
directory on your machine:
169+
To better contribute to Qiskit Aqua, we recommend that you clone the Qiskit Aqua repository
170+
and then install Qiskit Aqua from source. This will give you the ability to inspect and extend
171+
the latest version of the Aqua code more efficiently. The version of Qiskit Aqua in the repository's ``master``
172+
branch is typically ahead of the version in the Python Package Index (PyPI) repository, and
173+
we strive to always keep Aqua in sync with the development versions of the Qiskit elements,
174+
each available in the ``master`` branch of the corresponding repository. Therefore,
175+
all the Qiskit elements and relevant components should be installed from source. This can be
176+
correctly achieved by first uninstalling them from the Python environment in which you
177+
have Qiskit (if they were previously installed),
178+
using the ``pip uninstall`` command for each of them. Next, clone the
179+
`Qiskit Terra <https://github.com/Qiskit/qiskit-terra>`__, `Qiskit Aer <https://github.com/Qiskit/qiskit-aer>`__,
180+
`Qiskit IBMQ Provider <https://github.com/Qiskit/qiskit-ibmq-provider>`__,
181+
`Qiskit Ignis <https://github.com/Qiskit/qiskit-ignis>`__ and
182+
`Qiskit Aqua <https://github.com/Qiskit/qiskit-aqua>`__ repositories and
183+
install them in this order from source in the same Python environment.
184+
Qiskit Terra, Qiskit IBMQ Provider and Qiskit Aqua can be installed by issuing the following commands
185+
in the root directories of the repositoriy clones:
171186

172187
.. code:: sh
173188
189+
$ pip install -r requirements.txt
190+
$ pip install -r requirements-dev.txt
174191
$ pip install -e .
175192
176-
Installing Aqua will automatically install `Terra <https://github.com/Qiskit/qiskit-terra>`__
177-
as one of its dependencies. We recommend that you also set up
178-
`Aer <https://github.com/Qiskit/qiskit-aer>`__ to get more advanced simulators.
179-
Refer to the installation instructions of both Terra and Aer for more details.
193+
To install Qiskit Aer use:
194+
195+
.. code:: sh
196+
197+
$ pip install -r requirements-dev.txt
198+
$ python3 setup.py bdist_wheel
199+
$ cd dist
200+
$ pip install qiskit_aer-<...>.whl
201+
202+
See the
203+
`contribution guidelines of Qiskit Aer <https://github.com/Qiskit/qiskit-aer/blob/master/.github/CONTRIBUTING.md>`__
204+
for more precise instructions.
205+
206+
Make sure to respect the order specified above: Qiskit Terra, Qiskit Aer, Qiskit IBMQ Provider, and Qiskit Aqua.
207+
All the other dependencies will be installed automatically. This process may have to be repeated often
208+
as the ``master`` branch of Aqua is updated frequently.
180209

181210
Style guide
182211
~~~~~~~~~~~
@@ -197,22 +226,20 @@ your changes respect the style guidelines, run the next commands (all platforms)
197226
Documentation
198227
-------------
199228

200-
The documentation for the project is in the ``doc`` directory. The
201-
documentation for the python SDK is auto-generated from python
202-
docstrings using `Sphinx <http://www.sphinx-doc.org>`_ for generating the
203-
documentation. Please follow `Google's Python Style
229+
The documentation source code for the project is located in the ``docs`` directory of the general
230+
`Qiskit repository <https://github.com/Qiskit/qiskit>`__ and automatically rendered on the
231+
`Qiskit documentation Web site <https://qiskit.org/documentation/>`__. The
232+
documentation for the Python SDK is auto-generated from Python
233+
docstrings using `Sphinx <http://www.sphinx-doc.org>`_. Please follow `Google's Python Style
204234
Guide <https://google.github.io/styleguide/pyguide.html?showone=Comments#Comments>`_
205235
for docstrings. A good example of the style can also be found with
206-
`sphinx's napolean converter
236+
`Sphinx's napolean converter
207237
documentation <http://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html>`_.
208238

209-
To generate the documentation, we need to invoke CMake first in order to generate
239+
To generate the documentation, you need to invoke CMake first in order to generate
210240
all specific files for our current platform.
211241
See the `instructions <https://github.com/Qiskit/qiskit-terra/blob/master/.github/CONTRIBUTING.rst#dependencies>`__
212242
in the Terra repository for details on how to install and run CMake.
213-
The docunentation can then be built using the instructions available in the
214-
`docs folder's README file <../docs/README.md>`__.
215-
216243

217244
Development Cycle
218245
-----------------

.gitignore

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -92,33 +92,6 @@ instance/
9292

9393
# Sphinx documentation
9494
docs/_build/
95-
docs/*.rst
96-
#Allow
97-
!docs/qiskit-aqua.rst
98-
!docs/index.rst
99-
!docs/aqua.rst
100-
!docs/library.rst
101-
!docs/overview.rst
102-
!docs/installation.rst
103-
!docs/execution.rst
104-
!docs/extending.rst
105-
!docs/algorithms.rst
106-
!docs/optimizers.rst
107-
!docs/variational_forms.rst
108-
!docs/oracles.rst
109-
!docs/iqfts.rst
110-
!docs/initial_states.rst
111-
!docs/feature_extractions.rst
112-
!docs/aqua_chemistry_*.rst
113-
!docs/aqua_ai.rst
114-
!docs/aqua_optimization.rst
115-
!docs/aqua_tutorials.rst
116-
!docs/aqua_finance.rst
117-
!docs/qiskit_aqua_chemistry.rst
118-
!docs/random_distributions.rst
119-
!docs/uncertainty_problems.rst
120-
!docs/multiclass_extensions.rst
121-
!docs/release_history.rst
12295

12396
# PyBuilder
12497
target/

.travis.yml

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
# Copyright 2018, IBM.
1+
# This code is part of Qiskit.
22
#
3-
# This source code is licensed under the Apache License, Version 2.0 found in
4-
# the LICENSE.txt file in the root directory of this source tree.
3+
# (C) Copyright IBM 2018, 2019.
4+
#
5+
# This code is licensed under the Apache License, Version 2.0. You may
6+
# obtain a copy of this license in the LICENSE.txt file in the root directory
7+
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8+
#
9+
# Any modifications or derivative works of this code must retain this
10+
# copyright notice, and modified files need to carry a notice indicating
11+
# that they have been altered from the originals.
512

613
notifications:
714
on_success: change
@@ -29,21 +36,34 @@ stage_dependencies: &stage_dependencies
2936
- g++-7
3037

3138
before_install:
39+
- |
40+
INIT_FILE="$TRAVIS_BUILD_DIR/qiskit/__init__.py"
41+
if [ -f $INIT_FILE ]; then
42+
# stops travis if __init__.py exists under qiskit
43+
echo "File '$INIT_FILE' found. It should not exist, since this repo extends qiskit namespace.";
44+
travis_terminate 1;
45+
fi
46+
- pip install --upgrade pip setuptools wheel
3247
# download Qiskit Terra master and unzip it only if forced from master or not stable branch, otherwise use the pypi version
3348
- |
3449
if [ ${MASTER_BRANCH_DEPENDENCIES} = "true" ] || [ ${TRAVIS_BRANCH} != "stable" ]; then
50+
# Download github Terra
3551
wget https://codeload.github.com/Qiskit/qiskit-terra/zip/master -O /tmp/qiskit-terra.zip
3652
unzip /tmp/qiskit-terra.zip -d /tmp/
3753
# Install Qiskit Terra requirements.
38-
pip install -U -r /tmp/qiskit-terra-master/requirements.txt
39-
pip install -U -r /tmp/qiskit-terra-master/requirements-dev.txt
54+
pip install -U -r /tmp/qiskit-terra-master/requirements-dev.txt --progress-bar off
4055
# Install local Qiskit Terra
41-
pip install -e /tmp/qiskit-terra-master
56+
pip install -e /tmp/qiskit-terra-master --progress-bar off
57+
# Download github Ignis
58+
wget https://codeload.github.com/Qiskit/qiskit-ignis/zip/master -O /tmp/qiskit-ignis.zip
59+
unzip /tmp/qiskit-ignis.zip -d /tmp/
60+
# Install local Qiskit Ignis
61+
pip install -e /tmp/qiskit-ignis-master --progress-bar off
4262
fi
4363
install:
44-
# install Aqua and dev requirements
45-
- pip install -e $TRAVIS_BUILD_DIR
46-
- pip install -U -r requirements-dev.txt
64+
# install Aqua and dev requirements
65+
- pip install -e $TRAVIS_BUILD_DIR --progress-bar off
66+
- pip install -U -r requirements-dev.txt --progress-bar off
4767

4868
# Define the order of the stages.
4969
stages:
@@ -55,9 +75,9 @@ jobs:
5575
- stage: test first half
5676
<<: *stage_dependencies
5777
script:
58-
- python test/customtests.py 0 -end 21
78+
- python test/custom_tests.py 0 -end 34
5979

6080
- stage: test second half
6181
<<: *stage_dependencies
6282
script:
63-
- python test/customtests.py 21
83+
- python test/custom_tests.py 34

CHANGELOG.rst

Lines changed: 71 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,80 @@ The format is based on `Keep a Changelog`_.
1818
`UNRELEASED`_
1919
=============
2020

21+
`0.5.0`_ - 2019-05-02
22+
=====================
23+
24+
Added
25+
-----
26+
27+
- Implementation of the HHL algorithm supporting ``LinearSystemInput``.
28+
- Pluggable component ``Eigenvalues`` with variant ``EigQPE``.
29+
- Pluggable component ``Reciprocal`` with variants ``LookupRotation`` and ``LongDivision``.
30+
- Multiple-Controlled U1 and U3 operations ``mcu1`` and ``mcu3``.
31+
- Pluggable component ``QFT`` derived from component ``IQFT``.
32+
- Summarize the transpiled circuits at the DEBUG logging level.
33+
- ``QuantumInstance`` accepts ``basis_gates`` and ``coupling_map`` again.
34+
- Support to use ``cx`` gate for the entangement in ``RY`` and ``RYRZ`` variational form. (``cz`` is the default choice.)
35+
- Support to use arbitrary mixer Hamiltonian in ``QAOA``. This allows to use QAOA in constrained optimization problems [arXiv:1709.03489].
36+
- Added variational algorithm base class ``VQAlgorithm``, implemented by ``VQE`` and ``QSVMVariational``.
37+
- Added ``ising/docplex.py`` for automatically generating Ising Hamiltonian from optimization models of DOcplex.
38+
- Added ``'basic-dirty-ancilla'`` mode for ``mct``.
39+
- Added ``mcmt`` for Multi-Controlled, Multi-Target gate.
40+
- Exposed capabilities to generate circuits from logical AND, OR, DNF (disjunctive normal forms), and CNF (conjunctive normal forms) formulae.
41+
- Added the capability to generate circuits from ESOP (exclusive sum of products) formulae with optional optimization based on Quine-McCluskey and ExactCover.
42+
- Added ``LogicalExpressionOracle`` for generating oracle circuits from arbitrary boolean logic expressions (including DIMACS support) with optional optimization capability.
43+
- Added ``TruthTableOracle`` for generating oracle circuits from truth-tables with optional optimization capability.
44+
- Added ``CustomCircuitOracle`` for generating oracle from user specified circuits.
45+
- Added implementation of the Deutsch-Jozsa algorithm.
46+
- Added implementation of the Bernstein-Vazirani algorithm.
47+
- Added implementation of the Simon's algorithm.
48+
- Added implementation of the Shor's algorithm.
49+
- Added optional capability for ``Grover``'s algorithm to take a custom initial state (as opposed to the default uniform superposition)
50+
- Added capability to create a ``Custom`` initial state using existing circuit.
51+
- Added the ADAM (and AMSGRAD) optimization algorithm
52+
- Multivariate distributions added, so uncertainty models now have univariate and multivariate distribution components.
53+
- Added option to include or skip the swaps operations for qft and iqft circuit constructions.
54+
- Added classical linear system solver ``ExactLSsolver``.
55+
- Added parameters ``auto_hermitian`` and ``auto_resize`` to ``HHL`` algorithm to support non-hermititan and non 2**n sized matrices by default.
56+
- Added another feature map, ``RawFeatureVector``, that directly maps feature vectors to qubits' states for classification.
57+
- ``SVM_Classical`` can now load models trained by ``QSVM``.
58+
- Added CompleteMeasFitter for mitigating measurement error when jobs are run on a real device or noise simulation.
59+
60+
Removed
61+
-------
62+
63+
- ``QuantumInstance`` does not take ``memory`` anymore.
64+
- Moved Command line and GUI interfaces to separate repo (qiskit_aqua_uis).
65+
- Removed the ``SAT``-specific oracle (now supported by ``LogicalExpressionOracle``).
66+
67+
68+
Changed
69+
-------
70+
71+
- Changed the type of ``entanger_map`` used in ``FeatureMap`` and ``VariationalForm`` to list of list.
72+
- Fixed package setup to correctly identify namespace packages using ``setuptools.find_namespace_packages``.
73+
- Changed ``advanced`` mode implementation of ``mct``: using simple ``h`` gates instead of ``ch``, and fixing the old recursion step in ``_multicx``.
74+
- Components ``random_distributions`` renamed to ``uncertainty_models``.
75+
- Reorganized the constructions of various common gates (``ch``, ``cry``, ``mcry``, ``mct``, ``mcu1``, ``mcu3``, ``mcmt``, ``logic_and``, and ``logic_or``) and circuits (``PhaseEstimationCircuit``, ``BooleanLogicCircuits``, ``FourierTransformCircuits``, and ``StateVectorCircuits``) under the ``circuits`` directory.
76+
- Renamed the algorithm ``QSVMVariational`` to ``VQC``, which stands for Variational Quantum Classifier.
77+
- Renamed the algorithm ``QSVMKernel`` to ``QSVM``.
78+
- Renamed the class ``SVMInput`` to ``ClassificationInput``.
79+
- Renamed problem type ``'svm_classification'`` to ``'classification'``
80+
81+
Fixed
82+
-----
83+
84+
- Fixed ``ising/docplex.py`` to correctly multiply constant values in constraints
85+
86+
2187
`0.4.1`_ - 2019-01-09
2288
=====================
2389

2490
Added
2591
-----
2692

2793
- Optimizers now have most relevant options on constructor for ease of programming. Options may still be set via set_options.
28-
- Provider is now explicilty named and the named backend is created from that named provider. Backend being selected from the first of the internally known set of providers is deprecated.
94+
- Provider is now explicitly named and the named backend is created from that named provider. Backend being selected from the first of the internally known set of providers is deprecated.
2995
- Improve operation with Aer provider/backends.
3096
- Registration to Aqua of externally provided pluggable algorithms and components altered to setuptools entry point support for plugins. The prior registration mechanism has been removed.
3197
- A flag ``before_04`` in the ``load_from_dict(file)`` method is added to support to load operator in the old format. We encourage to save the operator in the new format from now on.
@@ -44,11 +110,11 @@ Added
44110
- Transparent parallelization for gradient-based optimizers
45111
- Multiple-Controlled-NOT (cnx) operation
46112
- Pluggable algorithmic component ``RandomDistribution``
47-
- Concrete implementations of ``RandomDistribution``: ``BernoulliDistribution``, ``LogNormalDistribution``,
113+
- Concrete implementations of ``RandomDistribution``: ``BernoulliDistribution``, ``LogNormalDistribution``,
48114
``MultivariateDistribution``, ``MultivariateNormalDistribution``, ``MultivariateUniformDistribution``, ``NormalDistribution``,
49115
``UniformDistribution``, and ``UnivariateDistribution``
50116
- Pluggable algorithmic component:
51-
- Concrete implementations of ``UncertaintyProblem``: ``FixedIncomeExpectedValue``, ``EuropeanCallExpectedValue``, and
117+
- Concrete implementations of ``UncertaintyProblem``: ``FixedIncomeExpectedValue``, ``EuropeanCallExpectedValue``, and
52118
``EuropeanCallDelta``
53119
- Amplitude Estimation algorithm
54120
- Qiskit Optimization: New Ising models for optimization problems exact cover, set packing, vertex cover, clique, and graph partition
@@ -187,7 +253,8 @@ Changed
187253
- Updated qiskit minimum version in setup.py.
188254
- Fixed links in readme.me.
189255

190-
.. _UNRELEASED: https://github.com/Qiskit/qiskit-aqua/compare/0.4.1...HEAD
256+
.. _UNRELEASED: https://github.com/Qiskit/qiskit-aqua/compare/0.5.0...HEAD
257+
.. _0.5.0: https://github.com/Qiskit/qiskit-aqua/compare/0.4.1...0.5.0
191258
.. _0.4.1: https://github.com/Qiskit/qiskit-aqua/compare/0.4.0...0.4.1
192259
.. _0.4.0: https://github.com/Qiskit/qiskit-aqua/compare/0.3.1...0.4.0
193260
.. _0.3.1: https://github.com/Qiskit/qiskit-aqua/compare/0.3.0...0.3.1

CONTRIBUTORS.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,34 @@ levels:
1010

1111
- `Panagiotis Barkoutsos <https://researcher.watson.ibm.com/researcher/view.php?person=zurich-BPA>`__
1212
- Sergey Bravyi
13+
- David Bucher
1314
- Chun-Fu (Richard) Chen
1415
- `Antonio Córcoles-Gonzalez <https://researcher.watson.ibm.com/researcher/view.php?person=us-adcorcol>`__
1516
- Albert Frisch
1617
- `Jay Gambetta <https://researcher.watson.ibm.com/researcher/view.php?person=us-jay.gambetta>`__
17-
- Jennifer Glick
1818
- `Donny Greenberg <https://researcher.watson.ibm.com/researcher/view.php?person=ibm-donny>`__
19-
- Tanvi Gujarati
19+
- Isabel Haide
2020
- `Shaohan Hu <https://researcher.watson.ibm.com/researcher/view.php?person=ibm-Shaohan.Hu>`__
2121
- `Takashi Imamichi <https://researcher.watson.ibm.com/researcher/view.php?person=jp-IMAMICHI>`__
2222
- Tal Kachman
23+
- `Gawel Kus <https://www.tudelft.nl/en/ae/organisation/departments/aerospace-structures-and-materials/novel-aerospace-materials/people/personal-pages-novam/students/g-kus-gawel/>`__
2324
- `Peng Liu <https://researcher.watson.ibm.com/researcher/view.php?person=us-liup>`__
25+
- `Jakub Marecek <http://researcher.ibm.com/person/ie-jakub.marecek>`__
2426
- Manoel Marques
27+
- `Martin Mevissen <https://researcher.watson.ibm.com/researcher/view.php?person=ie-MARTMEVI>`__
2528
- Antonio Mezzacapo
2629
- `Nikolaj Moll <https://researcher.watson.ibm.com/researcher/view.php?person=zurich-NIM>`__
30+
- Jan Müggenburg
2731
- `Giacomo Nannicini <https://researcher.watson.ibm.com/researcher/view.php?person=us-nannicini>`__
2832
- Pauline Ollitrault
2933
- `Anna Phan <https://researcher.watson.ibm.com/researcher/view.php?person=au1-anna.phan>`__
3034
- `Marco Pistoia <https://researcher.watson.ibm.com/researcher/view.php?person=us-pistoia>`__
3135
- `Julia Rice <https://researcher.watson.ibm.com/researcher/view.php?person=us-jrice>`__
3236
- `Raymond Harry Putra Rudy <https://researcher.watson.ibm.com/researcher/view.php?person=jp-RUDYHAR>`__
3337
- `Kanav Setia <https://physics.dartmouth.edu/people/kanav-setia>`__
38+
- `Andrea Simonetto <https://researcher.watson.ibm.com/researcher/view.php?person=ibm-Andrea.Simonetto>`__
39+
- Igor Sokolov
3440
- `Ivano Tavernelli <https://researcher.watson.ibm.com/researcher/view.php?person=zurich-ITA>`__
3541
- `Stephen Wood <https://researcher.watson.ibm.com/researcher/view.php?person=us-woodsp>`__
3642
- `Stefan Woerner <https://researcher.watson.ibm.com/researcher/view.php?person=zurich-wor>`__
43+
- `Christa Zoufal <https://researcher.watson.ibm.com/researcher/view.php?person=zurich-OUF>`__

MANIFEST.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
recursive-include qiskit_aqua *.json
2-
recursive-include qiskit_aqua_ui *.json
1+
recursive-include qiskit/aqua *.json *.txt

Makefile

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

0 commit comments

Comments
 (0)