-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix parameter order in VQE, if the ansatz is resized (#7479)
* fix VQE param order if ansatz is resized * add test, rm trailing comment * fix construct circuit for params != circuit params * fix test_max_evals_grouped In this test, the ansatz was resized and thus the parameters ASCII-sorted. Now they are sorted by vector, which leads to a slightly different optimization (since the params are in a different order). Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> (cherry picked from commit d0b26c2)
- Loading branch information
Showing
3 changed files
with
34 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
releasenotes/notes/fix-vqe-paramorder-if-ansatz-resized-14634a7efff7c74f.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
fixes: | ||
- | | ||
Fix a bug in :class:`~qiskit.algorithms.VQE` where the parameters of the ansatz were | ||
still explicitly ASCII-sorted by their name if the ansatz was resized. That led to a | ||
mismatching order of the optimized values in the ``optimal_point`` attribute of the result | ||
object. | ||
This bug did in particular occur if no ansatz was set by the user and the VQE chose | ||
a default with 11 or more free parameters. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters