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

Qiskit Optimization #877

Merged
merged 465 commits into from
Apr 27, 2020
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
465 commits
Select commit Hold shift + click to select a range
5435e80
implement first part of steve's comments
Cryoris Apr 7, 2020
3d88930
skip some unnecessary varform checks
Cryoris Apr 7, 2020
2db1215
Revert "skip some unnecessary varform checks"
Cryoris Apr 7, 2020
12dbf87
Merge branch 'master' into optimization-stack
manoelmarques Apr 7, 2020
6274995
rename OptimizationProblem with QuadraticProgram
t-imamichi Apr 8, 2020
47e4da6
Merge branch 'optimization-stack' of github.com:stefan-woerner/qiskit…
Cryoris Apr 8, 2020
5c357f9
Merge branch 'optimization-stack' of git://github.com/stefan-woerner/…
adekusar-drl Apr 8, 2020
58954cd
Merge branch 'optimization-stack' into rename-qp
t-imamichi Apr 8, 2020
e5b2cec
test cplex installation
manoelmarques Apr 8, 2020
f929bfb
fixed decode func for continuous variables
a-matsuo Apr 9, 2020
06b35aa
fixed format and added docstrings for the test
a-matsuo Apr 9, 2020
07556cc
Merge remote-tracking branch 'wor/optimization-stack' into rename-qp
t-imamichi Apr 9, 2020
e746772
fix some codes after merge of upstream
t-imamichi Apr 9, 2020
f885b40
Merge pull request #61 from a-matsuo/bug_continuous_var
stefan-woerner Apr 9, 2020
c9fd8a4
change None for not impl error
Cryoris Apr 9, 2020
a09000b
is_compatible returns bool and raises
Cryoris Apr 9, 2020
d0325ed
adding support for quadratic constraints
adekusar-drl Apr 9, 2020
c6b89c7
Merge branch 'optimization-stack' of git://github.com/stefan-woerner/…
adekusar-drl Apr 9, 2020
8fcf270
fixing imports
adekusar-drl Apr 9, 2020
c26fab5
Merge remote-tracking branch 'wor/optimization-stack' into rename-qp
t-imamichi Apr 9, 2020
fbc4581
rename OptimizationProblem with QuadraticProgram in test_converters
t-imamichi Apr 9, 2020
5ded0f6
fix lint
manoelmarques Apr 9, 2020
4495760
commenting out quad constraints support
adekusar-drl Apr 9, 2020
110bfff
fix typos, add references
Cryoris Apr 9, 2020
8d7d9b3
Merge branch 'pr/60' into optimization-stack
stefan-woerner Apr 9, 2020
1bfabb4
is_compatible for bool, get_incomptability for msg
Cryoris Apr 9, 2020
1a488bb
fix lint
manoelmarques Apr 9, 2020
caecebc
Merge branch 'optimization-stack' of github.com:stefan-woerner/qiskit…
Cryoris Apr 9, 2020
b66602d
incompatibility in admm / cplex optimizer
Cryoris Apr 9, 2020
7686592
rename to compatibility_msg
Cryoris Apr 9, 2020
0f64d68
Merge branch 'master' into optimization-stack
manoelmarques Apr 9, 2020
f6f0aed
== not >
Cryoris Apr 9, 2020
369c7f0
Merge branch 'optimization-stack' of github.com:stefan-woerner/qiskit…
Cryoris Apr 9, 2020
417595c
Merge branch 'optimization-stack' into austin-master
Cryoris Apr 9, 2020
cb72211
Merge pull request #2 from Cryoris/austin-master
AustinGilliam Apr 9, 2020
5496ca4
Merge pull request #63 from Cryoris/is-compatible
stefan-woerner Apr 9, 2020
7f2d1c5
update cplex optimizer
stefan-woerner Apr 9, 2020
1c3f72d
Merge branch 'optimization-stack' of github.com:stefan-woerner/qiskit…
stefan-woerner Apr 9, 2020
ad4bbd9
update cplex display settings
stefan-woerner Apr 9, 2020
1416c5f
Merge branch 'optimization-stack' of git://github.com/stefan-woerner/…
adekusar-drl Apr 9, 2020
6ed122c
fix spell
manoelmarques Apr 9, 2020
190115b
Merge branch 'master' into optimization-stack
manoelmarques Apr 9, 2020
b5111cf
update recursive min optimizer docstring
Cryoris Apr 10, 2020
2e69d97
Merge branch 'optimization-stack' of github.com:stefan-woerner/qiskit…
Cryoris Apr 10, 2020
27349fb
(Re)move utils (#67)
Cryoris Apr 10, 2020
8809557
(Re)move results (#68)
Cryoris Apr 10, 2020
4f96e9f
merge master fixed conflicts
manoelmarques Apr 11, 2020
a5e1549
Merge branch 'master' into optimization-stack
manoelmarques Apr 13, 2020
cbce5f5
merge fix conflicts
manoelmarques Apr 14, 2020
cae1bce
merge fix conflicts
manoelmarques Apr 14, 2020
caebfc0
update quadratic program, linear expression, linear constraint, varia…
stefan-woerner Apr 14, 2020
d287264
add quadratic_expression
stefan-woerner Apr 14, 2020
ae8ca24
add quadratic constraint and tests
stefan-woerner Apr 14, 2020
5ec7fd3
add quadratic objective
stefan-woerner Apr 14, 2020
bc5705d
Update quadratic_program.py
stefan-woerner Apr 14, 2020
0c6e324
add linear_constraint
t-imamichi Apr 15, 2020
848a131
revise constraints
t-imamichi Apr 15, 2020
5951bba
fix tests and avoid cyclic import
t-imamichi Apr 15, 2020
c582ef6
fix default quadratic constraint name
t-imamichi Apr 15, 2020
fe60f27
Update test_quadratic_program.py
stefan-woerner Apr 15, 2020
5f8f11a
moving to a new optimization stack
adekusar-drl Apr 15, 2020
ea0c6bc
Merge branch 'new_quadratic_program' of git://github.com/stefan-woern…
adekusar-drl Apr 15, 2020
1241b82
Merge pull request #76 from t-imamichi/ima-qp
stefan-woerner Apr 15, 2020
c0ca02a
Merge branch 'new_quadratic_program' of github.com:stefan-woerner/qis…
stefan-woerner Apr 15, 2020
c629866
update constraints handling
stefan-woerner Apr 15, 2020
22b0efd
Update constraint.py
stefan-woerner Apr 15, 2020
dccd22e
moving to a new optimization stack
adekusar-drl Apr 15, 2020
d7aaf31
Merge branch 'new_quadratic_program' of git://github.com/stefan-woern…
adekusar-drl Apr 15, 2020
f5b4945
add __getitem__() to linear and quadratic expressions
stefan-woerner Apr 15, 2020
d8d1e6c
make constants upper case
stefan-woerner Apr 15, 2020
ce371d2
(wip) substitute_variables
t-imamichi Apr 15, 2020
562179c
Merge remote-tracking branch 'wor/new_quadratic_program' into subs
t-imamichi Apr 15, 2020
b337a95
Alpha version of substitute_variables
t-imamichi Apr 15, 2020
1ad5487
moving to a new optimization stack
adekusar-drl Apr 15, 2020
1b2a95c
Merge branch 'new_quadratic_program' of git://github.com/stefan-woern…
adekusar-drl Apr 15, 2020
4869dca
rename "coefficients_as_dict/array" to "to_dict/array" in linear/quad…
stefan-woerner Apr 15, 2020
c7b7e76
add read/write functionality to QP
stefan-woerner Apr 15, 2020
a3371d7
Update quadratic_program.py
stefan-woerner Apr 15, 2020
6f6bc0e
update cplex_optimizer and tests
stefan-woerner Apr 15, 2020
aabe2fe
Update quadratic_program.py
stefan-woerner Apr 15, 2020
fdeda83
Merge branch 'pr/58' into optimization-stack
stefan-woerner Apr 15, 2020
9e4f7fb
merge grover_optimizer updates
stefan-woerner Apr 15, 2020
8f12c60
moving to a new optimization stack
adekusar-drl Apr 15, 2020
c673b30
Merge branch 'new_quadratic_program' of git://github.com/stefan-woern…
adekusar-drl Apr 15, 2020
80cf4ed
fix spell, lint, unit test
manoelmarques Apr 15, 2020
c5f4cfb
Merge remote-tracking branch 'wor/new_quadratic_program' into subs
t-imamichi Apr 16, 2020
0bfabeb
merge upstream
t-imamichi Apr 16, 2020
0cdcb40
cleanup
t-imamichi Apr 16, 2020
3bfad48
add a test of substitute_variables
t-imamichi Apr 16, 2020
5ac53b8
replace use_index with use_name
t-imamichi Apr 16, 2020
e601ae0
allow integer as lower bound and upper bound of variable
t-imamichi Apr 16, 2020
f159892
change qp as well
t-imamichi Apr 16, 2020
c511ac0
update int to bin converter to use new QP interface
stefan-woerner Apr 16, 2020
bc0e293
Merge pull request #77 from t-imamichi/subs
stefan-woerner Apr 16, 2020
6dc23e2
Merge pull request #78 from t-imamichi/lb_ub
stefan-woerner Apr 16, 2020
b2b96e7
rename converters without "converter" in name
stefan-woerner Apr 16, 2020
49d46a1
Merge branch 'new_quadratic_program' of github.com:stefan-woerner/qis…
stefan-woerner Apr 16, 2020
75d6238
update qubo to operator + some minor fixes
stefan-woerner Apr 16, 2020
6702696
moving to a new optimization stack
adekusar-drl Apr 16, 2020
59f8efe
Merge branch 'new_quadratic_program' of git://github.com/stefan-woern…
adekusar-drl Apr 16, 2020
d5729b4
ignore trivial constraints (0 == 0) when converting to docplex
stefan-woerner Apr 16, 2020
26f571b
moving to a new optimization stack
adekusar-drl Apr 16, 2020
460f5d3
Merge branch 'new_quadratic_program' of git://github.com/stefan-woern…
adekusar-drl Apr 16, 2020
f8780f5
Update quadratic_program.py
stefan-woerner Apr 16, 2020
f280a1e
Update quadratic_program_to_qubo.py
stefan-woerner Apr 16, 2020
9917c6b
moving to a new optimization stack
adekusar-drl Apr 16, 2020
8a027db
poc
t-imamichi Apr 17, 2020
70b05fb
modified InequalityToEquality converter for new QuadraticProgram APIs
a-matsuo Apr 17, 2020
cd84a03
Fix issues in integer_to_binary
t-imamichi Apr 17, 2020
cacc87f
bug fixes
stefan-woerner Apr 17, 2020
e545013
Merge pull request #82 from t-imamichi/fix-intbin
stefan-woerner Apr 17, 2020
76c6930
removed importing cplex and fixied linting
a-matsuo Apr 17, 2020
f0e96d5
Merge pull request #80 from a-matsuo/ineq2eq_converter_newAPI
stefan-woerner Apr 17, 2020
e61e2e0
update QP and tests
stefan-woerner Apr 17, 2020
20990fa
add __setitem__ to linear/quadratic expression
stefan-woerner Apr 17, 2020
add5c1c
update recursive minimum eigen optimizer
stefan-woerner Apr 17, 2020
6ebd54e
removing 2* from quad objective
ClaudioG-drl Apr 17, 2020
704a0ab
moving to a new optimization stack
adekusar-drl Apr 17, 2020
1476853
removing 2* from quad objective
ClaudioG-drl Apr 17, 2020
38839fc
fix in step2
ClaudioG-drl Apr 17, 2020
1779131
fix in get_obj_val
ClaudioG-drl Apr 17, 2020
a687f3a
fix in get_obj_val
ClaudioG-drl Apr 17, 2020
490da57
fix in get_obj_val
ClaudioG-drl Apr 17, 2020
3c13931
Merge branch 'new_quadratic_program' of https://github.com/adekusar-d…
ClaudioG-drl Apr 17, 2020
87ca0f0
merge fix conflicts
manoelmarques Apr 17, 2020
c3ef149
Merge remote-tracking branch 'wor/new_quadratic_program' into symmetric
t-imamichi Apr 20, 2020
aa2bb98
Use compressed dictionary as the internal of quadratic expression
t-imamichi Apr 20, 2020
9573a4f
Merge branch 'new_quadratic_program' of git://github.com/stefan-woern…
adekusar-drl Apr 20, 2020
fa63fae
minor
ClaudioG-drl Apr 20, 2020
4a2297b
Merge pull request #86 from t-imamichi/symmetric
stefan-woerner Apr 20, 2020
5dc3299
Merge remote-tracking branch 'origin/new_quadratic_program' into new_…
adekusar-drl Apr 20, 2020
0dbb5a5
Update optimization_algorithm.py
stefan-woerner Apr 20, 2020
a916cfe
Merge branch 'new_quadratic_program' of github.com:stefan-woerner/qis…
stefan-woerner Apr 20, 2020
570db1f
Merge branch 'master' into optimization-stack
manoelmarques Apr 20, 2020
e700a4d
fix a type hint
t-imamichi Apr 20, 2020
034dcaa
moving to a new optimization stack
adekusar-drl Apr 20, 2020
6ba1f63
Merge branch 'new_quadratic_program' of git://github.com/stefan-woern…
adekusar-drl Apr 20, 2020
643dacb
moving to a new optimization stack
adekusar-drl Apr 20, 2020
a0f656a
use the internal Status directly
t-imamichi Apr 20, 2020
f5cad57
linting
adekusar-drl Apr 20, 2020
3504c63
Merge branch 'master' into optimization-stack
manoelmarques Apr 20, 2020
28b59f2
Merge pull request #88 from adekusar-drl/new_quadratic_program
stefan-woerner Apr 21, 2020
77234f6
Merge pull request #87 from t-imamichi/conv
stefan-woerner Apr 21, 2020
844ea36
rename penalize equality constraints converter
stefan-woerner Apr 21, 2020
fc7e1b8
converter bug fixes
stefan-woerner Apr 21, 2020
e690725
minor re-writing get_bet_merit_solution
ClaudioG-drl Apr 21, 2020
f7411f5
Merge branch 'new_quadratic_program' of https://github.com/adekusar-d…
ClaudioG-drl Apr 21, 2020
dabd821
minor re-writing get_bet_merit_solution
ClaudioG-drl Apr 21, 2020
52589f1
Fix unit tests related to quadratic expressions
t-imamichi Apr 21, 2020
f6f84e6
Merge pull request #90 from t-imamichi/fix-qp
stefan-woerner Apr 21, 2020
cd6495d
Fix the declaration of __init__.py
t-imamichi Apr 21, 2020
10027c7
Small fixes for pylint
t-imamichi Apr 21, 2020
f5bb7b1
moving to 'evaluate' in objective cost and constraints
adekusar-drl Apr 21, 2020
7942e11
Merge pull request #91 from t-imamichi/fix-init-qp
stefan-woerner Apr 21, 2020
c1cc535
added operator_to_quadratic_probram for new QP APIs
a-matsuo Apr 21, 2020
46e9631
Current GroverOptimizer Code, New QP Interface WIP
AustinGilliam Apr 21, 2020
2738819
Merge branch 'master' into optimization-stack
manoelmarques Apr 21, 2020
a50127c
GroverOptimizer Uses New QP Interface
AustinGilliam Apr 21, 2020
46c7689
added unittests
a-matsuo Apr 21, 2020
941a71d
Add more tests of QuadraticProgram
t-imamichi Apr 22, 2020
a2ba76a
Merge pull request #95 from t-imamichi/qp-test
stefan-woerner Apr 22, 2020
5811e71
Merge pull request #92 from a-matsuo/operator_to_qubo_newAPI
stefan-woerner Apr 22, 2020
3fe6486
Merge pull request #94 from a-matsuo/unittest_converter_newQPAPI
stefan-woerner Apr 22, 2020
3c3893f
Merge pull request #93 from AustinGilliam/new_quadratic_program
stefan-woerner Apr 22, 2020
484e341
Update test_quadratic_program_to_negative_value_oracle.py
stefan-woerner Apr 22, 2020
945d21c
formatting, renaming, minor changes
adekusar-drl Apr 22, 2020
a0d371f
Merge branch 'new_quadratic_program' into optimization-stack
stefan-woerner Apr 22, 2020
df5202b
Update grover_optimizer.py
stefan-woerner Apr 22, 2020
301b66a
Add a missing sample LP file for test_quadratic_program
t-imamichi Apr 22, 2020
63b59e7
small fix of parsing problem name of LP file
t-imamichi Apr 22, 2020
0dbfb8a
lint fix
stefan-woerner Apr 22, 2020
8bbe81f
Merge branch 'new_quadratic_program' of git://github.com/stefan-woern…
adekusar-drl Apr 22, 2020
285e1d2
Merge branch 'pr/96' into optimization-stack
stefan-woerner Apr 22, 2020
ac6b16a
fix spell, lint
manoelmarques Apr 22, 2020
d16a233
fix a typo
t-imamichi Apr 23, 2020
c5d4d53
Merge pull request #97 from t-imamichi/typo
stefan-woerner Apr 23, 2020
8518268
only test based on exact solver (other redundant)
Cryoris Apr 23, 2020
1ae839a
fix random seeds
Cryoris Apr 23, 2020
bd68161
add remove linear/quadratic constraints
t-imamichi Apr 23, 2020
b86b3e4
Merge pull request #101 from t-imamichi/removal2
stefan-woerner Apr 23, 2020
f17a06f
remove util.py
stefan-woerner Apr 23, 2020
e907b73
Merge branch 'optimization-stack' of github.com:stefan-woerner/qiskit…
stefan-woerner Apr 23, 2020
44637ac
Update quadratic_program_to_qubo.py
stefan-woerner Apr 23, 2020
fb19c61
fix a factor
t-imamichi Apr 23, 2020
a5623c6
merge fix conflicts
manoelmarques Apr 23, 2020
e22120f
Bump Terra version requirements to 0.14.0
manoelmarques Apr 23, 2020
310cc07
fix var_form initialization
manoelmarques Apr 23, 2020
e482836
check cplex installed on unit tests
manoelmarques Apr 23, 2020
d858788
step2 generation based on a copy
adekusar-drl Apr 23, 2020
e2ec863
step2 generation based on a copy
adekusar-drl Apr 23, 2020
29a1f5e
step2 generation based on a copy
adekusar-drl Apr 23, 2020
745fbc3
formatting, renaming, minor changes
adekusar-drl Apr 23, 2020
539c4da
Merge pull request #1 from adekusar-drl/new_quadratic_program
adekusar-drl Apr 23, 2020
c9ae592
Merge branch 'optimization-stack' of git://github.com/stefan-woerner/…
adekusar-drl Apr 23, 2020
0688301
Merge branch 'master' into optimization-stack
manoelmarques Apr 23, 2020
ce81794
Merge branch 'master' into optimization-stack
manoelmarques Apr 23, 2020
c0d81a8
fixing converters / compatibility checks of algorithms
stefan-woerner Apr 24, 2020
72caac1
clean grover code (remove debugging lines)
stefan-woerner Apr 24, 2020
a43cf7e
fix IQFT and random seeds
Cryoris Apr 24, 2020
af416f5
Merge branch 'optimization-stack' of github.com:stefan-woerner/qiskit…
Cryoris Apr 24, 2020
9668020
Update test_quadratic_program_to_negative_value_oracle.py
stefan-woerner Apr 24, 2020
281c5c5
Update operator_to_quadratic_program.py
stefan-woerner Apr 24, 2020
3d90483
Add QuadraticProgram.Status to replace SubstitutionStatus
t-imamichi Apr 24, 2020
9a81ffa
Merge pull request #102 from t-imamichi/fix-recursive
stefan-woerner Apr 24, 2020
b9b1b1f
Merge pull request #103 from t-imamichi/qp-status
stefan-woerner Apr 24, 2020
80882bb
add a test of status for clear
t-imamichi Apr 24, 2020
9a3fdfa
Merge pull request #104 from t-imamichi/qp-status
stefan-woerner Apr 24, 2020
4093ae0
Embed enum data in classes
t-imamichi Apr 24, 2020
b44ce32
minor
ClaudioG-drl Apr 24, 2020
745b412
tune
t-imamichi Apr 24, 2020
7d6e066
enable type hint of enums
t-imamichi Apr 24, 2020
8b0eb9d
supporting equality and quadratic constraints
ClaudioG-drl Apr 24, 2020
76b7c82
Merge pull request #105 from t-imamichi/embed
stefan-woerner Apr 24, 2020
329d614
more simplifications
adekusar-drl Apr 24, 2020
f3a172e
admm tests on equality and quadratic constraints
ClaudioG-drl Apr 24, 2020
eab98bd
fixes and more testing
adekusar-drl Apr 24, 2020
3ae0579
deal with from_docplex corner cases
t-imamichi Apr 24, 2020
58f0bbd
more simplifications, linting
adekusar-drl Apr 24, 2020
17247bd
linting
adekusar-drl Apr 24, 2020
0ca45dd
Merge branch 'optimization-stack' of git://github.com/stefan-woerner/…
adekusar-drl Apr 24, 2020
bbdf00e
linting
adekusar-drl Apr 24, 2020
67d1cde
Update quadratic_program.py
stefan-woerner Apr 25, 2020
e0219fc
Merge branch 'master' into optimization-stack
manoelmarques Apr 25, 2020
b1cde10
easy part of steve's comments
Cryoris Apr 26, 2020
e08d354
part 2 of steve's comments
Cryoris Apr 26, 2020
a579096
add comments
t-imamichi Apr 27, 2020
42ae77a
Merge remote-tracking branch 'wor/optimization-stack' into docplex
t-imamichi Apr 27, 2020
f8256ac
Merge pull request #106 from t-imamichi/docplex
stefan-woerner Apr 27, 2020
d5bdad1
Merge branch 'pr/108' into optimization-stack
stefan-woerner Apr 27, 2020
3b03d8e
fix problem with int2bin converter
stefan-woerner Apr 27, 2020
60bf662
enabled int2bin converter
adekusar-drl Apr 27, 2020
5f2d080
Merge pull request #110 from adekusar-drl/master
stefan-woerner Apr 27, 2020
5f88f19
update problems __init__.py docstring
stefan-woerner Apr 27, 2020
40cb782
Merge branch 'optimization-stack' of github.com:stefan-woerner/qiskit…
stefan-woerner Apr 27, 2020
871f146
style fixes
stefan-woerner Apr 27, 2020
13c57e1
rename `HasQuadraticProgram` to `QuadraticProgramElement`
stefan-woerner Apr 27, 2020
7c0b3b0
rename `HasQuadraticProgram` to `QuadraticProgramElement` (2)
stefan-woerner Apr 27, 2020
34f8a7d
module level docstrings, offset test
Cryoris Apr 27, 2020
609768a
fix spell & test
Cryoris Apr 27, 2020
9bd75fb
Merge branch 'optimization-stack' into part2-steve
Cryoris Apr 27, 2020
6686087
leftover fixes
Cryoris Apr 27, 2020
e30789c
Merge pull request #109 from stefan-woerner/part2-steve
stefan-woerner Apr 27, 2020
d53845b
update changelog and ADMM docstring
stefan-woerner Apr 27, 2020
4253c89
fix write to dir, use new tempfile functionality
Cryoris Apr 27, 2020
5ee9d6d
Merge branch 'optimization-stack' of github.com:stefan-woerner/qiskit…
Cryoris Apr 27, 2020
18a4a52
fix docstring
manoelmarques Apr 27, 2020
88eb071
add changelog
Cryoris Apr 27, 2020
2c86e66
remove Grover Optimization changelog
Cryoris Apr 27, 2020
040d31a
trigger CLA check
manoelmarques Apr 27, 2020
ee47bdb
fix qasm string on unit tests
manoelmarques Apr 27, 2020
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
92 changes: 82 additions & 10 deletions .pylintdict

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,25 @@ Added
- Chemistry stack automatic Z2 symmetry reduction (#870)
- Ising Optimization: The 0-1 Knapsack problem (#878)
- VQE, VQC and QSVM accept `QuantumCircuit`s as variational forms/feature maps (#905)
- New `GSLS` (Gaussian Smoothing Line Search) optimizer for variational algorithms (#877)
- Qiskit optimization, an application stack for solving quadratic programs (#877)
- QuadraticProblem: A class representing quadratic programs with quadratic and linear objective and constraints
- OptimizationAlgorithm: A base class for optimization algorithm
- OptimizationResult: A base class for optimization results
- Summary of the optimization algorithms:
- MinimumEigenOptimizer: An optimization algorithm using a minimum eigen solver, such as VQE (or a classical alternative). See the MinimumEigenSolver algorithms in Aqua.
- GroverOptimizer: The Grover Adaptive Search algorithm (Gilliam et al.)
- ADMMOptimizer: The ADMM-based heuristic (Gambella et al.)
- RecursiveMinimumEigenOptimizer: A meta-algorithm applying recursive optimization on top of a MinimumEigenOptimizer (Bravyi et al.)
- CobylaOptimizer: Wrapping of SciPy’s COBYLA subroutine as optimization algorithm
- CplexOptimizer: Wrapping the CPLEX API as optimization algorithm
- A set of converters to translate different problem representations
- InequalityToEquality: Converts inequality constraints to equality constraints by adding slack variables
- IntegerToBinary: Converts integer variables to binary variables
- LinearEqualityToPenalty: Converts linear equality constraints to quadratic penalty terms that are added to the objective
- QuadraticProgramToOperator: Converts a QuadraticProgram to an Aqua operator
- QuadraticProgramToNegativeValueOracle: Converts a QuadraticProgram to a negative-value oracle used for Grover Adaptive Search
- QuadraticProgramToQubo: Converts a QuadraticProgram to a QUBO problem, a convenience converter wrapping the functionality of the IntegerToBinary and LinearEqualityToPenalty converters

Changed
-------
Expand Down
86 changes: 43 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
Qiskit is made up elements that work together to enable quantum computing. This element is **Aqua**
(Algorithms for QUantum computing Applications) providing a library of cross-domain algorithms
upon which domain-specific applications can be built.

* [Aqua](#aqua)

Aqua includes domain application support for:

* [Chemistry](#chemistry)
Expand All @@ -19,10 +19,10 @@ Aqua includes domain application support for:

_**Note**: the Chemistry application stack was the first domain worked on. At the time of writing
the other domains have some logic in them but are not as fully realised. Future work is expected to
build out functionality in all application areas._
build out functionality in all application areas._

Aqua was designed to be extensible, and uses a framework where algorithms and support objects used
by algorithms, such as optimizers, variational forms, and oracles etc,. are derived from a defined
by algorithms, such as optimizers, variational forms, and oracles etc,. are derived from a defined
base class for the type. These along with other building blocks provide a means for end-users and
developers alike to have flexibility and facilitate building and experimenting with different
configurations and capability.
Expand Down Expand Up @@ -52,34 +52,34 @@ To do this follow the instructions in the

Note: there some optional packages that can be installed such as IBM CPLEX for Aqua and ab-initio
chemistry libraries/programs. Refer to Optional Install information in the sections below.

Note: _Optional install links are currently pointing to the source documentation in the code.
At the time of writing the qiskit.org [API Documentation](https://qiskit.org/documentation)
At the time of writing the qiskit.org [API Documentation](https://qiskit.org/documentation)
is being reworked and these links will be redone to point there once the documentation is
updated and republished._
updated and republished._

----------------------------------------------------------------------------------------------------

## Aqua

The `qiskit.aqua` package contains the core cross-domain algorithms and supporting logic to run
these on a quantum backend, whether a real device or simulator.
these on a quantum backend, whether a real device or simulator.

### Optional Installs

* **IBM CPLEX** may be [installed](qiskit/aqua/algorithms/minimum_eigen_solvers/cplex/__init__.py#L16)
* **IBM CPLEX** may be [installed](qiskit/aqua/algorithms/minimum_eigen_solvers/cplex/__init__.py#L16)
to allow use of the `ClassicalCPLEX` classical solver algorithm.
* **PyTorch**, may be installed either using command `pip install qiskit-aqua[torch]` to install the
package or refer to PyTorch [getting started](https://pytorch.org/get-started/locally/). PyTorch
being installed will enable the neural networks `PyTorchDiscriminator` component to be used with
the QGAN algorithm.
the QGAN algorithm.


### Creating Your First Quantum Program in Qiskit Aqua

Now that Qiskit is installed, it's time to begin working with Aqua.
Let's try an experiment using `Grover`'s algorithm to find a solution for a
Satisfiability (SAT) problem.
Satisfiability (SAT) problem.

```
$ python
Expand Down Expand Up @@ -121,7 +121,7 @@ Form (CNF):
(&not;<i>x</i><sub>1</sub> &or; <i>x</i><sub>2</sub> &or; <i>x</i><sub>3</sub>)

The Python code above prints out one possible solution for this CNF.
For example, output `1, -2, 3` indicates that logical expression
For example, output `1, -2, 3` indicates that logical expression
(<i>x</i><sub>1</sub> &or; &not;<i>x</i><sub>2</sub> &or; <i>x</i><sub>3</sub>)
satisfies the given CNF.

Expand All @@ -138,26 +138,26 @@ and
## Chemistry

The `qiskit.chemistry` package supports problems including ground state energy computations,
excited states and dipole moments of molecule, both open and closed-shell.
excited states and dipole moments of molecule, both open and closed-shell.

The code comprises chemistry drivers, which when provided with a molecular
configuration will return one and two-body integrals as well as other data that is efficiently
configuration will return one and two-body integrals as well as other data that is efficiently
computed classically. This output data from a driver can then be used as input to the chemistry
application stack that contains logic which is able to translate this into a form that is suitable
for quantum algorithms. The conversion first creates a FermionicOperator which must then be mapped,
e.g. by a Jordan Wigner mapping, to a qubit operator in readiness for the quantum computation.
e.g. by a Jordan Wigner mapping, to a qubit operator in readiness for the quantum computation.

### Optional Installs

To run chemistry experiments using Qiskit Chemistry, it is recommended that you to install a
classical computation chemistry software program/library interfaced by Qiskit Chemistry.
classical computation chemistry software program/library interfaced by Qiskit Chemistry.
Several, as listed below, are supported, and while logic to interface these programs is supplied by
Qiskit Chemistry via the above pip installation, the dependent programs/libraries themselves need
to be installed separately.

Note: As `PySCF` can be installed via pip the installation of Qiskit (Aqua) will install PySCF
where it's supported (MacOS and Linux x86). For other platforms see the PySCF information as to
whether this might be possible manually.
whether this might be possible manually.

1. [Gaussian 16&trade;](qiskit/chemistry/drivers/gaussiand/__init__.py#L16), a commercial chemistry program
2. [PSI4](qiskit/chemistry/drivers/psi4d/__init__.py#L16), a chemistry program that exposes a Python interface allowing for accessing internal objects
Expand All @@ -168,14 +168,14 @@ whether this might be possible manually.

A useful functionality integrated into Qiskit Chemistry is its ability to serialize a file in
Hierarchical Data Format 5 (HDF5) format representing all the output data from a chemistry driver.

The [HDF5 driver](qiskit/chemistry/drivers/hdf5d/hdf5driver.py#L25)
accepts such such HDF5 files as input so molecular experiments can be run, albeit on the fixed data
as stored in the file. As such, if you have some pre-created HDF5 files from created from Qiskit
Chemistry, you can use these with the HDF5 driver even if you do not install one of the classical
computation packages listed above.
computation packages listed above.

A few sample HDF5 files for different are provided in the
A few sample HDF5 files for different are provided in the
[chemistry folder](https://github.com/Qiskit/qiskit-community-tutorials/tree/master/chemistry)
of the [Qiskit Community Tutorials](https://github.com/Qiskit/qiskit-community-tutorials)
repository. This
Expand All @@ -186,7 +186,7 @@ contains further information about creating and using such HDF5 files.

Now that Qiskit is installed, it's time to begin working with Chemistry.
Let's try a chemistry application experiment using VQE (Variational Quantum Eigensolver) algorithm
to compute the ground-state (minimum) energy of a molecule.
to compute the ground-state (minimum) energy of a molecule.

```python
from qiskit.chemistry import FermionicOperator
Expand Down Expand Up @@ -237,20 +237,20 @@ The program above uses a quantum computer to calculate the ground state energy o
H<sub>2</sub>, where the two atoms are configured to be at a distance of 0.735 angstroms. The molecular
input specification is processed by PySCF driver and data is output that includes one- and
two-body molecular-orbital integrals. From the output a fermionic-operator is created which is then
parity mapped to generate a qubit operator. Parity mappings allow a precision-preserving optimization
parity mapped to generate a qubit operator. Parity mappings allow a precision-preserving optimization
that two qubits can be tapered off; a reduction in complexity that is particularly advantageous for NISQ
computers.

The qubit operator is then passed as an input to the Variational Quantum Eigensolver (VQE) algorithm,
instantiated with a classical optimizer and an RyRz variational form (ansatz). A Hartree-Fock
instantiated with a classical optimizer and an RyRz variational form (ansatz). A Hartree-Fock
initial state is used as a starting point for the variational form.

The VQE algorithm is then run, in this case on the Qiskit Aer statevector simulator backend.
Here we pass a backend but it can be wrapped into a `QuantumInstance`, and that passed to the
`run` instead. The `QuantumInstance` API allows you to customize run-time properties of the backend,
such as the number of shots, the maximum number of credits to use, settings for the simulator,
initial layout of qubits in the mapping and the Terra `PassManager` that will handle the compilation
of the circuits. By passing in a backend as is done above it is internally wrapped into a
of the circuits. By passing in a backend as is done above it is internally wrapped into a
`QuantumInstance` and is a convenience when default setting suffice.

### Further examples
Expand All @@ -267,7 +267,7 @@ and

The `qiskit.finance` package contains uncertainty components for stock/securities problems,
Ising translators for portfolio optimizations and data providers to source real or random data to
finance experiments.
finance experiments.

### Creating Your First Qiskit Finance Programming Experiment

Expand Down Expand Up @@ -312,20 +312,20 @@ and
[qiskit-community-tutorials/finance](https://github.com/Qiskit/qiskit-community-tutorials/tree/master/finance).

----------------------------------------------------------------------------------------------------

## Machine Learning

The `qiskit.ml` package simply contains sample datasets at present. `qiskit.aqua` has some
classification algorithms such as QSVM and VQC (Variational Quantum Classifier), where this data
can be used for experiments, and there is also QGAN (Quantum Generative Adversarial Network)
algorithm.
algorithm.

### Creating Your First Qiskit Machine Learning Programming Experiment

Now that Qiskit is installed, it's time to begin working with Machine Learning.
Let's try a experiment using VQC (Variational Quantum Classified) algorithm to
train and test samples from a data set to see how accurately the test set can
be classified.
be classified.

```python
from qiskit import BasicAer
Expand Down Expand Up @@ -371,17 +371,17 @@ and

## Optimization

The `qiskit.optimization` package contains Ising translators for various optimization problems such
The `qiskit.optimization` package contains Ising translators for various optimization problems such
as Max-Cut, Traveling Salesman and Vehicle Routing. It also has a has an automatic Ising
generator for a problem model specified by the user as a model in
[docplex](qiskit/optimization/ising/docplex.py#L16).
[docplex](qiskit/optimization/ising/docplex.py#L16).

### Creating Your First Qiskit Optimization Programming Experiment

Now that Qiskit is installed, it's time to begin working with Optimization.
Let's try a optimization experiment using QAOA (Quantum Approximate Optimization Algorithm)
to compute the solution of a [Max-Cut](https://en.wikipedia.org/wiki/Maximum_cut) problem using
a docplex model to create the Ising Hamiltonian operator for QAOA.
a docplex model to create the Ising Hamiltonian operator for QAOA.

```python
import networkx as nx
Expand All @@ -392,8 +392,8 @@ from qiskit import BasicAer
from qiskit.aqua import aqua_globals, QuantumInstance
from qiskit.aqua.algorithms import QAOA
from qiskit.aqua.components.optimizers import SPSA
from qiskit.optimization.ising import docplex, max_cut
from qiskit.optimization.ising.common import sample_most_likely
from qiskit.optimization.applications.ising import docplex, max_cut
from qiskit.optimization.applications.ising.common import sample_most_likely

# Generate a graph of 4 nodes
n = 4
Expand Down Expand Up @@ -425,7 +425,7 @@ spsa = SPSA(max_trials=250)
qaoa = QAOA(qubit_op, spsa, p=5)
backend = BasicAer.get_backend('qasm_simulator')
quantum_instance = QuantumInstance(backend, shots=1024, seed_simulator=seed,
seed_transpiler=seed)
seed_transpiler=seed)
result = qaoa.run(quantum_instance)

x = sample_most_likely(result.eigenstate)
Expand Down Expand Up @@ -471,24 +471,24 @@ For questions that are more suited for a forum, we use the **Qiskit** tag in [St

## Next Steps

Now you're set up and ready to check out some of the other examples from the
Now you're set up and ready to check out some of the other examples from the
[Qiskit IQX Tutorials](https://github.com/Qiskit/qiskit-iqx-tutorials)
repository, that are used for the IBM Quantum Experience, and from the
[Qiskit Community Tutorials](https://github.com/Qiskit/qiskit-community-tutorials).
repository, that are used for the IBM Quantum Experience, and from the
[Qiskit Community Tutorials](https://github.com/Qiskit/qiskit-community-tutorials).


## Authors and Citation

Aqua was inspired, authored and brought about by the collective work of a team of researchers.
Aqua continues to grow with the help and work of
Aqua continues to grow with the help and work of
[many people](https://github.com/Qiskit/qiskit-aqua/graphs/contributors), who contribute
to the project at different levels.
If you use Qiskit, please cite as per the provided
to the project at different levels.
If you use Qiskit, please cite as per the provided
[BibTeX file](https://github.com/Qiskit/qiskit/blob/master/Qiskit.bib).

Please note that if you do not like the way your name is cited in the BibTex file then consult
the information found in the [.mailmap](https://github.com/Qiskit/qiskit-aqua/blob/master/.mailmap)
file.
file.

## License

Expand Down
6 changes: 0 additions & 6 deletions docs/apidocs/qiskit.finance.ising.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/apidocs/qiskit.optimization.ising.rst

This file was deleted.

22 changes: 9 additions & 13 deletions qiskit/aqua/algorithms/eigen_solvers/numpy_eigen_solver.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,15 @@

from qiskit.aqua import AquaError
from qiskit.aqua.algorithms import ClassicalAlgorithm
from qiskit.aqua.operators import op_converter
from qiskit.aqua.operators import BaseOperator
from qiskit.aqua.operators import BaseOperator, op_converter
from qiskit.aqua.utils.validation import validate_min
from .eigen_solver_result import EigensolverResult

logger = logging.getLogger(__name__)


# pylint: disable=invalid-name


class NumPyEigensolver(ClassicalAlgorithm):
r"""
The NumPy Eigensolver algorithm.
r"""The NumPy Eigensolver algorithm.

NumPy Eigensolver computes up to the first :math:`k` eigenvalues of a complex-valued square
matrix of dimension :math:`n \times n`, with :math:`k \leq n`.
Expand Down Expand Up @@ -66,7 +61,7 @@ def __init__(self, operator: Optional[BaseOperator] = None, k: int = 1,
self._operator = None
self._aux_operators = None
self._in_k = k
self._k = k
self._k = k # pylint: disable=invalid-name

self.operator = operator
self.aux_operators = aux_operators
Expand Down Expand Up @@ -132,6 +127,8 @@ def _check_set_k(self):
self._k = self._in_k

def _solve(self):
if self._operator is None:
raise ValueError('Operator is None but must be set!')
if self._operator.dia_matrix is None:
if self._k >= self._operator.matrix.shape[0] - 1:
logger.debug("SciPy doesn't support to get all eigenvalues, using NumPy instead.")
Expand Down Expand Up @@ -184,10 +181,11 @@ def _eval_aux_operators(self, wavefn, threshold=1e-12):
return np.asarray(values)

def _run(self):
"""
Run the algorithm to compute up to the requested k number of eigenvalues.
"""Run the algorithm to compute up to the requested k number of eigenvalues.

Returns:
dict: Dictionary of results

Raises:
AquaError: if no operator has been provided
"""
Expand Down Expand Up @@ -215,9 +213,7 @@ def _run(self):


class ExactEigensolver(NumPyEigensolver):
"""
The deprecated Eigensolver algorithm.
"""
"""The deprecated Eigensolver algorithm."""

def __init__(self, operator: BaseOperator, k: int = 1,
aux_operators: Optional[List[BaseOperator]] = None) -> None:
Expand Down
9 changes: 6 additions & 3 deletions qiskit/aqua/algorithms/minimum_eigen_solvers/qaoa/qaoa.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ class QAOA(VQE):

def __init__(self, operator: BaseOperator = None, optimizer: Optimizer = None, p: int = 1,
initial_state: Optional[InitialState] = None,
mixer: Optional[BaseOperator] = None, initial_point: Optional[np.ndarray] = None,
max_evals_grouped: int = 1, aux_operators: Optional[List[BaseOperator]] = None,
mixer: Optional[BaseOperator] = None,
initial_point: Optional[np.ndarray] = None,
max_evals_grouped: int = 1,
aux_operators: Optional[List[BaseOperator]] = None,
callback: Optional[Callable[[int, np.ndarray, float, float], None]] = None,
auto_conversion: bool = True,
quantum_instance: Optional[Union[QuantumInstance, BaseBackend]] = None) -> None:
Expand Down Expand Up @@ -105,7 +107,8 @@ def __init__(self, operator: BaseOperator = None, optimizer: Optimizer = None, p
:class:`~qiskit.aqua.operators.WeightedPauliOperator`
- for *qasm simulator or real backend:*
:class:`~qiskit.aqua.operators.TPBGroupedWeightedPauliOperator`
quantum_instance: Quantum Instance or Backend
quantum_instance: Quantum instance or backend to be used, needs to be set here or when
the algorithm is executed.
"""
validate_min('p', p, 1)

Expand Down
Empty file modified qiskit/aqua/algorithms/minimum_eigen_solvers/qaoa/var_form.py
100644 → 100755
Empty file.
Loading