@@ -27,7 +27,7 @@ class PauliString:
27
27
monomials : List of Pauli monomials.
28
28
29
29
Example:
30
- >>> I@ Z + 2*Y@ I + X@ Z
30
+ >>> I @ Z + 2 * Y @ I + X @ Z
31
31
1*I@Z + 2*Y@I + 1*X@Z
32
32
"""
33
33
@@ -142,7 +142,7 @@ def simplify(self) -> PauliString:
142
142
"""Simplify the PauliString by combining like terms and removing terms with zero coefficients.
143
143
144
144
Example:
145
- >>> ps = I@ I - 2* I@ I + Z@ I - Z@ I
145
+ >>> ps = I @ I - 2 * I @ I + Z @ I - Z @ I
146
146
>>> simplified_ps = ps.simplify()
147
147
>>> print(simplified_ps)
148
148
-1*I@I
@@ -471,27 +471,24 @@ def __hash__(self):
471
471
_allow_atom_creation = True
472
472
473
473
I = PauliStringAtom ("I" , np .eye (2 , dtype = np .complex64 ))
474
- """Pauli-I atom representing the identity operator in a Pauli monomial or string.
474
+ r """Pauli-I atom representing the identity operator in a Pauli monomial or string.
475
475
Matrix representation:
476
- [1 0]
477
- [0 1]
476
+ `\begin{pmatrix}1&0\\0&1\end{pmatrix}`
478
477
"""
479
478
X = PauliStringAtom ("X" , 1 - np .eye (2 , dtype = np .complex64 ))
480
- """Pauli-X atom representing the X operator in a Pauli monomial or string.
479
+ r """Pauli-X atom representing the X operator in a Pauli monomial or string.
481
480
Matrix representation:
482
- [0 1]
483
- [1 0]
481
+ `\begin{pmatrix}0&1\\1&0\end{pmatrix}`
482
+
484
483
"""
485
484
Y = PauliStringAtom ("Y" , np .fliplr (np .diag ([1j , - 1j ])))
486
- """Pauli-Y atom representing the Y operator in a Pauli monomial or string.
485
+ r """Pauli-Y atom representing the Y operator in a Pauli monomial or string.
487
486
Matrix representation:
488
- [0 -i]
489
- [i 0]
487
+ `\begin{pmatrix}0&-i\\i&0\end{pmatrix}`
490
488
"""
491
489
Z = PauliStringAtom ("Z" , np .diag ([1 , - 1 ]))
492
- """Pauli-Z atom representing the Z operator in a Pauli monomial or string.
490
+ r """Pauli-Z atom representing the Z operator in a Pauli monomial or string.
493
491
Matrix representation:
494
- [1 0]
495
- [0 -1]
492
+ `\begin{pmatrix}1&0\\0&-1\end{pmatrix}`
496
493
"""
497
494
_allow_atom_creation = False
0 commit comments