oqc-community / qat

QAT is a quantum compiler and runtime focused on low-level, just-above-driver integration.
Other
49 stars 11 forks source link

Performance improvement: mid-circuit measurement validation #239

Closed lcauser-oqc closed 3 weeks ago

lcauser-oqc commented 3 weeks ago

Context: validating that an instruction list does not have mid-circuit measurements is currently very expensive. It checks that there are no mid circuit measurements by iterating through the entire instruction set, and checking if a qubit has an acquire instruction appear before a pulse. To do so, it has to resolve the qubit for each pulse. However, this only needs to practically be done once per pulse channel, so we can cache the result and reuse that.

Changes:

Results in an order of magnitude improvement for validate for deep circuits (likely to be less impactful for shallow circuits)