Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pass to remove Phase gates #1735

Merged
merged 7 commits into from
Jan 10, 2025
Merged

Add pass to remove Phase gates #1735

merged 7 commits into from
Jan 10, 2025

Conversation

cqc-alec
Copy link
Collaborator

@cqc-alec cqc-alec commented Jan 10, 2025

Closes #1733 .

@cqc-alec cqc-alec changed the title Ae/rmphasenodes Add pass to remove Phase gates Jan 10, 2025
@cqc-alec cqc-alec marked this pull request as ready for review January 10, 2025 10:59
@@ -2574,7 +2574,7 @@ class Circuit:
@property
def wasm_uid(self) -> str | None:
"""
:return: the unique wasm uid of the circuit
:return: the unique WASM UID of the circuit, or `None` if the circuit has none
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why this wasn't caught by the CI check previously.

@@ -679,6 +679,9 @@ PYBIND11_MODULE(passes, m) {
m.def(
"RemoveBarriers", &RemoveBarriers,
"A pass to remove all barrier instructions from the circuit.");
m.def(
"RemovePhaseOps", &RemovePhaseOps,
"A pass to remove all Phase operations from the circuit.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation should probably specify the limits of this pass, i.e. removes conditional Phases but not Phases within other boxes/controlled operations. Beyond this, the PR looks all good

@cqc-alec cqc-alec merged commit 75d584f into main Jan 10, 2025
32 checks passed
@cqc-alec cqc-alec deleted the ae/rmphasenodes branch January 10, 2025 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add pass to remove Phase gates
2 participants