zxcalc / pyzx

Python library for quantum circuit rewriting and optimisation using the ZX-calculus
Apache License 2.0
385 stars 116 forks source link

Implement graphical fourier transform and inverse #92

Open akissinger opened 2 years ago

akissinger commented 2 years ago

Implement the graphical Fourier transform, and its inverse. This would allow converting back and forth between ZX and ZH diagrams.

See the paper: Graphical Fourier Theory and the Cost of Quantum Addition.

A subtle point when working with ZH diagrams in pyzx: the pyzx Graph data structure does not support parallel edges. However, sometimes parallel edges are unavoidable between H-boxes. As a result, some care should be taken in how rewrites involving H-boxes are implemented to work around this (e.g. by introducing an identity-spider on one of the edges).

AryanJ13 commented 2 years ago

Hello, I would love to work on this. Can you please share some guide or sample for me to look into and prep

jvdwetering commented 2 years ago

Hoi Aryan, how familiar are you with ZX/ZH? If you are not that familiar with it, this might not be the best issue to start with it. If you want to work on this, you could first read (parts of) https://arxiv.org/abs/2012.13966, specifically Section 8, specifically Section 8.4.

You could either start by implementing just the decomposition of the 3-ary H-box, or immediately try to do the general case.

nickdgardner commented 1 year ago

Hi, is this issue still open for contributors? I'd be interested in implement this to get a better feel for how ZX/ZH relate. I have basic familiarity with both.

jvdwetering commented 1 year ago

I believe someone started on this a long time ago, and showed me showed progress. But I haven't heard from this in months, and it is not pushed, so go for it!

nickdgardner commented 1 year ago

Ok cool! Looking forward to working on this