Transpiler¶
Overview¶
Transpilation is the process of rewriting a given input circuit to conform with desired criteria
such as topological and operational constraints of the hardware used to execute the final circuit.
We are not going to explain this in more detail here, and instead refer to Qiskit’s documentation of
the qiskit.transpiler module.
The focus here lies on explaining how we achieve the transpilation of a FermionCircuit to
a QuantumCircuit.
Stages¶
Conceptually, we split the transpilation process into several stages:
Stage |
Description |
|---|---|
fermionic-level optimization |
|
fermion-to-qubit layouting |
|
fermion-to-qubit synthesis |
|
continued transpilation on the qubit-level |
Optimization¶
Hint
Coming soon!
Layout¶
One global configuration setting for the transpilation process is the fermion-to-qubit “layout”. This must be provided by the user and it must match the provided fermion-to-qubit mapping (in the sense that, if a chosen mapping encodes a fixed number of fermions with a different number of qubits, the configured layout must account for that).
In the general case, fermionic modes are not always encoded with an occupation-basis into the qubit
register. Consequently, we cannot associate a single fermionic mode with a single qubit.
Therefore, the user-provided fermion-to-qubit layout (F2QLayout) associates
FermionRegister instances with
QuantumRegister ones.
A mapping of fermionic mode registers to quantum registers. |
The way to configure this global setting, is by placing a F2QLayout instance in the
f2q_layout field of the property_set. For more details
refer to Layouting Passes.
Synthesis¶
At its core, the transpilation is handled by the F2QSynthesis transpiler pass. It is
conceptually similar to Qiskit’s HighLevelSynthesis pass, which
uses various plugins for transpiling high-level circuit instructions. For more details, refer to
the documentation of F2QSynthesis directly.
How a given FermionGate can be synthesized in terms of qubit-based operations will depend
on the particular gate type as well as the user-chosen fermion-to-qubit mapping. For more details,
refer to Plugins.
Quantum¶
At this point in the transpilation process, we have reached QuantumCircuit
instance and can continue to use Qiskit’s transpilation pipeline as one would usually.
Hint
Additional transpiler passes for optimizations on the qubit-level that take into account the
knowledge of a circuit originating from a FermionCircuit may be added in the future!
Pass Managers¶
Qiskit’s transpilation process is orchestrated by a PassManager.
In particular, a StagedPassManager can be used to orchestrate the
transpilation into stages as explained above.
Important
The qiskit_fermions package does not (yet) provide transpilation presets. These will be added
in the future and this section will be expanded upon then.