quilc icon indicating copy to clipboard operation
quilc copied to clipboard

Should `warm-up-addresser-state` build average costs instead?

Open ecpeterson opened this issue 2 years ago • 0 comments

The random unitary chosen in warm-up-addresser-state is mismatched with the stated goal of the slot it populates. Namely, it claims to calculate a 'worst case' cost for any unitary operation compiled on a given link — in fact, it calculates a single-point approximation to an average case cost. (To be concrete, these coincide for ISWAP, CNOT, and their admixture, but not for CNOT^{1/2}.)

Rather than modifying what's computed here, I propose we instead be more honest about what we're already computing. Do we actually want this slot to reflect worst case behavior? We use worst case analysis to justify some of the guards on substitutions that the compressor makes — but the other side of the guard is given by an additive cost function (like a sum of log-average-gate-infidelities in a sequence), which is itself already a poor approximation to the true behavior of a composite. Given that existing sloppiness, would it actually be any more harmful to the argument if we were to prefer the gamble of re-synthesizing a random operator (and expecting to achieve average cost, rather than worst) to the originally supplied circuit?

I can only think that this might lead to snares with "extreme" (yet common) cases — perhaps there's some bespoke logic around re-compiling SWAP gates that would cause a problem with this.

ecpeterson avatar Jan 18 '22 03:01 ecpeterson