Skip to content

Commit

Permalink
minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
j-otsuki committed Apr 25, 2024
1 parent cba5282 commit 60e81c5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions doc/reference/interaction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,15 @@ The suppored formats are

- **NumPy .npy format (binary file)**: Four dimensional NumPy array corresponding to :math:`U^{i}_{\alpha \beta \gamma \delta}` for shell :math:`i` is save by ``numpy.save`` command.

- **text file**: :math:`U^{i}_{\alpha \beta \gamma \delta}` for each shell :math:`i` is written in a one dimansional manner as follows
- **text file**: :math:`U^{i}_{\alpha \beta \gamma \delta}` for each shell :math:`i` is written in a one dimansional manner as follows (example for ``norb=3`` without spin-orbit coupling)

::

Re(U[0,0,0,0])
Re(U[0,0,0,1])
Re(U[0,0,0,2])
Re(U[0,0,1,0])
...

or

Expand All @@ -168,10 +170,12 @@ The suppored formats are
Re(U[0,0,0,0]) Im(U[0,0,0,0])
Re(U[0,0,0,1]) Im(U[0,0,0,1])
Re(U[0,0,0,2]) Im(U[0,0,0,2])
Re(U[0,0,1,0]) Im(U[0,0,1,0])
...

No space should be put between different blocks. Lines beginning with `#` are skipped.
No blank line should be put between consecutive elements. Lines beginning with `#` are skipped.

The definition of U tensor depends on the ``spin_orbit`` parameter.
The definition of the U tensor depends on the ``spin_orbit`` parameter.
For ``spin_orbit=False``, :math:`U^{i}_{\alpha \beta \gamma \delta}` is defined by Eq. :eq:`H_int`. The shape of the U tensor is ``(norb, norb, norb, norb)``.

For ``spin_orbit=True``, on the other hand, :math:`U^{i}_{\alpha \beta \gamma \delta}` is defined by
Expand Down
2 changes: 1 addition & 1 deletion src/dcore/interaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def _generate_umat_file(p: Dict):
# float (norb^4, 2) -> complex (norb^4, 1) -> complex (norb,norb,norb,norb)
umat = umat_1d.view(complex).reshape(u_shape)
else:
raise Exception(f"inconsisten shape: require {(numpy.prod(u_shape),)} for real U or {(numpy.prod(u_shape), 2)} for complex U, but {umat_1d.shape} is given.")
raise Exception(f"inconsistent shape: require {(numpy.prod(u_shape),)} for real U or {(numpy.prod(u_shape), 2)} for complex U, but {umat_1d.shape} is given.")
except Exception as e:
print(f"\nError in reading file '{file}' for ish={ish}", file=sys.stderr)
print(e, file=sys.stderr)
Expand Down

0 comments on commit 60e81c5

Please sign in to comment.