0
$\begingroup$

I'm currently evaluating a static QC, QML and QAOA approach to solving a combinational problem. My solution with the static QC and QML approach is finished, and all data has been collected.

Now, the QAOA solution for this exact issue exists even in the form of executable code, but I have an issue. The function .get_optimal_cost() was deprecated and removed in qiskit 0.35, as well as optimal_params (See https://qiskit.org/documentation/release_notes.html#qiskit-0-35-0)

Of course, whilst being a lot of work, I could use past versions of qiskit to run it, but I assume there was a reason for the removal of it. In addition, I'd like to have my experiments be as up-to-date as possible. Sadly, I was unable to find the exact idea behind the removal or what its supposed replacement part is.

To confess, my basic understanding of QAOA is fairly limited, so maybe it's just me missing something.

$\endgroup$

1 Answer 1

2
$\begingroup$

The methods were passing back information that was/is stored in the result object and as such were deprecated in favor of making the algorithm stateless and overall simplification. QAOA extends VQE and inherited these methods. These are the deprecation messages from the earlier version that indicate the result fields that correspond.

The VQE.get_optimal_cost method is deprecated as of Qiskit Terra 0.18.0
and will be removed no sooner than 3 months after the releasedate.
This information is part of the returned result object and can be
queried as VQEResult.eigenvalue."""
    )
    def get_optimal_cost(self) -> float:
The VQE.optimal_params property is deprecated as of Qiskit Terra 0.18.0
and will be removed no sooner than 3 months after the releasedate.
This information is part of the returned result object and can be
queried as VQEResult.optimal_point."""
    )
    def optimal_params(self) -> np.ndarray:
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.