qml.from_quil_file

from_quil_file(quil_filename: str)[source]

Loads quantum circuits from a Quil file using the converter in the PennyLane-Forest plugin.

Example:

>>> my_circuit = qml.from_quil_file("teleportation.quil")

The my_circuit template can now be used within QNodes, as a two-wire quantum template.

>>> @qml.qnode(dev)
>>> def circuit(x):
>>>     qml.RX(x, wires=1)
>>>     my_circuit(wires=(1, 0))
>>>     return qml.expval(qml.PauliZ(0))
Parameters

quil_filename (str) – path to a Quil file containing a valid quantum circuit

Returns

a pennylane_forest.ProgramLoader instance that can be used like a PennyLane template and that contains additional inspection properties

Return type

pennylane_forest.ProgramLoader