Currently compile_routine method modifies "in-place" the input.
We want to make sure it does not happen.
It can be seen in the basic tutorial – after running compile_routine(uncompiled_routine) , the uncompiled_routine gets a new resources: T_gates, which most likely comes from precompilation.
We'd need to ensure that the public methods do not mutating their inputs, as it can lead to very nasty and hard to debug behavior.
After looking a bit more into how precompilation works, it's definitely (but not necessarily exclusively) matter of precompilation, as all the precompilation stages change the routine in-place.
Currently
compile_routine
method modifies "in-place" the input. We want to make sure it does not happen.It can be seen in the basic tutorial – after running
compile_routine(uncompiled_routine)
, theuncompiled_routine
gets a new resources:T_gates
, which most likely comes from precompilation.We'd need to ensure that the public methods do not mutating their inputs, as it can lead to very nasty and hard to debug behavior.