compile(program, to_native_gates=True, optimize=True, 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 (
Program) – A Program
- to_native_gates (
bool) – Whether to compile non-native gates to native gates.
- optimize (
bool) – Whether to optimize the program to reduce the number of operations.
- protoquil (
bool]) – Whether to restrict the input program to and the compiled program to protoquil (executable on QPU). A value of
Nonemeans defer to server.
An executable binary suitable for passing to
- program (