Make cancel_inverses
also apply to gates through control flows
#1066
Labels
enhancement
New feature or request
Currently
cancel_inverses
does not detect potential opportunities if they are separated across the boundary of control flow constructs, e.g.for(4){Hadamard}
orHadamard, if(cond){True: Identity, False: Hadamard}
. Being able to detect these opportunities would be a good addition.This issue is more general than
cancel_inverses
. We essentially want to have an analysis available without having to explicitly unroll loops or hoist conditionals, since these could be expensive and are not guaranteed to happen.The text was updated successfully, but these errors were encountered: