Skip to content

Commit

Permalink
Fix order of operations in Tableau.__call__.__doc__ (#822)
Browse files Browse the repository at this point in the history
Derived from #786, after
regenerating docs

Fixes #819

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Amir Ebrahimi <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matt McEwen <[email protected]>
  • Loading branch information
4 people authored Sep 13, 2024
1 parent ef2a092 commit 36cb178
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 17 deletions.
8 changes: 4 additions & 4 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 12 additions & 3 deletions doc/python_api_reference_vDev.md
Original file line number Diff line number Diff line change
Expand Up @@ -10845,10 +10845,19 @@ def __call__(
self,
pauli_string: stim.PauliString,
) -> stim.PauliString:
"""Returns the conjugation of a PauliString by the Tableau's Clifford operation.
"""Returns the equivalent PauliString after the Tableau's Clifford operation.
The conjugation of P by C is equal to C**-1 * P * C. If P is a Pauli product
before C, then P2 = C**-1 * P * C is an equivalent Pauli product after C.
If P is a Pauli product before a Clifford operation C, then this method returns
Q = C * P * C**-1 (the conjugation of P by C). Q is the equivalent Pauli product
after C. This works because:
C*P
= C*P * I
= C*P * (C**-1 * C)
= (C*P*C**-1) * C
= Q*C
(Keep in mind that A*B means first B is applied, then A is applied.)
Args:
pauli_string: The pauli string to conjugate.
Expand Down
15 changes: 12 additions & 3 deletions doc/stim.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -8484,10 +8484,19 @@ class Tableau:
self,
pauli_string: stim.PauliString,
) -> stim.PauliString:
"""Returns the conjugation of a PauliString by the Tableau's Clifford operation.
"""Returns the equivalent PauliString after the Tableau's Clifford operation.
The conjugation of P by C is equal to C**-1 * P * C. If P is a Pauli product
before C, then P2 = C**-1 * P * C is an equivalent Pauli product after C.
If P is a Pauli product before a Clifford operation C, then this method returns
Q = C * P * C**-1 (the conjugation of P by C). Q is the equivalent Pauli product
after C. This works because:
C*P
= C*P * I
= C*P * (C**-1 * C)
= (C*P*C**-1) * C
= Q*C
(Keep in mind that A*B means first B is applied, then A is applied.)
Args:
pauli_string: The pauli string to conjugate.
Expand Down
15 changes: 12 additions & 3 deletions glue/python/src/stim/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -8484,10 +8484,19 @@ class Tableau:
self,
pauli_string: stim.PauliString,
) -> stim.PauliString:
"""Returns the conjugation of a PauliString by the Tableau's Clifford operation.
"""Returns the equivalent PauliString after the Tableau's Clifford operation.
The conjugation of P by C is equal to C**-1 * P * C. If P is a Pauli product
before C, then P2 = C**-1 * P * C is an equivalent Pauli product after C.
If P is a Pauli product before a Clifford operation C, then this method returns
Q = C * P * C**-1 (the conjugation of P by C). Q is the equivalent Pauli product
after C. This works because:
C*P
= C*P * I
= C*P * (C**-1 * C)
= (C*P*C**-1) * C
= Q*C
(Keep in mind that A*B means first B is applied, then A is applied.)
Args:
pauli_string: The pauli string to conjugate.
Expand Down
17 changes: 13 additions & 4 deletions src/stim/stabilizers/tableau.pybind.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1883,10 +1883,19 @@ void stim_pybind::pybind_tableau_methods(pybind11::module &m, pybind11::class_<T
},
pybind11::arg("pauli_string"),
clean_doc_string(R"DOC(
Returns the conjugation of a PauliString by the Tableau's Clifford operation.
The conjugation of P by C is equal to C**-1 * P * C. If P is a Pauli product
before C, then P2 = C**-1 * P * C is an equivalent Pauli product after C.
Returns the equivalent PauliString after the Tableau's Clifford operation.
If P is a Pauli product before a Clifford operation C, then this method returns
Q = C * P * C**-1 (the conjugation of P by C). Q is the equivalent Pauli product
after C. This works because:
C*P
= C*P * I
= C*P * (C**-1 * C)
= (C*P*C**-1) * C
= Q*C
(Keep in mind that A*B means first B is applied, then A is applied.)
Args:
pauli_string: The pauli string to conjugate.
Expand Down

0 comments on commit 36cb178

Please sign in to comment.