Cirq icon indicating copy to clipboard operation
Cirq copied to clipboard

add a ZX-calculus transformer to Cirq

Open dlyongemallo opened this issue 1 year ago • 7 comments

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

dlyongemallo avatar May 05 '24 14:05 dlyongemallo

@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?

dstrain115 avatar May 08 '24 17:05 dstrain115

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

naerabati avatar May 09 '24 15:05 naerabati

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?

dlyongemallo avatar May 09 '24 15:05 dlyongemallo

@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

NoureldinYosri avatar May 09 '24 16:05 NoureldinYosri

@naerabati @NoureldinYosri Please see PR #6647.

dlyongemallo avatar Jun 13 '24 18:06 dlyongemallo

I'm too busy to complete the PR. Can someone take it over?

dlyongemallo avatar Sep 30 '24 04:09 dlyongemallo