Qiskit-optimization

Latest version: v0.6.1

Safety actively analyzes 623721 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

0.6.1

New Features

- Added support for using Qiskit Optimization with Python 3.12.

0.6.0

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.

0.5.0

Changelog

New Features
- The [MinimumEigenOptimizer](https://qiskit.org/documentation/optimization/stubs/qiskit_optimization.algorithms.MinimumEigenOptimizer.html#qiskit_optimization.algorithms.MinimumEigenOptimizer) class takes the primitives-based algorithms ([qiskit.algorithms.minimum_eigensolvers.SamplingMinimumEigensolver](https://qiskit.org/documentation/stubs/qiskit.algorithms.minimum_eigensolvers.SamplingMinimumEigensolver.html#qiskit.algorithms.minimum_eigensolvers.SamplingMinimumEigensolver) and [qiskit.algorithms.minimum_eigensolvers.NumPyMinimumEigensolver](https://qiskit.org/documentation/stubs/qiskit.algorithms.minimum_eigensolvers.NumPyMinimumEigensolver.html#qiskit.algorithms.minimum_eigensolvers.NumPyMinimumEigensolver)) as min_eigen_solver argument. The former algorithm [qiskit.algorithms.MinimumEigensolver](https://qiskit.org/documentation/stubs/qiskit.algorithms.MinimumEigensolver.html#qiskit.algorithms.MinimumEigensolver) is pending deprecation and will be deprecated and subsequently removed in future releases. Note that [qiskit.algorithms.minimum_eigensolvers.SamplingVQE](https://qiskit.org/documentation/stubs/qiskit.algorithms.minimum_eigensolvers.SamplingVQE.html#qiskit.algorithms.minimum_eigensolvers.SamplingVQE) supersedes [qiskit.algorithms.VQE](https://qiskit.org/documentation/stubs/qiskit.algorithms.VQE.html#qiskit.algorithms.VQE) for [MinimumEigenOptimizer](https://qiskit.org/documentation/optimization/stubs/qiskit_optimization.algorithms.MinimumEigenOptimizer.html#qiskit_optimization.algorithms.MinimumEigenOptimizer). [qiskit.algorithms.minimum_eigensolvers.NumPyMinimumEigensolver](https://qiskit.org/documentation/stubs/qiskit.algorithms.minimum_eigensolvers.NumPyMinimumEigensolver.html#qiskit.algorithms.minimum_eigensolvers.NumPyMinimumEigensolver) also supersedes [qiskit.algorithms.NumPyMinimumEigensolver](https://qiskit.org/documentation/stubs/qiskit.algorithms.NumPyMinimumEigensolver.html#qiskit.algorithms.NumPyMinimumEigensolver).
- The [WarmStartQAOAOptimizer](https://qiskit.org/documentation/optimization/stubs/qiskit_optimization.algorithms.WarmStartQAOAOptimizer.html#qiskit_optimization.algorithms.WarmStartQAOAOptimizer) class takes the primitives-based QAOA ([qiskit.algorithms.minimum_eigensolvers.QAOA](https://qiskit.org/documentation/stubs/qiskit.algorithms.minimum_eigensolvers.QAOA.html#qiskit.algorithms.minimum_eigensolvers.QAOA)) as qaoa argument. The former algorithm [qiskit.algorithms.QAOA](https://qiskit.org/documentation/stubs/qiskit.algorithms.QAOA.html#qiskit.algorithms.QAOA) is pending deprecation and will be deprecated and subsequently removed in future releases.
- The [GroverOptimizer](https://qiskit.org/documentation/optimization/stubs/qiskit_optimization.algorithms.GroverOptimizer.html#qiskit_optimization.algorithms.GroverOptimizer) class has a new keyword argument, sampler which is used to run the algorithm using an instance of the [qiskit.primitives.BaseSampler](https://qiskit.org/documentation/stubs/qiskit.primitives.BaseSampler.html#qiskit.primitives.BaseSampler) interface to calculate the results. This new argument supersedes the the quantum_instance argument and accordingly, quantum_instance is pending deprecation and will be deprecated and subsequently removed in future releases.

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.

0.4.0

Changelog

New Features
- Adds a method [prettyprint()](https://qiskit.org/documentation/optimization/stubs/qiskit_optimization.QuadraticProgram.prettyprint.html#qiskit_optimization.QuadraticProgram.prettyprint) to [QuadraticProgram](https://qiskit.org/documentation/optimization/stubs/qiskit_optimization.QuadraticProgram.html#qiskit_optimization.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()](https://qiskit.org/documentation/optimization/stubs/qiskit_optimization.algorithms.OptimizationResult.prettyprint.html#qiskit_optimization.algorithms.OptimizationResult.prettyprint) to [OptimizationResult](https://qiskit.org/documentation/optimization/stubs/qiskit_optimization.algorithms.OptimizationResult.html#qiskit_optimization.algorithms.OptimizationResult) to display the result in a multi-line text format.

Upgrade Notes

- If users set an empty variable name "" with [binary_var()](https://qiskit.org/documentation/optimization/stubs/qiskit_optimization.QuadraticProgram.binary_var.html#qiskit_optimization.QuadraticProgram.binary_var), [integer_var()](https://qiskit.org/documentation/optimization/stubs/qiskit_optimization.QuadraticProgram.integer_var.html#qiskit_optimization.QuadraticProgram.integer_var), and [continuous_var()](https://qiskit.org/documentation/optimization/stubs/qiskit_optimization.QuadraticProgram.continuous_var.html#qiskit_optimization.QuadraticProgram.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()](https://qiskit.org/documentation/optimization/stubs/qiskit_optimization.translators.from_ising.html#qiskit_optimization.translators.from_ising) raises an error when Pauli I is given.
- Fixed an issue that [to_ising()](https://qiskit.org/documentation/optimization/stubs/qiskit_optimization.translators.to_ising.html#qiskit_optimization.translators.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](https://qiskit.org/documentation/optimization/stubs/qiskit_optimization.QuadraticProgram.html#qiskit_optimization.QuadraticProgram) as problem name, variable name, or constraint name.
- Updated the documentation of [SUCCESS](https://qiskit.org/documentation/optimization/stubs/qiskit_optimization.algorithms.OptimizationResultStatus.SUCCESS.html#qiskit_optimization.algorithms.OptimizationResultStatus.SUCCESS) of [OptimizationResultStatus](https://qiskit.org/documentation/optimization/stubs/qiskit_optimization.algorithms.OptimizationResultStatus.html#qiskit_optimization.algorithms.OptimizationResultStatus). [SUCCESS](https://qiskit.org/documentation/optimization/stubs/qiskit_optimization.algorithms.OptimizationResultStatus.SUCCESS.html#qiskit_optimization.algorithms.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](https://qiskit.org/documentation/optimization/stubs/qiskit_optimization.algorithms.OptimizationResult.html#qiskit_optimization.algorithms.OptimizationResult) as follows because some algorithms do not guarantee the optimality.
“optimal function value” → “objective function value”
“optimal value” → “variable values”

0.3.2

Changelog

Upgrade Notes
- Unpin networkx by removing the release upper bound 2.6.

0.3.1

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().

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.