latticesurgery-com / lattice-surgery-compiler

Lattice surgery quantum error correction compiler
https://latticesurgery.com
GNU Lesser General Public License v2.1
46 stars 6 forks source link

[Feature Request] Sparse Representation of operations in the Pauli Formalism #272

Open isolatedinformation opened 2 years ago

isolatedinformation commented 2 years ago

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 )

gwwatkin commented 2 years ago

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 commented 2 years ago

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

gwwatkin commented 2 years ago

@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 commented 2 years ago

https://github.com/latticesurgery-com/lattice-surgery-compiler/blob/d59f4472fe9abfdb303017e9938f9fec73f269d1/src/lsqecc/gates/gates.py#L53-L64

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

gwwatkin commented 2 years ago

Yes you are right! Good catch

isolatedinformation commented 2 years ago

added the fix for this in #273

gwwatkin commented 2 years ago

@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