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

Commit d188431

Browse files
Merge pull request #984 from manoelmarques/stable-0.7.1
[Stable] Aqua Release 0.7.1
2 parents e55943b + 095f8a3 commit d188431

File tree

79 files changed

+774
-707
lines changed

Some content is hidden

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

79 files changed

+774
-707
lines changed

.pylintdict

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ abstractmethod
44
adag
55
adam
66
adjoints
7+
ADMMState
78
ae
89
aer
910
Aer's
@@ -347,6 +348,7 @@ lhs
347348
lih
348349
lijh
349350
lin
351+
LinearConstraint
350352
LinearConstraintInterface
351353
linearpaulirotations
352354
ljik
@@ -462,7 +464,6 @@ oplist
462464
oplist's
463465
oplus
464466
optim
465-
QuadraticProgram
466467
optimizer's
467468
optimizers
468469
opv
@@ -539,7 +540,9 @@ qp
539540
qpe
540541
qreg
541542
qrs
543+
QuadraticConstraint
542544
QuadraticConstraintInterface
545+
QuadraticProgram
543546
quandl
544547
quantized
545548
quantumcircuit

.travis.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ stage_dependencies: &stage_dependencies
5555
- pip install -U 'pip<20.0.0'
5656
- pip install -U setuptools wheel
5757
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
58-
- sudo apt-get -y update
59-
- sudo apt-get -y install g++-7
60-
- sudo apt-get -y install libopenblas-dev
6158
- |
6259
if [ "$DEPENDENCY_BRANCH" == "master" ]; then
6360
pip install cython
@@ -67,6 +64,10 @@ stage_dependencies: &stage_dependencies
6764
pip install https://github.com/Qiskit/qiskit-ignis/archive/master.zip --progress-bar off
6865
# Installing qiskit-ibmq-provider master branch...
6966
pip install https://github.com/Qiskit/qiskit-ibmq-provider/archive/master.zip --progress-bar off
67+
# install qiskit-aer build dependencies
68+
sudo apt-get -y update
69+
sudo apt-get -y install g++-7
70+
sudo apt-get -y install libopenblas-dev
7071
# Clone qiskit-aer
7172
git clone --recurse-submodules https://github.com/Qiskit/qiskit-aer.git /tmp/qiskit-aer
7273
cd /tmp/qiskit-aer
@@ -128,6 +129,7 @@ jobs:
128129
- sudo apt-get -y install python3-enchant
129130
- sudo apt-get -y install hunspell-en-us
130131
- pip install pyenchant
132+
- pip install cplex
131133
script:
132134
- make spell
133135
- make style
@@ -145,6 +147,7 @@ jobs:
145147
- aqua1.dat
146148
- aqua137.dep
147149
before_script:
150+
- pip install cplex
148151
- pip install cvxopt
149152
- export PYTHON="coverage3 run --source qiskit/aqua,qiskit/chemistry,qiskit/finance,qiskit/ml,qiskit/optimization --omit */gauopen/* --parallel-mode"
150153
script:
@@ -175,6 +178,7 @@ jobs:
175178
- aqua2.dat
176179
- aqua237.dep
177180
before_script:
181+
- pip install cplex
178182
- pip install cvxopt
179183
- export PYTHON="coverage3 run --source qiskit/aqua,qiskit/chemistry,qiskit/finance,qiskit/ml,qiskit/optimization --omit */gauopen/* --parallel-mode"
180184
script:
@@ -213,7 +217,9 @@ jobs:
213217
- sudo apt-get -y install libgfortran5
214218
# Installing pyquante2 master branch...
215219
- pip install https://github.com/rpmuller/pyquante2/archive/master.zip --progress-bar off
220+
# make sure it uses latest numpy, this will be removed later
216221
- pip install -U numpy
222+
- pip install cplex
217223
before_script:
218224
- export PYTHON="coverage3 run --source qiskit/aqua,qiskit/chemistry,qiskit/finance,qiskit/ml,qiskit/optimization --omit */gauopen/* --parallel-mode"
219225
script:
@@ -249,6 +255,7 @@ jobs:
249255
- finance.dat
250256
- finance37.dep
251257
before_script:
258+
- pip install cplex
252259
- export PYTHON="coverage3 run --source qiskit/aqua,qiskit/chemistry,qiskit/finance,qiskit/ml,qiskit/optimization --omit */gauopen/* --parallel-mode"
253260
script:
254261
- stestr --test-path test/finance run 2> >(tee /dev/stderr out.txt > /dev/null)
@@ -276,6 +283,7 @@ jobs:
276283
- ml.dat
277284
- ml37.dep
278285
before_script:
286+
- pip install cplex
279287
- export PYTHON="coverage3 run --source qiskit/aqua,qiskit/chemistry,qiskit/finance,qiskit/ml,qiskit/optimization --omit */gauopen/* --parallel-mode"
280288
script:
281289
- stestr --test-path test/ml run 2> >(tee /dev/stderr out.txt > /dev/null)
@@ -303,6 +311,7 @@ jobs:
303311
- optimization.dat
304312
- optimization37.dep
305313
before_script:
314+
- pip install cplex
306315
- export PYTHON="coverage3 run --source qiskit/aqua,qiskit/chemistry,qiskit/finance,qiskit/ml,qiskit/optimization --omit */gauopen/* --parallel-mode"
307316
script:
308317
- stestr --test-path test/optimization run 2> >(tee /dev/stderr out.txt > /dev/null)
@@ -324,6 +333,7 @@ jobs:
324333
<<: *stage_dependencies
325334
if: tag IS blank
326335
script:
336+
- pip install cplex
327337
- pip install cvxopt
328338
- pip install https://github.com/rpmuller/pyquante2/archive/master.zip --progress-bar off
329339
- pip check

CHANGELOG.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,24 @@ Changelog](http://keepachangelog.com/en/1.0.0/).
1515
> - **Fixed**: for any bug fixes.
1616
> - **Security**: in case of vulnerabilities.
1717
18-
[UNRELEASED](https://github.com/Qiskit/qiskit-aqua/compare/0.7.0...HEAD)
18+
[UNRELEASED](https://github.com/Qiskit/qiskit-aqua/compare/0.7.1...HEAD)
1919
========================================================================
2020

21+
[0.7.1](https://github.com/Qiskit/qiskit-aqua/compare/0.7.0...0.7.1) - 2020-05-14
22+
=================================================================================
23+
24+
Added
25+
-----
26+
27+
- Added a `linear` option to the `IsingToQuadraticProgram` converter (#956)
28+
29+
Removed
30+
-------
31+
32+
- The monkey-patched ``QuantumCircuit.mcmt`` method and tests, has moved to Terra (#950)
33+
- CPLEX as install requirement in ``requirements.txt`` (#952)
34+
35+
2136
[0.7.0](https://github.com/Qiskit/qiskit-aqua/compare/0.6.6...0.7.0) - 2020-04-30
2237
=================================================================================
2338

@@ -101,7 +116,7 @@ Changed
101116
- HartreeFock initial state and UCCSD variational form `num_qubits` parameter removed as it was
102117
only value checked against that computed internally from the other parameters. UCCSD `depth`
103118
parameter renamed to `reps` and moved in order so it can default to 1. (#939)
104-
119+
105120

106121
Removed
107122
-------

docs/_static/custom.css

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
.toggle .header {
2+
display: block;
3+
clear: both;
4+
background-color: #785EF0;
5+
color: #f9f9f9;
6+
height: 40px;
7+
padding-top: 10px;
8+
padding-left: 5px;
9+
margin-bottom: 20px;
10+
}
11+
12+
.toggle .header:before {
13+
float: left;
14+
content: "▶ ";
15+
font-size: 20px;
16+
17+
}
18+
19+
.toggle .header.open:before {
20+
float: left;
21+
content: "▼ ";
22+
font-size: 20px;
23+
}
24+
25+
.toggle{
26+
background: #FBFBFB;
27+
}

docs/_templates/page.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{% extends "!page.html" %}
2+
3+
{% block footer %}
4+
<script type="text/javascript">
5+
$(document).ready(function() {
6+
$(".toggle > *").hide();
7+
$(".toggle .header").show();
8+
$(".toggle .header").click(function() {
9+
$(this).parent().children().not(".header").toggle(400);
10+
$(this).parent().children(".header").toggleClass("open");
11+
})
12+
});
13+
</script>
14+
{% endblock %}

docs/apidocs/qiskit.aqua.circuits.gates.rst

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

docs/conf.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,14 @@
6565
'sphinx.ext.viewcode',
6666
'sphinx.ext.extlinks',
6767
'sphinx_tabs.tabs',
68-
'jupyter_sphinx.execute',
68+
'jupyter_sphinx',
6969
'sphinx_autodoc_typehints',
7070
'reno.sphinxext',
7171
'sphinx.ext.doctest',
7272
]
7373
html_static_path = ['_static']
7474
templates_path = ['_templates']
75-
html_css_files = [
76-
'style.css',
77-
]
75+
html_css_files = ['style.css', 'custom.css']
7876

7977
# -----------------------------------------------------------------------------
8078
# Autosummary
@@ -89,7 +87,6 @@
8987

9088
autodoc_default_options = {
9189
'inherited-members': None,
92-
'show-inheritance': None,
9390
}
9491

9592

@@ -113,7 +110,7 @@
113110
# List of patterns, relative to source directory, that match files and
114111
# directories to ignore when looking for source files.
115112
# This pattern also affects html_static_path and html_extra_path.
116-
exclude_patterns = []
113+
exclude_patterns = ['_build', '**.ipynb_checkpoints']
117114

118115
# The name of the Pygments (syntax highlighting) style to use.
119116
pygments_style = 'colorful'

qiskit/aqua/VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.7.0
1+
0.7.1

qiskit/aqua/algorithms/classifiers/qsvm/qsvm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ def get_kernel_matrix(quantum_instance, feature_map, x1_vec, x2_vec=None):
275275
(feature_map_params, feature_map_params), feature_map, measurement,
276276
is_statevector_sim=is_statevector_sim)
277277
parameterized_circuit = quantum_instance.transpile(parameterized_circuit)[0]
278-
circuits = [parameterized_circuit.bind_parameters({feature_map_params: x})
278+
circuits = [parameterized_circuit.assign_parameters({feature_map_params: x})
279279
for x in to_be_computed_data]
280280
else:
281281
# the second x is redundant
@@ -327,8 +327,8 @@ def get_kernel_matrix(quantum_instance, feature_map, x1_vec, x2_vec=None):
327327
(feature_map_params_x, feature_map_params_y), feature_map, measurement,
328328
is_statevector_sim=is_statevector_sim)
329329
parameterized_circuit = quantum_instance.transpile(parameterized_circuit)[0]
330-
circuits = [parameterized_circuit.bind_parameters({feature_map_params_x: x,
331-
feature_map_params_y: y})
330+
circuits = [parameterized_circuit.assign_parameters({feature_map_params_x: x,
331+
feature_map_params_y: y})
332332
for x, y in to_be_computed_data_pair]
333333
else:
334334
if logger.isEnabledFor(logging.DEBUG):

qiskit/aqua/algorithms/classifiers/vqc.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ class VQC(VQAlgorithm):
4545
VQC uses the variational method to solve such problems in a quantum processor. Specifically,
4646
it optimizes a parameterized quantum circuit to provide a solution that cleanly separates
4747
the data.
48+
49+
.. note::
50+
51+
The VQC stores the parameters of `var_form` and `feature_map` sorted by name to map the
52+
values provided by the optimizer to the circuit. This is done to ensure reproducible
53+
results, for example such that running the optimization twice with same random seeds yields
54+
the same result.
55+
4856
"""
4957

5058
def __init__(
@@ -529,7 +537,7 @@ def feature_map(self, feature_map: Union[FeatureMap, QuantumCircuit]):
529537

530538
# store the parameters
531539
self._num_qubits = feature_map.num_qubits
532-
self._feature_map_params = list(feature_map.parameters)
540+
self._feature_map_params = sorted(feature_map.parameters, key=lambda p: p.name)
533541
self._feature_map = feature_map
534542
elif isinstance(feature_map, FeatureMap):
535543
# raw feature vector is not yet replaced
@@ -547,7 +555,7 @@ def feature_map(self, feature_map: Union[FeatureMap, QuantumCircuit]):
547555
else:
548556
raise ValueError('Unsupported type {} of feature_map.'.format(type(feature_map)))
549557

550-
if self._feature_map and self._feature_map.feature_dimension == 0:
558+
if self._feature_map.feature_dimension == 0:
551559
warnings.warn('The feature map has no parameters that can be optimized to represent '
552560
'the data. This will most likely cause the VQC to fail.')
553561

0 commit comments

Comments
 (0)