Make MockFidelity also compatible with Qiskit Algorithms >= 0.3.0 #761
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #729
The BaseStateFidelity was changed in qiskit algorithms as to the type
_run
returns in order to fix a threading problem. See the above issue this fixes for more information and a link to PR done in algorithms for further detail. This updates the MockFidelity so the test using it works with the current release of algorithms at this time (0.2.2.), so CI passes now, and will work when algorithms releases a new version (0.3.0), which I tested locally but will not go through that path here in CI until that happens. On the slim chance it does not work (despite it working for me the altered code from algorithms main branch) then this can always be tweaked - without this change its guaranteed to fail!Details and comments
I noted in a comment by the change that in the future we can choose to remove present logic in the path that tests current versions as this will no longer be needed.
I marked this as backport in order to keep stable CI passing when the new algs come out.