This may be required to extract pytket circuits from hugrs with float/rotation parameter manipulation.
We should be able to match on the to_halfturns op followed by a conditional to unwrap or panic emitted by guppy.
The general case is harder, as it may require type changing rewrites (as the Option<float> may be passed around).
The alternative to this is to track option<float> as parameters in the pytket encoder, and have a constant folding that interprets panics as undefined behaviour (so the failing branch can be ignored).
This may be required to extract pytket circuits from hugrs with float/rotation parameter manipulation.
We should be able to match on the
to_halfturns
op followed by a conditional to unwrap or panic emitted by guppy. The general case is harder, as it may require type changing rewrites (as theOption<float>
may be passed around).The alternative to this is to track
option<float>
as parameters in the pytket encoder, and have a constant folding that interprets panics as undefined behaviour (so the failing branch can be ignored).