Fix ignored errors/durations in generate_preset_pass_manager
if dt
is set (backport #14065)
#14098
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
#14056 (comment) reported an unexpected behavior of
generate_preset_pass_manager
where setting a customdt
would invalidate the backend's gate durations and error rates. This was due to an oversight in #9256 , where a custom target would be built from scratch usingTarget.from_configuration
whenever any loose constraint was set, and any information regarding instruction properties would be lost. This was intentional forcoupling_map
andbasis_gates
, as they modify the target gate map, but not necessary fordt
, where the target could be kept and simply updated.This PR fixes this use case, adds a test with vf2 + dt, and modifies the user warning to explicitly communicate what will happen with gate durations and errors if
coupling_map
orbasis_gates
are set with abackend
.Details and comments
The changelog is None as #9256 has not been released yet.
This is an automatic backport of pull request #14065 done by [Mergify](https://mergify.com).