Skip to content

Create test_drop_observable_irrelevant_ops2.py#7983

Open
love-os-architect wants to merge 1 commit intoquantumlib:mainfrom
love-os-architect:patch-4
Open

Create test_drop_observable_irrelevant_ops2.py#7983
love-os-architect wants to merge 1 commit intoquantumlib:mainfrom
love-os-architect:patch-4

Conversation

@love-os-architect
Copy link
Copy Markdown

No description provided.

@love-os-architect love-os-architect requested review from a team and vtomole as code owners March 27, 2026 10:24
@github-actions github-actions bot added the size: M 50< lines changed <250 label Mar 27, 2026
@mhucka
Copy link
Copy Markdown
Contributor

mhucka commented Mar 27, 2026

@love-os-architect Thank you for your interest in Cirq. Can you explain what is happening with all these PRs? They lack descriptions, and there's 4 of them (plus others that you quickly closed).

@mhucka mhucka added the triage/discuss Needs decision / discussion, bring these up during Cirq Cynque label Mar 27, 2026
@love-os-architect
Copy link
Copy Markdown
Author

love-os-architect commented Mar 28, 2026

@love-os-architect Thank you for your interest in Cirq. Can you explain what is happening with all these PRs? They lack descriptions, and there's 4 of them (plus others that you quickly closed).

Hi @mhucka,

Thank you for the ping, and my sincere apologies for the confusion and the lack of descriptions.

I am currently working on implementing a new geometric regularization approach (Phase-Space Filtering) designed to minimize divergence and dissipation in quantum observables. My initial goal was to test how this architecture integrates across different modules in Cirq's CI/CD pipeline, which resulted in the multiple/closed PRs as I was iterating on the fly.

To clarify the exact intent behind this specific PR, please see the details below:

What does this PR do?
This PR introduces DropObservableIrrelevantOps, a new transformer designed to safely remove operations that are provably irrelevant to the observable measurement outcomes of a circuit.

Unlike simple peephole optimizations, this pass implements a strict, time-aware, and observable-context-aware static analysis. It evaluates operations against the temporal boundaries defined by independent measurement keys, ensuring zero false positives and strict adherence to classical register semantics.

Motivation
Currently, removing diagonal gates (like Z or CZ) before measurements requires specific pattern matching (e.g., drop_diagonal_before_measurement). However, when dealing with complex circuits featuring multiple independent observers (different measurement keys) or temporally separated measurements, a more robust, generalized approach is needed.

This transformer strictly isolates measurement keys as independent observable contexts and uses moment indices to establish definitive causal boundaries.

Best regards,
Love-OS Architect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: M 50< lines changed <250 triage/discuss Needs decision / discussion, bring these up during Cirq Cynque

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants