Skip to content

Releases: qiskit-community/qiskit-optimization

Qiskit Optimization 0.6.1

28 Feb 02:52
c23bd6c
Compare
Choose a tag to compare

New Features

  • Added support for using Qiskit Optimization with Python 3.12.

Qiskit Optimization 0.6.0

14 Nov 07:58
e937f2c
Compare
Choose a tag to compare

Prelude

Qiskit Optimization has been migrated to the qiskit-community Github organization to further emphasize that it is a community-driven project. To reflect this change and because we are on-boarding additional code owners and maintainers, with this version (0.6) we have decided to remove all deprecated code, regardless of the time of its deprecation. This ensures that the new members of the development team do not have a large bulk of legacy code to maintain. This can mean one of two things for you as the end-user:

  • Nothing, if you already migrated your code and no longer rely on any deprecated features.

  • Otherwise, you need to migrate your code immediately. If you cannot do that, or want to continue using some of the features that were removed, you should pin your version of Qiskit Optimization to 0.5

You can check out the migration guides for details on how to update your code. For more context on the changes around Qiskit Optimization and the other application projects as well as the algorithms library in Qiskit, be sure to read this blog post.

Qiskit Optimization 0.6 switches from qiskit.algorithms of Qiskit to Qiskit Algorithms. Qiskit Optimization 0.6 drops supports of the former algorithms based on qiskit.algorithms, QuantumInstance, and Opflow of Qiskit.

New Features

  • Adds ScipyMilpOptimizer as a classical solver based on scipy.optimize.milp, which can solve mixed-integer linear program (MILP) problems. Note that scipy.optimize.milp has been introduced by SciPy 1.9.0.

  • Added a new optimization algorithm, QuantumRandomAccessOptimizer. This approach incorporates Quantum Random Access Codes (QRACs) as a tool to encode multiple classical binary variables into a single qubit, thereby saving quantum resources and enabling exploration of larger problem instances on a quantum computer. The encodings produce a local quantum Hamiltonian whose ground state can be approximated with standard algorithms such as VQE, and then rounded to yield approximation solutions of the original problem.

  • QuantumRandomAccessOptimizer has two methods for solving problems, solve() and solve_relaxed(). The solve method provides a seamless workflow by automatically managing the encoding and rounding procedures, as demonstrated in the example below. This allows for a simplified and streamlined user experience. On the other hand, the solve_relaxed method offers the flexibility to break the computation process into distinct steps. This feature can be advantageous when we need to compare solutions obtained from different rounding schemes applied to a potential ground state.

Upgrade Notes

  • Added support for running with Python 3.11.

  • Support for running with Python 3.7 has been removed. To run Qiskit Optimization you need a minimum Python version of 3.8.

  • The support for QuantumInstance-based algorithms is removed. Qiskit optimization supports only Primitive-based algorithms.

  • The support for Opflow is removed to represent Ising Hamiltonians. Qiskit optimization supports only qiskit.quantum_info.SparsePauliOp, instead.

  • The classes VQEClient, QAOAClient, and VQERuntimeResult are removed. Instead, users should migrate their code to use the Qiskit Runtime Primitives with session.

  • Updated to_ising() to support returning qiskit.quantum_info.SparsePauliOp. The feature to return an Opflow operator is removed.

  • Updated from_ising() to support accepting qiskit.quantum_info.SparsePauliOp. The feature to accept an Opflow operator is removed.

  • The MinimumEigenOptimizer class takes the primitives-based algorithms (qiskit_algorithms.SamplingMinimumEigensolver and qiskit_algorithms.NumPyMinimumEigensolver) of Qiskit Algorithms as min_eigen_solver argument. The supports of the former algorithms based on qiskit.algorithms and QuantumInstance are removed.

  • The WarmStartQAOAOptimizer class takes the primitives-based QAOA (qiskit_algorithms.minimum_eigensolvers.QAOA) as qaoa argument. The support of the former QAOA algorithms based on qiskit.algorithms is removed.

  • The GroverOptimizer class drops the support of QuantumInstance and argument quantum_instance is removed. It supports only the Sampler primitive now.

Bug Fixes

  • Fixed incorrect rho update when vary_rho is set to UPDATE_RHO_BY_RESIDUALS in ADMMOptimizer.

  • Fixed incorrect population of y_saved in ADMMState.

  • Fixed an issue of InequalityToEquality converter so that it adds all slack variables before adding the objective function and the constraints. The issue may have caused errors when interpreting solutions.

Qiskit Optimization 0.5.0

27 Jan 15:18
8fa0437
Compare
Choose a tag to compare

Changelog

New Features

Upgrade Notices

  • The previously deprecated VQEProgram and QAOAProgram classes have been removed. They were originally deprecated in the Qiskit Optimization 0.3.0 release.

Bug Fixes

  • Fixed an issue that parse_tsplib_format() did not parse TSPLIB files correctly in all cases; in particular if extra whitespace existed around keywords or if an EOF keyword was present.

Qiskit Optimization 0.4.0

29 Jun 17:14
545924c
Compare
Choose a tag to compare

Changelog

New Features

  • Adds a method prettyprint() to QuadraticProgram to generate a pretty-printed string of the object.

  • Adds informative text formats to str and repr functions of the following objects. The formats are IDE friendly, i.e., the text is one line.

     LinearConstraint
     LinearExpression
     QuadraticConstraint
     QuadraticExpression
     QuadraticObjective
     Variable
    
  • Adds a method prettyprint() to OptimizationResult to display the result in a multi-line text format.

