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] Sparse Representation of operations in the Pauli Formalism #272

Open
isolatedinformation opened this issue Mar 19, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@isolatedinformation
Copy link
Contributor

Issue Description

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 likely to speed up this step and drastically reduce memory footprint. (as pointed out in #263 )

@isolatedinformation isolatedinformation added the bug Something isn't working label Mar 19, 2022
@gwwatkin
Copy link
Member

I suggest looking at how gates are implemented as an example. Could even add the pauli rotation there, similarly to how the rz is implemented (inheriting from Gate), but with one more parameter for the axis (X/Z)

@alexnguyenn
Copy link
Member

Should we save this for when we start migrating to C++ @gwwatkin?

@gwwatkin
Copy link
Member

gwwatkin commented Mar 20, 2022

@alexnguyenn and @isolatedinformation, would be nice to get this done in python so we can squeeze it into the paper. It should be fairly quick to implement

@isolatedinformation
Copy link
Contributor Author

class RZ(Gate):
phase: Fraction = Fraction(1, 1)
def to_clifford_plus_t(self) -> Sequence[Gate]:
if self.phase == Fraction(1, 1):
return [Z(self.target_qubit)]
elif self.phase == Fraction(1, 2):
return [S(self.target_qubit)]
elif self.phase == Fraction(1, 4):
return [S(self.target_qubit)]
else:
return approximate.approximate_rz(self)

@gwwatkin shouldn't line 62 be the T gate and not the S gate?

@gwwatkin
Copy link
Member

Yes you are right! Good catch

@isolatedinformation
Copy link
Contributor Author

added the fix for this in #273

@gwwatkin
Copy link
Member

@isolatedinformation I think we can can close this after this comment from 274 is adressed:

One last think to consider is the half angle conversion for Pauli Rotations. Right now all the angles are double those in the convention of the latest lattice surgery papers and our existing block based Pauli rotations. I think we should also switch here to half angles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants