Skip to content

Add tolerance to modulus check in has_stabilizer_effect #7750

@ACE07-Sev

Description

@ACE07-Sev

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

This issue happens when we have a gate with an exponent like 0.99999999 or 1.000000001 and such to return False for has_stabilizer_effect despite the difference being very negligible.

import cirq

op = cirq.XPowGate(exponent=1.00000001)
print(op._has_stabilizer_effect_()) # False

op = cirq.XPowGate(exponent=1.0)
print(op._has_stabilizer_effect_()) # True

Describe the solution you would prefer

Add rounding or tolerance to has_stabilizer_effect to allow for a more flexible handling of this case.

How urgent is this for you? Is it blocking important work?

P3 – I'm not really blocked by it; it's an idea I'm proposing based on principle

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/feature-requestDescribes new functionalitytriage/needs-more-evidence[Feature requests] Seems plausible, but maintainers are not convinced about the use cases yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions