Prelude
Qiskit Optimization has been migrated to the [qiskit-community Github organization](https://github.com/qiskit-community) 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](https://qiskit.org/ecosystem/optimization/migration/index.html) 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](https://ibm.biz/BdSyNm).
Qiskit Optimization 0.6 switches from qiskit.algorithms of Qiskit to [Qiskit Algorithms](https://qiskit.org/ecosystem/algorithms/). Qiskit Optimization 0.6 drops supports of the former algorithms based on qiskit.algorithms, QuantumInstance, and Opflow of Qiskit.
New Features
- Adds [ScipyMilpOptimizer](https://qiskit.org/ecosystem/optimization/stubs/qiskit_optimization.algorithms.ScipyMilpOptimizer.html#qiskit_optimization.algorithms.ScipyMilpOptimizer) as a classical solver based on [scipy.optimize.milp](https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.milp.html), which can solve mixed-integer linear program (MILP) problems. Note that scipy.optimize.milp has been introduced by [SciPy 1.9.0](https://docs.scipy.org/doc/scipy/release.1.9.0.html).
- Added a new optimization algorithm, [QuantumRandomAccessOptimizer](https://qiskit.org/ecosystem/optimization/stubs/qiskit_optimization.algorithms.qrao.QuantumRandomAccessOptimizer.html#qiskit_optimization.algorithms.qrao.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](https://qiskit.org/ecosystem/optimization/stubs/qiskit_optimization.algorithms.qrao.QuantumRandomAccessOptimizer.html#qiskit_optimization.algorithms.qrao.QuantumRandomAccessOptimizer) has two methods for solving problems, [solve()](https://qiskit.org/ecosystem/optimization/stubs/qiskit_optimization.algorithms.qrao.QuantumRandomAccessOptimizer.html#qiskit_optimization.algorithms.qrao.QuantumRandomAccessOptimizer.solve) and [solve_relaxed()](https://qiskit.org/ecosystem/optimization/stubs/qiskit_optimization.algorithms.qrao.QuantumRandomAccessOptimizer.html#qiskit_optimization.algorithms.qrao.QuantumRandomAccessOptimizer.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()](https://qiskit.org/ecosystem/optimization/stubs/qiskit_optimization.translators.to_ising.html#qiskit_optimization.translators.to_ising) to support returning qiskit.quantum_info.SparsePauliOp. The feature to return an Opflow operator is removed.
- Updated [from_ising()](https://qiskit.org/ecosystem/optimization/stubs/qiskit_optimization.translators.from_ising.html#qiskit_optimization.translators.from_ising) to support accepting qiskit.quantum_info.SparsePauliOp. The feature to accept an Opflow operator is removed.
- The [MinimumEigenOptimizer](https://qiskit.org/ecosystem/optimization/stubs/qiskit_optimization.algorithms.MinimumEigenOptimizer.html#qiskit_optimization.algorithms.MinimumEigenOptimizer) class takes the primitives-based algorithms ([qiskit_algorithms.SamplingMinimumEigensolver](https://qiskit.org/ecosystem/algorithms/stubs/qiskit_algorithms.SamplingMinimumEigensolver.html#qiskit_algorithms.SamplingMinimumEigensolver) and [qiskit_algorithms.NumPyMinimumEigensolver](https://qiskit.org/ecosystem/algorithms/stubs/qiskit_algorithms.NumPyMinimumEigensolver.html#qiskit_algorithms.NumPyMinimumEigensolver)) of [Qiskit Algorithms](https://qiskit.org/ecosystem/algorithms/) as min_eigen_solver argument. The supports of the former algorithms based on qiskit.algorithms and QuantumInstance are removed.
- The [WarmStartQAOAOptimizer](https://qiskit.org/ecosystem/optimization/stubs/qiskit_optimization.algorithms.WarmStartQAOAOptimizer.html#qiskit_optimization.algorithms.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](https://qiskit.org/ecosystem/optimization/stubs/qiskit_optimization.algorithms.GroverOptimizer.html#qiskit_optimization.algorithms.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](https://qiskit.org/ecosystem/optimization/stubs/qiskit_optimization.algorithms.ADMMOptimizer.html#qiskit_optimization.algorithms.ADMMOptimizer).
- Fixed incorrect population of y_saved in [ADMMState](https://qiskit.org/ecosystem/optimization/stubs/qiskit_optimization.algorithms.ADMMState.html#qiskit_optimization.algorithms.ADMMState).
- Fixed an issue of [InequalityToEquality](https://qiskit.org/ecosystem/optimization/stubs/qiskit_optimization.converters.InequalityToEquality.html#qiskit_optimization.converters.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.