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.
The issue described in #342 is fixed (mapper bug alters already conforming circuits, and inserts operation after measurement).
This PR also resolves several other bug reports about mapper behavior:
Description
The default layout, if none is provided, is a layout of circuit qubit i to device qubit i. This is reasonable since many users will hand optimize circuits and create already-conforming gates, or would like to map qubits to exact same qubits on the device.
If compilation is being performed for a real backend, the compiler inserts barriers before measurements to ensure they do not move before gates.
Motivation and Context
How Has This Been Tested?
make test
Also added new tests in
test_mapper.py
andtest_quantumprogram.py
. So in the likely event of changing the mapper to another, faster code base, we will hopefully not encounter these issues.Screenshots (if appropriate):
Types of changes
Checklist: