qir-alliance / qat

QIR compiler tools and optimization passes for targeting QIR to different hardware backends
https://qir-alliance.github.io/qat/
MIT License
26 stars 14 forks source link

Fix reindex after reset, defer measure ordering #162

Closed swernli closed 1 year ago

swernli commented 1 year ago

This change fixes the behavior of the reindex after reset pass, which when run after the defer measurements pass can cause incorrect qubit measurement. Instead of deferring measurement first, which also moves reset calls, the pass ordering now does reset elimination and reindexing first in the default and configured adaptor pipelines.

This also fixes a bug where configuration or cmdline values for adaptor pipeline were incorrectly appended rather than replacing the default values.

billti commented 1 year ago

Sounds like a few bugs were found/fixed. No tests?

swernli commented 1 year ago

Sounds like a few bugs were found/fixed. No tests?

@billti Unfortunately, the test infrastructure that's checked in now is not well suited for verifying the bug fix here. I was debating with some other folks about how to approach this for this case, and I think I need to add a new style of test that is different than what already exists here. I'll try to get that captured for this fix, but I think you and I should follow up directly about the test infra here and what the right path forward is with it.