Skip to content

Commit

Permalink
Docstrings update related to #99
Browse files Browse the repository at this point in the history
  • Loading branch information
shiozaki committed Jun 28, 2021
1 parent b091fcd commit 9f1e59c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/fqe/_fqe_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,9 @@ def get_restricted_hamiltonian(
"""Initialize spin conserving spin restricted hamiltonian
Args:
tensors (Tuple[numpy.ndarray, ...]) - tensors for the Hamiltonian elements
tensors (Tuple[numpy.ndarray, ...]) - tensors for the Hamiltonian elements. \
Note that the tensor should be in a spin-free form; therefore, \
the size of each dimension is the number of spatial orbitals.
e_0 (complex) - scalar part of the Hamiltonian
"""
Expand Down
7 changes: 4 additions & 3 deletions src/fqe/hamiltonians/restricted_hamiltonian.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ def __init__(self,
Arguments:
tensors: Variable length tuple containg between one and four
numpy.arrays of increasing rank. The tensors contain the
n-body hamiltonian elements. Tensors up to the highest
order must be included even if the lower terms are full of
zeros.
n-body hamiltonian elements in the spin-free form.
Therefore, the size of each dimension is the number of
spatial orbitals. Tensors up to the highest order must be
included even if the lower terms are full of zeros.
e_0: Scalar potential associated with the Hamiltonian.
"""
super().__init__(e_0=e_0)
Expand Down

1 comment on commit 9f1e59c

@cvjjm
Copy link

@cvjjm cvjjm commented on 9f1e59c Jun 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still would advice against calling these tensors "hamiltonian elements" as their entries do not directly appear as "elements" when the Hamiltonian is written in second quantized form or as a matrix. They really are tensors of spin-adapted integrals and neither "elements" nor coefficients. Also please add a check of the input tensor's shape. I am sure it will save you a lot of issues opened by users in the future...

Please sign in to comment.