catalyst icon indicating copy to clipboard operation
catalyst copied to clipboard

[Frontend] Late result type unification in catalyst.cond during the quantum tracing

Open sergei-mironov opened this issue 1 year ago • 0 comments

This is a potential issue which was discovered during the Jax dynamic API development. In the two-stage quantum tracing, we do the type unification of all the conditional branches after user transformations are applied. That means, that during the quantum-tape transformations, users will see a non-unified result type which happens to be the result type of the last branch of the conditional statement.

In order to fix this issue, we suggest to do the type unification both before and after applying user quantum-tape transformations. See the following fixme in the development branch

sergei-mironov avatar Dec 14 '23 10:12 sergei-mironov