Skip to content

Commit 4e2ba0d

Browse files
stefan-woernerCryorismanoelmarquest-imamichiadekusar-drl
authored
Qiskit Optimization (qiskit-community/qiskit-aqua#877)
* implement first part of steve's comments * skip some unnecessary varform checks * Revert "skip some unnecessary varform checks" * rename OptimizationProblem with QuadraticProgram * test cplex installation * fixed decode func for continuous variables * fixed format and added docstrings for the test * fix some codes after merge of upstream * change None for not impl error * is_compatible returns bool and raises * adding support for quadratic constraints * fixing imports * rename OptimizationProblem with QuadraticProgram in test_converters * commenting out quad constraints support * fix typos, add references * is_compatible for bool, get_incomptability for msg * incompatibility in admm / cplex optimizer * rename to compatibility_msg * == not > * update cplex optimizer * update cplex display settings * update recursive min optimizer docstring examples should be in class level, not module level fix class level docstring in general * (Re)move utils (qiskit-community/qiskit-aqua#67) * reorganize utils * add missing init * fix import in test * (Re)move results (qiskit-community/qiskit-aqua#68) * move results to algo files * remove solution/qualitymetrics for now they are safely stored on another branch but are currently not used so there is no reason to have them in this release * move the results objects to algorithms * update quadratic program, linear expression, linear constraint, variable and tests * add quadratic_expression * add quadratic constraint and tests * add quadratic objective * Update quadratic_program.py * add linear_constraint * revise constraints * fix tests and avoid cyclic import * fix default quadratic constraint name * Update test_quadratic_program.py * moving to a new optimization stack * update constraints handling * Update constraint.py * moving to a new optimization stack * add __getitem__() to linear and quadratic expressions * make constants upper case * (wip) substitute_variables * Alpha version of substitute_variables Also moved name arg of linear_constraint and quadratic_constraint in the last * moving to a new optimization stack * rename "coefficients_as_dict/array" to "to_dict/array" in linear/quadratic expressions * add read/write functionality to QP * Update quadratic_program.py * update cplex_optimizer and tests * Update quadratic_program.py * merge grover_optimizer updates * moving to a new optimization stack * cleanup * add a test of substitute_variables * replace use_index with use_name * allow integer as lower bound and upper bound of variable * change qp as well * update int to bin converter to use new QP interface * rename converters without "converter" in name * update qubo to operator + some minor fixes * moving to a new optimization stack * ignore trivial constraints (0 == 0) when converting to docplex * moving to a new optimization stack * Update quadratic_program.py * Update quadratic_program_to_qubo.py * moving to a new optimization stack * poc * modified InequalityToEquality converter for new QuadraticProgram APIs * Fix issues in integer_to_binary * bug fixes * removed importing cplex and fixied linting * update QP and tests * add __setitem__ to linear/quadratic expression * update recursive minimum eigen optimizer * removing 2* from quad objective * moving to a new optimization stack * removing 2* from quad objective * fix in step2 * fix in get_obj_val * fix in get_obj_val * fix in get_obj_val * Use compressed dictionary as the internal of quadratic expression * minor * Update optimization_algorithm.py * fix a type hint * moving to a new optimization stack * moving to a new optimization stack * use the internal Status directly * linting * rename penalize equality constraints converter * converter bug fixes * minor re-writing get_bet_merit_solution * minor re-writing get_bet_merit_solution * Fix unit tests related to quadratic expressions * Fix the declaration of __init__.py * Small fixes for pylint * moving to 'evaluate' in objective cost and constraints * added operator_to_quadratic_probram for new QP APIs * Current GroverOptimizer Code, New QP Interface WIP * GroverOptimizer Uses New QP Interface * added unittests * Add more tests of QuadraticProgram * Update test_quadratic_program_to_negative_value_oracle.py * formatting, renaming, minor changes * Update grover_optimizer.py * Add a missing sample LP file for test_quadratic_program * small fix of parsing problem name of LP file * fix a typo * only test based on exact solver (other redundant) * fix random seeds * add remove linear/quadratic constraints * remove util.py * Update quadratic_program_to_qubo.py * fix a factor * Bump Terra version requirements to 0.14.0 * fix var_form initialization * check cplex installed on unit tests * step2 generation based on a copy * step2 generation based on a copy * step2 generation based on a copy * formatting, renaming, minor changes * fixing converters / compatibility checks of algorithms * clean grover code (remove debugging lines) * fix IQFT and random seeds * Update test_quadratic_program_to_negative_value_oracle.py * Update operator_to_quadratic_program.py * Add QuadraticProgram.Status to replace SubstitutionStatus * add a test of status for clear * Embed enum data in classes * minor * tune * enable type hint of enums * supporting equality and quadratic constraints * more simplifications * admm tests on equality and quadratic constraints * fixes and more testing * deal with from_docplex corner cases * more simplifications, linting * Update quadratic_program.py use `model.iter_{linear, quadratic}_constraints()` instead of `model.get_constraint_by_index(i)`, since the latter calls CPLEX which is not available in Python 3.8. * easy part of steve's comments * part 2 of steve's comments * add comments * fix problem with int2bin converter * enabled int2bin converter * update problems __init__.py docstring * rename `HasQuadraticProgram` to `QuadraticProgramElement` * rename `HasQuadraticProgram` to `QuadraticProgramElement` (2) * module level docstrings, offset test * fix spell & test * leftover fixes * update changelog and ADMM docstring * fix write to dir, use new tempfile functionality * fix docstring * add changelog * remove Grover Optimization changelog * trigger CLA check * fix qasm string on unit tests Co-authored-by: Cryoris <[email protected]> Co-authored-by: Manoel Marques <[email protected]> Co-authored-by: Takashi Imamichi <[email protected]> Co-authored-by: Anton Dekusar <[email protected]> Co-authored-by: Takashi Imamichi <[email protected]> Co-authored-by: Atsushi Matsuo <[email protected]> Co-authored-by: Austin Gilliam <[email protected]> Co-authored-by: Julien Gacon <[email protected]> Co-authored-by: Claudio Gambella <[email protected]> Co-authored-by: adekusar-drl <[email protected]>
1 parent 99649e7 commit 4e2ba0d

File tree

80 files changed

+8596
-89
lines changed

Some content is hidden

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

80 files changed

+8596
-89
lines changed

qiskit/optimization/__init__.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,31 @@
1515
====================================================================
1616
Optimization application stack for Aqua (:mod:`qiskit.optimization`)
1717
====================================================================
18-
This is the finance domain logic....
1918
2019
.. currentmodule:: qiskit.optimization
2120
22-
Submodules
23-
==========
21+
Contents
22+
========
2423
2524
.. autosummary::
26-
:toctree:
25+
:toctree: ../stubs/
26+
:nosignatures:
2727
28-
ising
28+
QuadraticProgram
29+
QiskitOptimizationError
30+
INFINITY
2931
3032
"""
3133

34+
from .infinity import INFINITY # must be at the top of the file
35+
from .exceptions import QiskitOptimizationError
36+
from .problems import QuadraticProgram
3237
from ._logging import (get_qiskit_optimization_logging,
3338
set_qiskit_optimization_logging)
3439

35-
__all__ = ['get_qiskit_optimization_logging',
36-
'set_qiskit_optimization_logging']
40+
__all__ = ['QuadraticProgram',
41+
'QiskitOptimizationError',
42+
'get_qiskit_optimization_logging',
43+
'set_qiskit_optimization_logging',
44+
'INFINITY'
45+
]
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# -*- coding: utf-8 -*-
2+
3+
# This code is part of Qiskit.
4+
#
5+
# (C) Copyright IBM 2019, 2020.
6+
#
7+
# This code is licensed under the Apache License, Version 2.0. You may
8+
# obtain a copy of this license in the LICENSE.txt file in the root directory
9+
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
10+
#
11+
# Any modifications or derivative works of this code must retain this
12+
# copyright notice, and modified files need to carry a notice indicating
13+
# that they have been altered from the originals.
14+
15+
"""
16+
===================================================================
17+
Optimization stack for Aqua (:mod:`qiskit.optimization.algorithms`)
18+
===================================================================
19+
20+
Algorithms for optimization algorithms.
21+
22+
.. currentmodule:: qiskit.optimization.algorithms
23+
24+
Base class
25+
==========
26+
27+
.. autosummary::
28+
:toctree: ../stubs/
29+
:nosignatures:
30+
31+
OptimizationAlgorithm
32+
33+
Algorithms
34+
==========
35+
36+
.. autosummary::
37+
:toctree: ../stubs/
38+
:nosignatures:
39+
40+
ADMMOptimizer
41+
CobylaOptimizer
42+
CplexOptimizer
43+
GroverOptimizer
44+
MinimumEigenOptimizer
45+
RecursiveMinimumEigenOptimizer
46+
47+
"""
48+
49+
from .optimization_algorithm import OptimizationResult
50+
from .optimization_algorithm import OptimizationAlgorithm
51+
from .admm_optimizer import ADMMOptimizer
52+
from .cplex_optimizer import CplexOptimizer
53+
from .cobyla_optimizer import CobylaOptimizer
54+
from .minimum_eigen_optimizer import MinimumEigenOptimizer
55+
from .recursive_minimum_eigen_optimizer import RecursiveMinimumEigenOptimizer
56+
from .grover_optimizer import GroverOptimizer, GroverOptimizationResults
57+
58+
__all__ = ["ADMMOptimizer", "OptimizationAlgorithm", "OptimizationResult", "CplexOptimizer",
59+
"CobylaOptimizer", "MinimumEigenOptimizer", "RecursiveMinimumEigenOptimizer",
60+
"GroverOptimizer", "GroverOptimizationResults"]

0 commit comments

Comments
 (0)