Skip to content

Commit 37eac9f

Browse files
committed
docs: convert docstrings from rST to Google style
Replace rST-syntax double-backtick inline code (`code`) and cross-reference roles (:func:, :class:) with plain text, per OpenFermion's Google-style (TensorFlow) docstring convention. Affected sections: - get_chemist_two_body_coefficients Raises block - low_rank_two_body_decomposition Raises block - LowRankTrotterAlgorithm Note block
1 parent 201d58b commit 37eac9f

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/openfermion/circuits/low_rank.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ def get_chemist_two_body_coefficients(two_body_coefficients, spin_basis=True):
4646
Raises:
4747
ValueError: Input two-body tensor is not spin-symmetric. The LOW_RANK
4848
decomposition requires a spin-symmetric interaction when
49-
``spin_basis=True``. A spin-symmetric interaction satisfies
50-
``h[p,q,r,s] == h[p+1,q+1,r+1,s+1]`` for all even p, q, r, s
49+
spin_basis=True. A spin-symmetric interaction satisfies
50+
h[p,q,r,s] == h[p+1,q+1,r+1,s+1] for all even p, q, r, s
5151
(i.e., the same coefficient for alpha and beta spin channels).
52-
Consider passing ``spin_basis=False`` if your Hamiltonian is not
52+
Consider passing spin_basis=False if your Hamiltonian is not
5353
spin-symmetric.
5454
"""
5555
# Initialize.
@@ -136,9 +136,9 @@ def low_rank_two_body_decomposition(
136136
137137
Raises:
138138
ValueError: The two-body tensor failed symmetry or reality checks
139-
required for the low-rank decomposition. When ``spin_basis=True``,
139+
required for the low-rank decomposition. When spin_basis=True,
140140
the tensor must be spin-symmetric (see
141-
:func:`get_chemist_two_body_coefficients`). When ``spin_basis=False``,
141+
get_chemist_two_body_coefficients()). When spin_basis=False,
142142
the chemist-ordered tensor must be real and symmetric.
143143
"""
144144
# Initialize N^2 by N^2 interaction array.

src/openfermion/circuits/trotter/algorithms/low_rank.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ class LowRankTrotterAlgorithm(TrotterAlgorithm):
6666
where x is a truncation threshold specified by user.
6767
6868
Note:
69-
When ``spin_basis=True`` (the default), the input
70-
:class:`~openfermion.ops.InteractionOperator` must have a
69+
When spin_basis=True (the default), the input
70+
InteractionOperator must have a
7171
spin-symmetric two-body tensor, i.e. identical interaction
7272
coefficients for the alpha and beta spin channels. Hamiltonians
73-
that break this symmetry will raise a ``ValueError``.
73+
that break this symmetry will raise a ValueError.
7474
"""
7575

7676
supported_types = {ops.InteractionOperator}

0 commit comments

Comments
 (0)