CircuitInliner : inlining circuit inside a stack
A simple Plugin that inline the instructions of all the quantum circuits passing by.
Using this plugin allows to skip the inlining step in the to_circ()
(with inline set to False, which is the default behavior).
This Plugin can be used to inline circuits before further optimization of simulation.
PyLinalg is able to simulate non-inlined circuits. There is no need to use this Plugin for simulation purposes.isinstance
- class qat.lang.linking.plugin.CircuitInliner(inplace=True)
A plugin that inlines all calls to a subroutine in the main body of a circuit.
This plugin should be attached to simulator that do not implement an execution stack management.
Currently, all python based simulators make use the internal iterator of the python QAT_CIRC structure to emulate this inlining on the fly. Some c++ based simulators might not be able to perform this emulation and will thus require the circuit to be inlined beforehand.
- Parameters
inplace (optional, bool) – if set to True, circuits are inlined in place. Setting this option to False will result in worst perfomances, but the circuits will be deepcopied before the inlining process. Defaults to True.
- classmethod addargs(parser)
Adds arguments in a parser
- compile(batch, _specs)
Compiles a batch
- do_post_processing()
We need post processing
- post_process(results)
Post processed results