zxcalc / pyzx

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

Better rust bindings/integration #91

Open akissinger opened 2 years ago

akissinger commented 2 years ago

This issue has to do with integrating (better) with quizx, the Rust port of pyzx.

There are already some python bindings, available here, but they only cover some of the functionality. This request is to extend the coverage of quizx functionality and also make quizx and it's python bindings pip-installable.

srinjoyganguly commented 2 years ago

Hi @akissinger! I hope you are doing well. I have been exploring QuiZX for the past few days and will be even mentoring a small project at QWorld QIntern 2022 for making documentation for QuiZX. I would love to work on this issue with my team. Can you please let me know how I and my team members can be allocated for this issue and some other ones as well? Thank you so much!

akissinger commented 2 years ago

Hi Srinjoy,

That's great! This issue is part of the unitaryHACK hackathon, taking place 3-17 June. Anyone can contribute as individuals or in teams. See: https://unitaryhack.dev for how it works.

Best,

Aleks

srinjoyganguly commented 2 years ago

Hi Aleks,

Thanks so much for your kind words and the Unitary hack information. I will go through it definitely.

Can you please let me know any more information about this PR which you feel we should know in order to start our work? Any tips or suggestions will be very helpful.

Best and Kind Regards

Srinjoy Ganguly

jvdwetering commented 2 years ago

Hi Srinjoy,

I think for a starting point, you would want to make bindings that allow you to run at least the scripts in the quizx/scripts folder inside of a Jupyter notebook with PyZX. These bindings should be installable from pip from multiple platforms. For linux/maybe MacOS it might be possible to make this installable from source. For the Windows bindings precompiled packages might be necessary for different platforms.

I'm honestly not sure how this works, but I'm sure there are good guides out there for how to get Rust packages to work nicely with PyPI and pip.

For the names of the functions, I would try as much as possible to stick to the naming scheme of PyZX. If some functions (like the simplification procedures) could be made into drop-in replacements for the PyZX equivalent, that would be great as well.

srinjoyganguly commented 2 years ago

Hi John,

Thank you so much for the tips! I will get started with it with my colleagues.

srinjoyganguly commented 2 years ago

Hi John,

We have started to work on the quizx/scripts binding and the issue with pip installable mechanism for Linux/MacOS.

I had a doubt about your last statement - "For the names of the functions, I would try as much as possible to stick to the naming scheme of PyZX. If some functions (like the simplification procedures) could be made into drop-in replacements for the PyZX equivalent, that would be great as well."

I want to clarify, the names of the functions from PyZX that you would like to us make a binder from. For example, we found the hsimplify.py file here, do we need to make a binder for this file? Can you please clarify the file names of PyZX for binder making?

I look forward to hearing from you soon. Thank you so much!

jvdwetering commented 2 years ago

PyZX has more features than quizx, but where quizx overlaps with PyZX I would try to make sure that the naming scheme is the same. hsimplify contains methods that aren't implemented by quizx, so you don't have to worry about that.