compile(program, to_native_gates=True, optimize=True, protoquil_positional=None, *, protoquil=None)¶
A high-level interface to program compilation.
Compilation currently consists of two stages. Please see the
AbstractCompilerdocs for more information. This function does all stages of compilation.
Right now both
optimizemust be either both set or both unset. More modular compilation passes may be available in the future.
Additionally, a call to compile also calls the
resetmethod if one is running on the QPU. This is a bit of a sneaky hack to guard against stale compiler connections, but shouldn’t result in any material hit to performance (especially when taking advantage of parametric compilation for hybrid applications).
Program) – A Program
bool) – Whether to compile non-native gates to native gates.
bool) – Whether to optimize the program to reduce the number of operations.
- Return type
An executable binary suitable for passing to