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

[Feature Request] Better QFT Compilation in the Pauli formalism #263

Open
gwwatkin opened this issue Feb 22, 2022 · 5 comments
Open

[Feature Request] Better QFT Compilation in the Pauli formalism #263

gwwatkin opened this issue Feb 22, 2022 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@gwwatkin
Copy link
Member

gwwatkin commented Feb 22, 2022

Issue Description

Our implementation of the Pauli Formalism is very slow - see the benchmark in #258. Additionally it also generates 4x more ls instructions, but there is a chance to generate even fewer.

Proposed Solution

Compilation speed

The slowness, compared to the gate based pipeline, is due to the fact that QFT circuits are dominated by very long single qubit Clifford+T approximations and our pipeline pads single qubit rotations with identities to span the whole width of the circuit. Switching to a sparse format (like in the gate based pipeline) is likeley to speed up this step and drastically reduce memory footprint.

Computation depth

The bottle neck is approximations of arbitrary rotations, where we are going to gates and back, Increasing the length at the computation at every step:

Now, our pipeline is:

rotations -> approximation with gates -> rotations -> instructions

We have the opportunity of using directly Pauli rotations to approximate rotations:

goes rotations -> approximation with rotations -> instructions.

The approximation with rotations translates directly to LS instructions. With this pipeline, we should generate fewer ls instructions than with the gate based pipeline, which still does the Hadamards and separates groups like ZST which are a single Z_7pi/8 rotation

To do that, we reinterpret the Gridsynth approximations, which are in a normal form (as shown below), and cache them directly as rotations. We do so by grouping Zs, Ss and Ts and "sandwiching" them between Hadamard gates, and seeing that as a basis change:
Some gate -> TSHTHTHSTHZSTHTH...
-> TS HTH T HSTH ZST HTH ...
-> Z_3pi/8 HZ_pi/8H Z_pi/8 HZ_3pi/6H Z_5pi/8 HZ_pi/8H...
-> Z_3pi/8 X_pi/8 Z_pi/8 X_3pi/6 Z_7pi/8 X_pi/8 ...

Then these translate directly to ls instructions.

Additional References

If applicable, provide some references that will help us better understand the request.

@gwwatkin gwwatkin added the enhancement New feature or request label Feb 22, 2022
@isolatedinformation
Copy link
Contributor

What is the status of this issue?

@gwwatkin
Copy link
Member Author

gwwatkin commented Mar 12, 2022

@isolatedinformation No work has been done yet. As by our conversation on Slack, passing it over to you.

CC: @alexnguyenn

@isolatedinformation
Copy link
Contributor

isolatedinformation commented Mar 18, 2022

Partly solved by #269! But as mentioned by @gwwatkin LLOPS edge case testing must done for rotations angles like 5pi/8.. raised in issue #271

@gwwatkin
Copy link
Member Author

Also this issue has a part about sparse representation for rotations #269 doesn't address that. Perhaps this is best split it a different issue @isolatedinformation ?

@gwwatkin
Copy link
Member Author

We won't be able to compile the 128 QFT without sparse representation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants