Skip to content

Commit 1614bbe

Browse files
committed
Use raw strings for docstrings
This silences `SyntaxWarning` in Python 3.12 that comes from the MathJax math constructs inside the docstrings.
1 parent 33cf67f commit 1614bbe

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/openfermion/linalg/erpa.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
def erpa_eom_hamiltonian(
1212
h_ijkl: numpy.ndarray, tpdm: numpy.ndarray, p: int, q: int, r: int, s: int
1313
) -> Union[float, complex]:
14-
"""
14+
r"""
1515
Evaluate $\sum_{a,b,c,d}h_{a, b, d, c}<\psi[p^ q, [a^ b^ c d, r^ s]]\psi>$
1616
1717
Args:

src/openfermion/linalg/wave_fitting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def fit_known_frequencies(
4040

4141

4242
def prony(signal: numpy.ndarray) -> Tuple[numpy.ndarray, numpy.ndarray]:
43-
"""Estimates amplitudes and phases of a sparse signal using Prony's method.
43+
r"""Estimates amplitudes and phases of a sparse signal using Prony's method.
4444
4545
Single-ancilla quantum phase estimation returns a signal
4646
$g(k)=\sum (aj*exp(i*k*phij))$, where aj and phij are the amplitudes

src/openfermion/linalg/wedge_product.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def generate_parity_permutations(seq):
6767

6868

6969
def wedge(left_tensor, right_tensor, left_index_ranks, right_index_ranks):
70-
"""
70+
r"""
7171
Implement the wedge product between left_tensor and right_tensor
7272
7373
The wedge product is defined as

src/openfermion/utils/bch_expansion.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717

1818
def bch_expand(*ops, **kwargs):
19-
"""Compute $\log[e^{x_1} ... e^{x_N}]$ using the BCH formula.
19+
r"""Compute $\log[e^{x_1} ... e^{x_N}]$ using the BCH formula.
2020
2121
This implementation is explained in arXiv:1712.01348.
2222
@@ -65,7 +65,7 @@ def _bch_expand_multiple_terms(*ops, **kwargs):
6565

6666

6767
def _bch_expand_two_terms(x, y, order=6):
68-
"""Compute $\log[e^x e^y]$ using the Baker-Campbell-Hausdorff formula.
68+
r"""Compute $\log[e^x e^y]$ using the Baker-Campbell-Hausdorff formula.
6969
7070
Args:
7171
x: An operator for which multiplication and addition are supported.

0 commit comments

Comments
 (0)