Skip to content

Add PyZX-based ZX transformer to contrib (gh-6585)#8172

Draft
anshjaiswal12 wants to merge 2 commits into
quantumlib:mainfrom
anshjaiswal12:feat/zx-transformer-6585
Draft

Add PyZX-based ZX transformer to contrib (gh-6585)#8172
anshjaiswal12 wants to merge 2 commits into
quantumlib:mainfrom
anshjaiswal12:feat/zx-transformer-6585

Conversation

@anshjaiswal12

Copy link
Copy Markdown

Summary

Adds cirq.contrib.zxtransformer with bidirectional Cirq↔PyZX conversion, full_reduce optimization, and support for measurements, resets, and classically controlled rotations. Based on PR #6647 and the author's reference implementation.

Closes #6585

Tests

pytest cirq/contrib/zxtransformer/zxtransformer_test.py — 24 tests (requires pyzx installed).

Tooling note

AI disclosure: Cursor IDE was used only to read/search the codebase and help debug the issue. All code in this PR was written and reviewed by me.

Introduce cirq.contrib.zxtransformer with bidirectional Cirq↔PyZX
conversion, full_reduce optimization, and support for measurements,
resets, and classically controlled rotations. Based on the design from
PR quantumlib#6647 and the author's cirq-zx-transformer reference implementation.

Closes quantumlib#6585
Document the Cirq↔PyZX conversion pipeline, pyzx dependency, and
supported optimization flow.
@google-cla

google-cla Bot commented Jun 30, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions Bot added the size: L 250< lines changed <1000 label Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: L 250< lines changed <1000

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add a ZX-calculus transformer to Cirq

1 participant