Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor
COMPRESS-INSTRUCTIONS
(#830)
* First shot refactoring COMPRESS-INSTRUCTIONS. I believe it's sound, but does not always optimize as well -- it does not yet implement some of the repeated passes that the old COMPRESS-INSTRUCTIONS did. * Reimplement recursive optimization in COMPRESS-INSTRUCTIONS. I believe the rewrite is more or less up to the same performance level as the original (passes tests, but manual testing in REPL indicates its sequences are often a few gates longer). However, there is some bug wrt state prep that is causing some tests still to fail. * Rewritten COMPRESS-INSTRUCTIONS is working! IT's not 100% functionally equivalent with the original, so I still need to run some manual tests to evaluate its performance. * Be smarter about which existing queue to flush. In last commit, flushed all existing queues. I misread the original implementation, which in fact only flushed the sub-queue which was in "passing" mode, which is the queue involving the greatest number of qubits. As of this commit, the output of the new COMPRESS-INSTRUCTIONS seems just as good as the original implementation. * Improve docstring for FLUSH-QUEUE * Change IF to COND in FLUSH-QUEUE inside COMPRESS-INSTRUCTIONS * Limit recursion queue size to be <=2 in COMPRESS-INSTRUCTIONS Co-authored-by: Mark Polyakov <[email protected]>
- Loading branch information