Upgrade Notes

  • If users set an empty variable name "" with binary_var(), integer_var(), and continuous_var(), they set the default variable name (e.g., x0) while they used to set the empty name as variable name.

  • Added support for running with Python 3.10. At the the time of the release, Cplex didn’t have a python 3.10 version and Docplex failed inside docplex.mp.model.Model.binary_var_list().

  • Updates the text format of str and repr of the following objects so that the output is one line.

    QuadraticProgram
    OptimizationResult

  • The previously deprecated BaseBackend class has been removed. It was originally deprecated in the Qiskit Terra 0.18.0 release.

  • Enable installation of CPLEX for Python 3.10.

  • Support for running with Python 3.6 has been removed. To run Optimization you need a minimum Python version of 3.7.

Bug Fixes

  • Fixed an issue that from_ising() raises an error when Pauli I is given.
  • Fixed an issue that to_ising() returns a wrong operator when there is no variable in an input problem.

Other Notes

  • Shows a warning message if non-printable strings are set to QuadraticProgram as problem name, variable name, or constraint name.
  • Updated the documentation of SUCCESS of OptimizationResultStatus. SUCCESS means the obtained solution is feasible, but not always optimal because some algorithms do not guarantee the optimality.
  • Reword the documentation of all methods and the multi-line text format of OptimizationResult as follows because some algorithms do not guarantee the optimality.
    “optimal function value” → “objective function value”
    “optimal value” → “variable values”

Qiskit Optimization 0.3.2

30 Mar 14:18
f002291
Compare
Choose a tag to compare

Changelog

Upgrade Notes

  • Unpin networkx by removing the release upper bound 2.6.

Qiskit Optimization 0.3.1

14 Feb 15:02
7b33627
Compare
Choose a tag to compare

Changelog

Upgrade Notes

  • Added support for running with Python 3.10. At the the time of the release, Cplex didn’t have a python 3.10 version and Docplex failed inside docplex.mp.model.Model.binary_var_list().

Qiskit Optimization 0.3.0

16 Dec 13:38
73fa9a7
Compare
Choose a tag to compare

Changelog

New Features

  • Adding the bin-packing application qiskit_optimization.applications.BinPacking. https://en.wikipedia.org/wiki/Bin_packing_problem

  • Added the runtime client QAOAClient to execute the QAOA algorithm on Qiskit runtime. This runtime program leverages QAOA dedicated transpiler passes such as swap strategies and pulse-efficient transpiler passes for cross-resonance based hardware. Both these optimizations can significantly reduce circuit depth and improve execution time and results. Further, the QAOA runtime also allows using CVaR expectation values, which can improve the performance of ground state calculations in optimization settings.

  • qiskit_optimization.translators.from_docplex_mp() supports logical expressions of Docplex, i.e., logical_and, logical_or, and logical_not.

  • Introduced the Sherrington-Kirkpatrick (SK) model [1] qiskit_optimization.applications.SKModel. The model has all-to-all ferromagnetic and antiferromagnetic interactions given by a random disorder and represents a mean-field approximation of a spin glass.

Upgrade Notes

  • The deprecated methods QuadraticProgram.from_docplex and QuadraticProgram.to_docplex have been removed and no longer exist. These methods were deprecated as part of the 0.2.0 release. Instead you should use from_docplex_mp() and to_docplex_mp().

Deprecation Notes

  • Rename the runtime “programs” to runtime “clients” to avoid name confusions and reflect the fact that they are an interface for code executed in the cloud. The classes VQEProgram, QAOAProgram and VQEProgramResult have been renamed to VQERuntimeClient, QAOARuntimeClient and VQERuntimeResult, respectively.

Bug Fixes

  • Fix qiskit_optimization.converters.IntegerToBinary to convert quadratic terms correctly.

  • Fix qiskit_optimization.converters.IntegerToBinary to convert variables with zero range, i.e., the lower bound is equal to the upper bound, without raising any error.

  • if an indicator constraint of a Docplex model does not have a name, qiskit_optimization.translators.from_docplex_mp() adds a name ind{number} for sense <= and >= or names ind{number}_LE and ind{number}_GE for sense ==.

  • If an indicator constraint of a Docplex model includes binary_var as part of linear_ct, qiskit_optimization.translators.from_docplex_mp() handles the coefficient properly.

  • If a trivial constraint is included in a Docplex model, qiskit_optimization.translators.from_docplex_mp() raises an UserWarning and converts it into a constraint of qiskit_optimization.problems.QuadraticProgram as is.

  • If a trivial constraint is included in qiskit_optimization.problems.QuadraticProgram, qiskit_optimization.translators.to_docplex_mp() converts it into a constraint of Docplex without any error.

  • Allow Qiskit’s Optimizer classes as input for the optimizer in the VQEProgram and QAOAProgram instead of only dictionaries.

Qiskit Optimization 0.2.3

22 Sep 16:33
c55e2a2
Compare
Choose a tag to compare

Changelog

Fixed

  • Fix qiskit_optimization.converters.IntegerToBinary to convert quadratic terms correctly.
  • Fix qiskit_optimization.converters.IntegerToBinary to convert variables with zero range, i.e., the lower bound is equal to the upper bound, without raising any error.

Qiskit Optimization 0.2.2

18 Aug 15:59
6aa5cc4
Compare
Choose a tag to compare

Changelog

Fixed

  • Override classmethod supports_aux_operators in VQEProgram (#223)

Qiskit Optimization 0.2.1

29 Jul 20:27
8553c6f
Compare
Choose a tag to compare

Changelog

Fixed

  • Allow Qiskit Optimizers in the runtime programs (#214)