load_quil(quil_str: str)[source]

Load a quil string as a PennyLane template.

During loading, gates are converted to PennyLane gates as far as possible. If the gates are not supported they are replaced with QubitUnitary instances. The import ignores all statements that are not declarations or gates (e.g. pragmas, classical control flow and measurements).

Every variable that is present in the Program and that is not used as the target register of a measurement has to be provided in the parameter_map of the template.


quil_str (str) – The program that should be loaded


a ProgramLoader instance that can be called like a template

Return type