From 60e81c58ee41966e33ea3dcff962460b5f2bc759 Mon Sep 17 00:00:00 2001 From: Junya Otsuki Date: Thu, 25 Apr 2024 12:27:40 +0900 Subject: [PATCH] minor updates --- doc/reference/interaction.rst | 10 +++++++--- src/dcore/interaction.py | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/reference/interaction.rst b/doc/reference/interaction.rst index e4678969..f0e47b4a 100644 --- a/doc/reference/interaction.rst +++ b/doc/reference/interaction.rst @@ -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 @@ -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 diff --git a/src/dcore/interaction.py b/src/dcore/interaction.py index e021ff74..c340c822 100644 --- a/src/dcore/interaction.py +++ b/src/dcore/interaction.py @@ -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)