Closed evmckinney9 closed 1 year ago
This is fairly trivial via inspection, but hard to programmatically generalize. For now, move to wontfix. Note, this means that QV (or non CX/SWAP gates) are potentially nonoptimized in the basis sqiswap sub pass
Currently, there exists a stop condition, if sibling is longer than a full iSwap then stop.
The idea behind this parity condition, is that we are trying to discover the oldest sibling decomp in either 2 or 3 steps. However, we are missing the in-between case, which is when the oldest sibling does decomp in 1.5 or 2.5 steps. Let's focus on the 1.5 step because this case is used in the SWAP optimization for sqiswap basis.
Example: to optimize SWAP using sqiswap, we need parallel-drive iSwap to go to (0.5, 0.25, 0.25), then finish with 1 more sqiswap. If we inspect the SWAP, sqiswap decomp and go to the rec_iter_factor=3 case, we miss this because iswap(1.5) does not go to SWAP.