PyQTorch compiler
Compiler
A dataclass to compile an IR model data into PyQTorch objects (to be run in a PyQTorch-based backend.
compile(model)
Compiling IR model data to PyQTorch object function. It transforms model
QuInstruct
s into PyQTorch operators, resolving the SSA-form arguments
into concrete values or valid PyQTorch parameters.
PARAMETER | DESCRIPTION |
---|---|
model
|
IR model to compile
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
QuantumCircuit
|
A PyQTorch quantum circuit object with the model |
QuantumCircuit
|
PyQTorch operators |
Source code in qadence2_platforms/backends/pyqtorch/compiler.py
compile_to_backend(model)
Compiles the model data (IR information from expressions) into PyQTorch-compatible data and
defines an Interface instance to be available to the user to invoke useful methods, such as
run
, sample
, expectation
, set_parameters
.
PARAMETER | DESCRIPTION |
---|---|
model
|
the IR model data to be compiled to PyQTorch-based backend
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Interface
|
The |