Skip to content

Qiskit Optimization 0.6.0

Compare
Choose a tag to compare
@t-imamichi t-imamichi released this 14 Nov 07:58
· 16 commits to main since this release
e937f2c

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.