Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring the transpiler for a more principled implementation #142

Open
thierry-martinez opened this issue May 7, 2024 · 2 comments
Open
Labels
good first issue Good for newcomers new feature New feature or request unitaryhack issue for unitaryhack 2024 hackathon

Comments

@thierry-martinez
Copy link
Contributor

thierry-martinez commented May 7, 2024

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(α).

X_5^{s_4} M_4^0 E_{45} N_5 X_4^{s_3} M_3^{-π/2} E_{34} N_4 X_3^{s_2} M_2^{-α} E_{23} N_3 X_2^{s_1} M_1^{π/2} E_{12} N_2

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:

  1. Transpile the circuit into a sequence of 𝔍(α) and ∧Z;

  2. Convert the sequence of 𝔍(α) and ∧Z into a pattern, using the systematic decomposition

    • 𝔍(α) = X_j^{s_i} M_i^{-α} E_{ij} N_j
    • ∧Z = E_{ij};
  3. 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.

@thierry-martinez thierry-martinez added new feature New feature or request good first issue Good for newcomers unitaryhack issue for unitaryhack 2024 hackathon labels May 7, 2024
@shinich1 shinich1 removed the unitaryhack issue for unitaryhack 2024 hackathon label May 7, 2024
@lreynax24
Copy link

Hey, I'd like to become a contributor of the quantum computing community. Can I help you guys work on this? This would be my first time working on an open source project. I have programming experience, and I'm familiar with quantum concepts. I have also built simple quantum circuits before. Let me know what you think. In the meantime, I'm going to read that paper.

@shinich1
Copy link
Contributor

shinich1 commented May 16, 2024

Hey, I'd like to become a contributor of the quantum computing community. Can I help you guys work on this? This would be my first time working on an open source project. I have programming experience, and I'm familiar with quantum concepts. I have also built simple quantum circuits before. Let me know what you think. In the meantime, I'm going to read that paper.

Hi! thanks for your interest. It would be best to review contribution guide, and this page has good information about contributing to open source quantum projects.

Just to clarify regarding the unitaryhack - we cannot guarantee this issue be part of it ('bountied') until the hack starts, so I recommend waiting until 29th of May.

@shinich1 shinich1 added the unitaryhack issue for unitaryhack 2024 hackathon label May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers new feature New feature or request unitaryhack issue for unitaryhack 2024 hackathon
Projects
None yet
Development

No branches or pull requests

3 participants