Refactoring the transpiler for a more principled implementation #142
Labels
good first issue
Good for newcomers
new feature
New feature or request
unitaryhack
issue for unitaryhack 2024 hackathon
In the seminal paper The Measurement Calculus (Danos, Kashefi, Panangaden, 2007), the transpilation from circuits to MBQC patterns leverages the universality of 𝔍(α) and ∧Z. For instance, the rotation gate Ry(α) is decomposable as
Ry(α) = e^{-iα/2} 𝔍(0) 𝔍(π/2) 𝔍(α) 𝔍(-π/2).
By using the decomposition 𝔍(α) =
X_j^{s_i} M_i^{-α} E_{ij} N_j
, we can systematically derive the following pattern for Ry(α).This pattern can then be standardized and optimized for space efficiency among other criteria. After standardization, the pattern correction sets are always consistent with a flow and a gflow (as computed by
gflow.flow_from_pattern
), which is not the case for the patterns currently generated by the transpiler. See the following discussion:We propose to simplify the
transpile.py
implementation by structuring the transpilation process into three distinct phases:Transpile the circuit into a sequence of 𝔍(α) and ∧Z;
Convert the sequence of 𝔍(α) and ∧Z into a pattern, using the systematic decomposition
X_j^{s_i} M_i^{-α} E_{ij} N_j
E_{ij}
;Optimize the pattern according to the desired criteria (standardization, optimization for space, etc.).
We hope the resulting implementation will be easier to follow, closer to the literature, and more straightforward to verify. Decomposing the transpiling and optimization phases can be useful for the user to check the translation, to visualize the flow with consistent pattern corrections and to customize the optimization criteria.
The text was updated successfully, but these errors were encountered: