class-solution
Daniel Pozsar 2 months ago
parent e883d151cd
commit 4563c33eb3

@ -6,7 +6,6 @@ More on the theoretical background can be seen on [arXiv](https://arxiv.org/abs/
- Run tests on different magnetic materials and compare it to Grogu Matlab --> ran on Jij_for_Marci_6p45ang, but I could not compare data - Run tests on different magnetic materials and compare it to Grogu Matlab --> ran on Jij_for_Marci_6p45ang, but I could not compare data
## Developing ## Developing
- Add documentation to `useful` functions and more...
- Check the symmetrization of the Hamiltonian and overlap matrix to make them hermitian - Check the symmetrization of the Hamiltonian and overlap matrix to make them hermitian
- Check if exchange field has scalar part - Check if exchange field has scalar part
- Add more tests!! - Add more tests!!

@ -22,11 +22,3 @@ from grogupy.core import *
from grogupy.io import * from grogupy.io import *
from grogupy.magnetism import * from grogupy.magnetism import *
from grogupy.utils import * from grogupy.utils import *
try:
from tqdm import tqdm
tqdm_imported = True
except:
print("Please install tqdm for nice progress bar.")
tqdm_imported = False

@ -23,10 +23,24 @@ import warnings
from sys import getsizeof from sys import getsizeof
from timeit import default_timer as timer from timeit import default_timer as timer
# use numpy number of threads one
from threadpoolctl import threadpool_info, threadpool_limits
user_api = threadpool_info()[0]["user_api"]
threadpool_limits(limits=1, user_api=user_api)
import numpy as np import numpy as np
import sisl import sisl
from mpi4py import MPI from mpi4py import MPI
try:
from tqdm import tqdm
tqdm_imported = True
except:
print("Please install tqdm for nice progress bar.")
tqdm_imported = False
from grogupy import * from grogupy import *

@ -133,12 +133,6 @@ def print_parameters(simulation_parameters):
print( print(
"================================================================================================================================================================" "================================================================================================================================================================"
) )
if simulation_parameters["calculate_charge"]:
print("The calculated charge of the Hamiltonian in the quantization axes: ")
print(simulation_parameters["charges"])
print(
"================================================================================================================================================================"
)
def print_atoms_and_pairs(magnetic_entities, pairs): def print_atoms_and_pairs(magnetic_entities, pairs):
@ -319,12 +313,3 @@ def print_job_description(simulation_parameters):
print( print(
"================================================================================================================================================================" "================================================================================================================================================================"
) )
if simulation_parameters["calculate_charge"]:
print(
"Charge calculation required: True WARNING: This causes a slowdown, because we have to use the complete Greens function!"
)
else:
print("Charge calculation required: False")
print(
"================================================================================================================================================================"
)

@ -2,73 +2,31 @@
"cells": [ "cells": [
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 29, "execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[{'architecture': 'armv8',\n",
" 'filepath': '/Users/danielpozsar/Documents/oktatás/elte/phd/grogu_project/.venv/lib/python3.9/site-packages/numpy/.dylibs/libopenblas64_.0.dylib',\n",
" 'internal_api': 'openblas',\n",
" 'num_threads': 1,\n",
" 'prefix': 'libopenblas',\n",
" 'threading_layer': 'pthreads',\n",
" 'user_api': 'blas',\n",
" 'version': '0.3.21'},\n",
" {'architecture': 'neoversen1',\n",
" 'filepath': '/Users/danielpozsar/Documents/oktatás/elte/phd/grogu_project/.venv/lib/python3.9/site-packages/scipy/.dylibs/libopenblas.0.dylib',\n",
" 'internal_api': 'openblas',\n",
" 'num_threads': 1,\n",
" 'prefix': 'libopenblas',\n",
" 'threading_layer': 'pthreads',\n",
" 'user_api': 'blas',\n",
" 'version': '0.3.27'}]\n"
]
}
],
"source": [
"from threadpoolctl import threadpool_info\n",
"from pprint import pprint\n",
"import numpy\n",
"\n",
"pprint(threadpool_info())"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"import os\n", "# use numpy number of threads one\n",
"\n", "# from threadpoolctl import threadpool_info, threadpool_limits\n",
"os.environ[\"OMP_NUM_THREADS\"] = \"1\" # export OMP_NUM_THREADS=1\n", "# print(threadpool_info())\n",
"os.environ[\"OPENBLAS_NUM_THREADS\"] = \"1\" # export OPENBLAS_NUM_THREADS=1\n", "# user_api = threadpool_info()[0][\"user_api\"]\n",
"os.environ[\"MKL_NUM_THREADS\"] = \"1\" # export MKL_NUM_THREADS=1\n", "# threadpool_limits(limits=1, user_api=user_api)"
"os.environ[\"VECLIB_MAXIMUM_THREADS\"] = \"1\" # export VECLIB_MAXIMUM_THREADS=1\n",
"os.environ[\"NUMEXPR_NUM_THREADS\"] = \"1\" # export NUMEXPR_NUM_THREADS=1"
] ]
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 3, "execution_count": null,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
"name": "stdout", "ename": "ImportError",
"output_type": "stream", "evalue": "attempted relative import with no known parent package",
"text": [ "output_type": "error",
"0.14.3\n", "traceback": [
"1.24.4\n" "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
] "\u001b[0;31mImportError\u001b[0m Traceback (most recent call last)",
}, "Cell \u001b[0;32mIn[6], line 5\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mtimeit\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m default_timer \u001b[38;5;28;01mas\u001b[39;00m timer\n\u001b[1;32m 4\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01msisl\u001b[39;00m\n\u001b[0;32m----> 5\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01msrc\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mgrogupy\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;241m*\u001b[39m\n\u001b[1;32m 6\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mmpi4py\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m MPI\n\u001b[1;32m 7\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mwarnings\u001b[39;00m\n",
{ "\u001b[0;31mImportError\u001b[0m: attempted relative import with no known parent package"
"name": "stderr",
"output_type": "stream",
"text": [
"[Daniels-Air:88431] shmem: mmap: an error occurred while determining whether or not /var/folders/yh/dx7xl94n3g52ts3td8qcxjcc0000gn/T//ompi.Daniels-Air.501/jf.0/455868416/sm_segment.Daniels-Air.501.1b2c0000.0 could be created.\n"
] ]
} }
], ],
@ -77,8 +35,7 @@
"from timeit import default_timer as timer\n", "from timeit import default_timer as timer\n",
"\n", "\n",
"import sisl\n", "import sisl\n",
"import sisl.viz\n", "from src.grogupy import *\n",
"from src.grogu_magn import *\n",
"from mpi4py import MPI\n", "from mpi4py import MPI\n",
"import warnings\n", "import warnings\n",
"\n", "\n",
@ -103,7 +60,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 32, "execution_count": 3,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -120,7 +77,7 @@
" [0., 1., 0.]])}]" " [0., 1., 0.]])}]"
] ]
}, },
"execution_count": 32, "execution_count": 3,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
@ -237,7 +194,7 @@
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mKeyError\u001b[0m Traceback (most recent call last)", "\u001b[0;31mKeyError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[5], line 43\u001b[0m\n\u001b[1;32m 40\u001b[0m uc_in_sc_idx \u001b[38;5;241m=\u001b[39m dh\u001b[38;5;241m.\u001b[39mlattice\u001b[38;5;241m.\u001b[39msc_index([\u001b[38;5;241m0\u001b[39m, \u001b[38;5;241m0\u001b[39m, \u001b[38;5;241m0\u001b[39m])\n\u001b[1;32m 42\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m rank \u001b[38;5;241m==\u001b[39m root_node:\n\u001b[0;32m---> 43\u001b[0m \u001b[43mprint_parameters\u001b[49m\u001b[43m(\u001b[49m\u001b[43msimulation_parameters\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 44\u001b[0m times[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124msetup_time\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m timer()\n\u001b[1;32m 45\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mSetup done. Elapsed time: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mtimes[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124msetup_time\u001b[39m\u001b[38;5;124m'\u001b[39m]\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m s\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n", "Cell \u001b[0;32mIn[5], line 43\u001b[0m\n\u001b[1;32m 40\u001b[0m uc_in_sc_idx \u001b[38;5;241m=\u001b[39m dh\u001b[38;5;241m.\u001b[39mlattice\u001b[38;5;241m.\u001b[39msc_index([\u001b[38;5;241m0\u001b[39m, \u001b[38;5;241m0\u001b[39m, \u001b[38;5;241m0\u001b[39m])\n\u001b[1;32m 42\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m rank \u001b[38;5;241m==\u001b[39m root_node:\n\u001b[0;32m---> 43\u001b[0m \u001b[43mprint_parameters\u001b[49m\u001b[43m(\u001b[49m\u001b[43msimulation_parameters\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 44\u001b[0m times[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124msetup_time\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m timer()\n\u001b[1;32m 45\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mSetup done. Elapsed time: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mtimes[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124msetup_time\u001b[39m\u001b[38;5;124m'\u001b[39m]\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m s\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n",
"File \u001b[0;32m~/Documents/oktatás/elte/phd/grogu_project/src/grogu_magn/io.py:116\u001b[0m, in \u001b[0;36mprint_parameters\u001b[0;34m(simulation_parameters)\u001b[0m\n\u001b[1;32m 112\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mEsetp: \u001b[39m\u001b[38;5;124m\"\u001b[39m, simulation_parameters[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mesetp\u001b[39m\u001b[38;5;124m\"\u001b[39m])\n\u001b[1;32m 113\u001b[0m \u001b[38;5;28mprint\u001b[39m(\n\u001b[1;32m 114\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m================================================================================================================================================================\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 115\u001b[0m )\n\u001b[0;32m--> 116\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[43msimulation_parameters\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mcalculate_charge\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m:\n\u001b[1;32m 117\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mThe calculated charge of the Hamiltonian in the quantization axes: \u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 118\u001b[0m \u001b[38;5;28mprint\u001b[39m(simulation_parameters[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcharges\u001b[39m\u001b[38;5;124m\"\u001b[39m])\n", "File \u001b[0;32m~/Documents/oktatás/elte/phd/grogu_project/.venv/lib/python3.9/site-packages/grogupy/io.py:132\u001b[0m, in \u001b[0;36mprint_parameters\u001b[0;34m(simulation_parameters)\u001b[0m\n\u001b[1;32m 128\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mEsetp: \u001b[39m\u001b[38;5;124m\"\u001b[39m, simulation_parameters[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mesetp\u001b[39m\u001b[38;5;124m\"\u001b[39m])\n\u001b[1;32m 129\u001b[0m \u001b[38;5;28mprint\u001b[39m(\n\u001b[1;32m 130\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m================================================================================================================================================================\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 131\u001b[0m )\n\u001b[0;32m--> 132\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[43msimulation_parameters\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mcalculate_charge\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m:\n\u001b[1;32m 133\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mThe calculated charge of the Hamiltonian in the quantization axes: \u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 134\u001b[0m \u001b[38;5;28mprint\u001b[39m(simulation_parameters[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcharges\u001b[39m\u001b[38;5;124m\"\u001b[39m])\n",
"\u001b[0;31mKeyError\u001b[0m: 'calculate_charge'" "\u001b[0;31mKeyError\u001b[0m: 'calculate_charge'"
] ]
} }
@ -297,16 +254,7 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"Hamiltonian and exchange field rotated. Elapsed time: 2435.900105791 s\n",
"================================================================================================================================================================\n"
]
}
],
"source": [ "source": [
"hh, ss, NO = build_hh_ss(dh)\n", "hh, ss, NO = build_hh_ss(dh)\n",
"\n", "\n",
@ -358,16 +306,7 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"Site and pair dictionaries created. Elapsed time: 2438.737295 s\n",
"================================================================================================================================================================\n"
]
}
],
"source": [ "source": [
"pairs, magnetic_entities = setup_pairs_and_magnetic_entities(\n", "pairs, magnetic_entities = setup_pairs_and_magnetic_entities(\n",
" magnetic_entities, pairs, dh, simulation_parameters\n", " magnetic_entities, pairs, dh, simulation_parameters\n",
@ -387,23 +326,7 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [],
{
"name": "stderr",
"output_type": "stream",
"text": [
"k loop: 0%| | 0/9 [00:00<?, ?it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"k set created. Elapsed time: 2441.389173 s\n",
"================================================================================================================================================================\n"
]
}
],
"source": [ "source": [
"kset = make_kset(\n", "kset = make_kset(\n",
" dirs=simulation_parameters[\"kdirs\"], NUMK=simulation_parameters[\"kset\"]\n", " dirs=simulation_parameters[\"kdirs\"], NUMK=simulation_parameters[\"kset\"]\n",
@ -426,16 +349,7 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"Rotations done perpendicular to quantization axis. Elapsed time: 2460.81759 s\n",
"================================================================================================================================================================\n"
]
}
],
"source": [ "source": [
"# this will contain the three hamiltonians in the reference directions needed to calculate the energy variations upon rotation\n", "# this will contain the three hamiltonians in the reference directions needed to calculate the energy variations upon rotation\n",
"hamiltonians = []\n", "hamiltonians = []\n",
@ -494,47 +408,7 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"Starting matrix inversions.\n",
"Total number of k points: 9\n",
"Number of energy samples per k point: 300\n",
"Total number of directions: 3\n",
"Total number of matrix inversions: 8100\n",
"The shape of the Hamiltonian and the Greens function is 84x84=7056\n",
"Memory taken by a single Hamiltonian is: 0.015625 KB\n",
"Expected memory usage per matrix inversion: 0.5 KB\n",
"Expected memory usage per k point for parallel inversion: 450.0 KB\n",
"Expected memory usage on root node: 3.955078125 MB\n",
"================================================================================================================================================================\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"k loop: 100%|██████████| 9/9 [00:31<00:00, 3.50s/it]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Calculated Greens functions. Elapsed time: 34.685783333 s\n",
"================================================================================================================================================================\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"\n"
]
}
],
"source": [ "source": [
"if rank == root_node:\n", "if rank == root_node:\n",
" print(\"Starting matrix inversions.\")\n", " print(\"Starting matrix inversions.\")\n",
@ -636,245 +510,7 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"Total charge: 39.98745949985201\n",
"Total charge: 39.987459508326964\n",
"Total charge: 40.098563331816784\n",
"Magnetic entities integrated.\n",
"Pairs integrated.\n",
"Magnetic parameters calculated.\n",
"##################################################################### GROGU OUTPUT #############################################################################\n",
"================================================================================================================================================================\n",
"Input file: \n",
"/Users/danielpozsar/Downloads/nojij/Fe3GeTe2/monolayer/soc/lat3_791/Fe3GeTe2.fdf\n",
"Output file: \n",
"./Fe3GeTe2_notebook.pickle\n",
"Number of nodes in the parallel cluster: 1\n",
"================================================================================================================================================================\n",
"Cell [Ang]: \n",
"[[ 3.79100000e+00 0.00000000e+00 0.00000000e+00]\n",
" [-1.89550000e+00 3.28310231e+00 0.00000000e+00]\n",
" [ 1.25954923e-15 2.18160327e-15 2.05700000e+01]]\n",
"================================================================================================================================================================\n",
"DFT axis: \n",
"[0 0 1]\n",
"Quantization axis and perpendicular rotation directions:\n",
"[1 0 0] --» [array([0, 1, 0]), array([0, 0, 1])]\n",
"[0 1 0] --» [array([1, 0, 0]), array([0, 0, 1])]\n",
"[0 0 1] --» [array([1, 0, 0]), array([0, 1, 0])]\n",
"================================================================================================================================================================\n",
"Parameters for the contour integral:\n",
"Number of k points: 3\n",
"k point directions: xy\n",
"Ebot: -13\n",
"Eset: 300\n",
"Esetp: 1000\n",
"================================================================================================================================================================\n",
"Atomic information: \n",
"----------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
"[atom index]Element(orbitals) x [Ang] y [Ang] z [Ang] Sx Sy Sz Q Lx Ly Lz Jx Jy Jz\n",
"----------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
"[3]Fe(2) -7.339158738013707e-06 4.149278510690423e-06 11.657585837928032\n",
"\n",
"[4]Fe(2) -7.326987662162937e-06 4.158274523275774e-06 8.912422537596708\n",
"\n",
"[5]Fe(2) 1.8954667088117545 1.0943913231921656 10.285002698393109\n",
"\n",
"================================================================================================================================================================\n",
"Anisotropy [meV]\n",
"----------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
"Magnetic entity x [Ang] y [Ang] z [Ang]\n",
"----------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
"[3]Fe(2) -7.339158738013707e-06 4.149278510690423e-06 11.657585837928032\n",
"Consistency check: 2.3860081328264116e-05\n",
"Anisotropy diag: [0.02546754 0.00208022 0. ]\n",
"\n",
"[4]Fe(2) -7.326987662162937e-06 4.158274523275774e-06 8.912422537596708\n",
"Consistency check: 7.768349833381372e-05\n",
"Anisotropy diag: [-0.06673164 0.01049614 0. ]\n",
"\n",
"[5]Fe(2) 1.8954667088117545 1.0943913231921656 10.285002698393109\n",
"Consistency check: 1.2052892692793193e-06\n",
"Anisotropy diag: [-0.01943729 -0.0206467 0. ]\n",
"\n",
"================================================================================================================================================================\n",
"Exchange [meV]\n",
"----------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
"Magnetic entity1 Magnetic entity2 [i j k] d [Ang]\n",
"----------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
"[3]Fe(2) [4]Fe(2) [0 0 0] d [Ang] 2.745163300331324\n",
"Isotropic: -39.96748066866786\n",
"DMI: [-4.16373454e-04 -8.52759845e-04 2.22666054e-07]\n",
"Symmetric-anisotropy: [ 7.85170293e-01 -2.01786552e-05 -2.73439476e-07 -2.01786552e-05\n",
" 7.85623794e-01 -9.79265975e-07 -2.73439476e-07 -9.79265975e-07\n",
" -1.57079409e+00]\n",
"J: [-3.91823104e+01 -2.01786552e-05 -2.73439476e-07 -2.01786552e-05\n",
" -3.91818569e+01 -9.79265975e-07 -2.73439476e-07 -9.79265975e-07\n",
" -4.15382748e+01]\n",
"Energies for debugging: \n",
"[[-4.15381735e-02 -4.15394188e-07 4.17352720e-07 -4.17291610e-02]\n",
" [-4.15383760e-02 8.53033284e-07 -8.52486405e-07 -4.17300740e-02]\n",
" [-3.66345528e-02 2.04013212e-08 1.99559891e-08 -3.66345467e-02]]\n",
"J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)\n",
"[-0.04173007 -0.03663455 -0.04153817]\n",
"Test J_xx = E(y,z) = E(z,y)\n",
"-0.04173007401441678 -0.036634546737597175\n",
"\n",
"[3]Fe(2) [5]Fe(2) [0 0 0] d [Ang] 2.5835033632437767\n",
"Isotropic: -54.8678926276239\n",
"DMI: [ 8.10240490e-01 -1.36608099e+00 3.25215454e-05]\n",
"Symmetric-anisotropy: [ 0.12903943 0.14426756 -0.06549931 0.14426756 -0.20896588 -0.05975815\n",
" -0.06549931 -0.05975815 0.07992645]\n",
"J: [-54.7388532 0.14426756 -0.06549931 0.14426756 -55.07685851\n",
" -0.05975815 -0.06549931 -0.05975815 -54.78796617]\n",
"Energies for debugging: \n",
"[[-0.05497624 0.00087 -0.00075048 -0.0552075 ]\n",
" [-0.0545997 0.00143158 -0.00130058 -0.05469815]\n",
" [-0.05494622 -0.00014424 -0.0001443 -0.05477956]]\n",
"J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)\n",
"[-0.05469815 -0.05494622 -0.05497624]\n",
"Test J_xx = E(y,z) = E(z,y)\n",
"-0.05469814671520505 -0.05477955968564471\n",
"\n",
"[4]Fe(2) [5]Fe(2) [0 0 0] d [Ang] 2.583501767937866\n",
"Isotropic: -54.86287528016134\n",
"DMI: [-8.08522805e-01 1.36388593e+00 3.14077512e-05]\n",
"Symmetric-anisotropy: [ 0.12501449 0.14426595 0.05678873 0.14426595 -0.20956489 0.04990479\n",
" 0.05678873 0.04990479 0.08455041]\n",
"J: [-5.47378608e+01 1.44265952e-01 5.67887254e-02 1.44265952e-01\n",
" -5.50724402e+01 4.99047869e-02 5.67887254e-02 4.99047869e-02\n",
" -5.47783249e+01]\n",
"Energies for debugging: \n",
"[[-0.05496666 -0.00085843 0.00075862 -0.05519787]\n",
" [-0.05458999 -0.00142067 0.0013071 -0.05469537]\n",
" [-0.05494701 -0.00014423 -0.0001443 -0.05478035]]\n",
"J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)\n",
"[-0.05469537 -0.05494701 -0.05496666]\n",
"Test J_xx = E(y,z) = E(z,y)\n",
"-0.054695368426152975 -0.05478035315936865\n",
"\n",
"[3]Fe(2) [5]Fe(2) [-1 -1 0] d [Ang] 2.5834973202859075\n",
"Isotropic: -54.86725213337313\n",
"DMI: [-1.55587908e+00 1.48356799e-05 -4.55339161e-05]\n",
"Symmetric-anisotropy: [-3.76175058e-01 -2.58204985e-05 -2.58761719e-05 -2.58204985e-05\n",
" 2.92919450e-01 4.97693839e-02 -2.58761719e-05 4.97693839e-02\n",
" 8.32556083e-02]\n",
"J: [-5.52434272e+01 -2.58204985e-05 -2.58761719e-05 -2.58204985e-05\n",
" -5.45743327e+01 4.97693839e-02 -2.58761719e-05 4.97693839e-02\n",
" -5.47839965e+01]\n",
"Energies for debugging: \n",
"[[-5.44093670e-02 -1.60564846e-03 1.50610969e-03 -5.44511949e-02]\n",
" [-5.51586260e-02 1.10404920e-08 4.07118518e-08 -5.54561691e-02]\n",
" [-5.46974705e-02 -1.97134176e-08 7.13544147e-08 -5.50306852e-02]]\n",
"J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)\n",
"[-0.05545617 -0.05469747 -0.05440937]\n",
"Test J_xx = E(y,z) = E(z,y)\n",
"-0.0554561691350627 -0.05503068524779923\n",
"\n",
"[4]Fe(2) [5]Fe(2) [-1 -1 0] d [Ang] 2.583495745338251\n",
"Isotropic: -54.87173513590157\n",
"DMI: [ 1.55588615e+00 -3.50135692e-04 -4.46128995e-05]\n",
"Symmetric-anisotropy: [-3.79737241e-01 -2.60848380e-05 -4.45024497e-05 -2.60848380e-05\n",
" 2.96608300e-01 -4.97778119e-02 -4.45024497e-05 -4.97778119e-02\n",
" 8.31289413e-02]\n",
"J: [-5.52514724e+01 -2.60848380e-05 -4.45024497e-05 -2.60848380e-05\n",
" -5.45751268e+01 -4.97778119e-02 -4.45024497e-05 -4.97778119e-02\n",
" -5.47886062e+01]\n",
"Energies for debugging: \n",
"[[-5.44101654e-02 1.60566396e-03 -1.50610834e-03 -5.44519935e-02]\n",
" [-5.51670469e-02 3.94638142e-07 -3.05633242e-07 -5.54714740e-02]\n",
" [-5.46982601e-02 -1.85280615e-08 7.06977375e-08 -5.50314708e-02]]\n",
"J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)\n",
"[-0.05547147 -0.05469826 -0.05441017]\n",
"Test J_xx = E(y,z) = E(z,y)\n",
"-0.05547147397315911 -0.05503147078078048\n",
"\n",
"[3]Fe(2) [5]Fe(2) [-1 0 0] d [Ang] 2.583541444641373\n",
"Isotropic: -54.8543539372674\n",
"DMI: [8.08531830e-01 1.36653494e+00 1.23153243e-05]\n",
"Symmetric-anisotropy: [ 0.12565256 -0.14422424 0.06554219 -0.14422424 -0.2071834 -0.04991746\n",
" 0.06554219 -0.04991746 0.08153084]\n",
"J: [-5.47287014e+01 -1.44224241e-01 6.55421872e-02 -1.44224241e-01\n",
" -5.50615373e+01 -4.99174557e-02 6.55421872e-02 -4.99174557e-02\n",
" -5.47728231e+01]\n",
"Energies for debugging: \n",
"[[-0.0549559 0.00085845 -0.00075861 -0.05518723]\n",
" [-0.05458975 -0.00143208 0.00130099 -0.05468811]\n",
" [-0.05493584 0.00014424 0.00014421 -0.05476929]]\n",
"J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)\n",
"[-0.05468811 -0.05493584 -0.0549559 ]\n",
"Test J_xx = E(y,z) = E(z,y)\n",
"-0.05468810820091341 -0.054769294557366933\n",
"\n",
"[4]Fe(2) [5]Fe(2) [-1 0 0] d [Ang] 2.5835398672184064\n",
"Isotropic: -54.85632586904892\n",
"DMI: [-8.10252027e-01 -1.36402738e+00 1.40111262e-05]\n",
"Symmetric-anisotropy: [ 0.12852618 -0.14422269 -0.05676095 -0.14422269 -0.21124941 0.05978565\n",
" -0.05676095 0.05978565 0.08272322]\n",
"J: [-54.72779968 -0.14422269 -0.05676095 -0.14422269 -55.06757527\n",
" 0.05978565 -0.05676095 0.05978565 -54.77360265]\n",
"Energies for debugging: \n",
"[[-0.05496711 -0.00087004 0.00075047 -0.0551985 ]\n",
" [-0.05458009 0.00142079 -0.00130727 -0.05468549]\n",
" [-0.05493665 0.00014424 0.00014421 -0.05477011]]\n",
"J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)\n",
"[-0.05468549 -0.05493665 -0.05496711]\n",
"Test J_xx = E(y,z) = E(z,y)\n",
"-0.05468549220244033 -0.05477010716669793\n",
"\n",
"[4]Fe(2) [5]Fe(2) [-2 0 0] d [Ang] 5.951322298958084\n",
"Isotropic: 0.7670124122315716\n",
"DMI: [-2.53243316e-01 2.68939617e-04 -1.43892049e-04]\n",
"Symmetric-anisotropy: [ 8.10949387e-02 -1.65488077e-05 -4.52585019e-05 -1.65488077e-05\n",
" -3.13833695e-01 -2.50031263e-01 -4.52585019e-05 -2.50031263e-01\n",
" 2.32738756e-01]\n",
"J: [ 8.48107351e-01 -1.65488077e-05 -4.52585019e-05 -1.65488077e-05\n",
" 4.53178717e-01 -2.50031263e-01 -4.52585019e-05 -2.50031263e-01\n",
" 9.99751168e-01]\n",
"Energies for debugging: \n",
"[[ 1.27357111e-03 -3.21205279e-06 5.03274580e-04 6.56773632e-04]\n",
" [ 7.25931228e-04 -2.23681115e-07 3.14198119e-07 7.58339032e-04]\n",
" [ 2.49583803e-04 -1.27343241e-07 1.60440856e-07 9.37875670e-04]]\n",
"J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)\n",
"[0.00075834 0.00024958 0.00127357]\n",
"Test J_xx = E(y,z) = E(z,y)\n",
"0.0007583390322003737 0.0009378756696001232\n",
"\n",
"[4]Fe(2) [5]Fe(2) [-3 0 0] d [Ang] 9.638732176310562\n",
"Isotropic: -54.86287528016134\n",
"DMI: [-8.08522805e-01 1.36388593e+00 3.14077512e-05]\n",
"Symmetric-anisotropy: [ 0.12501449 0.14426595 0.05678873 0.14426595 -0.20956489 0.04990479\n",
" 0.05678873 0.04990479 0.08455041]\n",
"J: [-5.47378608e+01 1.44265952e-01 5.67887254e-02 1.44265952e-01\n",
" -5.50724402e+01 4.99047869e-02 5.67887254e-02 4.99047869e-02\n",
" -5.47783249e+01]\n",
"Energies for debugging: \n",
"[[-0.05496666 -0.00085843 0.00075862 -0.05519787]\n",
" [-0.05458999 -0.00142067 0.0013071 -0.05469537]\n",
" [-0.05494701 -0.00014423 -0.0001443 -0.05478035]]\n",
"J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)\n",
"[-0.05469537 -0.05494701 -0.05496666]\n",
"Test J_xx = E(y,z) = E(z,y)\n",
"-0.05469536842615297 -0.05478035315936865\n",
"\n",
"================================================================================================================================================================\n",
"Runtime information: \n",
"Total runtime: 32.859570917000006 s\n",
"----------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
"Initial setup: 0.10918341700000012 s\n",
"Hamiltonian conversion and XC field extraction: 0.612 s\n",
"Pair and site datastructure creatrions: 0.030 s\n",
"k set cration and distribution: 0.030 s\n",
"Rotating XC potential: 0.278 s\n",
"Greens function inversion: 31.432 s\n",
"Calculate energies and magnetic components: 0.368 s\n"
]
}
],
"source": [ "source": [
"if rank == root_node:\n", "if rank == root_node:\n",
" # Calculate total charge\n", " # Calculate total charge\n",
@ -965,16 +601,7 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [],
{
"ename": "SyntaxError",
"evalue": "invalid syntax (3105939143.py, line 1)",
"output_type": "error",
"traceback": [
"\u001b[0;36m Cell \u001b[0;32mIn[9], line 1\u001b[0;36m\u001b[0m\n\u001b[0;31m ========================================\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n"
]
}
],
"source": [ "source": [
"========================================\n", "========================================\n",
" \n", " \n",

Loading…
Cancel
Save