quantumlib / Cirq

A python framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits.
Apache License 2.0
4.19k stars 995 forks source link

add a ZX-calculus transformer to Cirq #6585

Open dlyongemallo opened 1 month ago

dlyongemallo commented 1 month ago

Is your feature request related to a use case or problem? Please describe.

I would like to experiment with various circuit optimisation routines (which are already implemented in PyZX) using Cirq.

Describe the solution you'd like

A transformer (maybe under contrib) which uses the PyZX library for optimisation. I've mocked up what such a thing might look like here, but the current version isn't able to handle all transformations of Cirq circuits into PyZX format yet. (In particular, the conversion cannot at the moment handle arbitrary angles for certain types of gates.)

[optional] Describe alternatives/workarounds you've considered

It could also stay as an independent repo/project, as it is now. Mostly I'm interested in knowing whether other people (Cirq maintainers or members of the community) might be interested in helping to write this, or to use it.

[optional] Additional context (e.g. screenshots)

I spoke about this at the last Cirq Cync (Apr. 24, 2024).

What is the urgency from your perspective for this issue? Is it blocking important work?

P3 - I'm not really blocked by it, it is an idea I'd like to discuss / suggestion based on principle

dstrain115 commented 1 month ago

@dlyongemallo I have a student who is interested in working on this. @naerabati Can you comment if you would like to work on this and coordinate with him?

naerabati commented 1 month ago

@dlyongemallo Yes! I would be interested in helping with this feature

dlyongemallo commented 1 month ago

Great!

Would it make more sense to roll this into Cirq, or leave it as a separate project? In the former case, what's the standard procedure now @dstrain115, e.g., do we develop on a branch and then merge it into main when the minimal viable product is reached?

NoureldinYosri commented 1 month ago

@dlyongemallo hey, last cirq-sync we agreed on putting it in cirq-core/cirq/contrib. to make it easier to review you can add it incremently, that is open a PR to merge to main when a new part is ready. feel free to assign PR reviews to me

dlyongemallo commented 2 weeks ago

@naerabati @NoureldinYosri Please see PR #6647.