graphix icon indicating copy to clipboard operation
graphix copied to clipboard

Fix #188: Fix Pauli measurement conventions

Open thierry-martinez opened this issue 1 year ago • 0 comments

This commit introduces a new named tuple, graphix.pauli.Measure, which contains a pair (axis, sign). It includes a static method, try_from, that returns an instance of Measure if the given plane and angle represent a valid Pauli measure, or None otherwise.

The axis is computed using the cos and sin definitions from pauli.py, addressing the inconsistency bug reported in #188.

Additionally, this commit introduces a new Sign class, which enhances the readability of code that manipulates Plus and Minus values, as opposed to using bool.

Note: This PR follows up on #189, focusing on fixing #188 while preserving the equality test for recognizing Pauli measures.

thierry-martinez avatar Aug 09 '24 19:08 thierry-martinez