ran test with anisotropy, consistency looks good, but there is no grogu data to compare with

class-solution
Daniel Pozsar 2 months ago
parent 0aaccc4c4b
commit 37ccf42d61

Binary file not shown.

@ -306,7 +306,7 @@ def blow_up_orbindx(orb_indices):
return np.array([[2 * o, 2 * o + 1] for o in orb_indices]).flatten() return np.array([[2 * o, 2 * o + 1] for o in orb_indices]).flatten()
def calculate_anisotropy_tensor(mag_ent, eps=1e-10): def calculate_anisotropy_tensor(mag_ent):
"""_summary_ """_summary_
Args: Args:
@ -323,7 +323,7 @@ def calculate_anisotropy_tensor(mag_ent, eps=1e-10):
calculated_diff = Kyy - Kxx calculated_diff = Kyy - Kxx
expected_diff = energies[2, 0] - energies[2, 1] expected_diff = energies[2, 0] - energies[2, 1]
consistency_check = abs(calculated_diff - expected_diff) < eps consistency_check = abs(calculated_diff - expected_diff)
return Kxx, Kyy, Kzz, consistency_check return Kxx, Kyy, Kzz, consistency_check
@ -466,7 +466,7 @@ def print_atoms_and_pairs(magnetic_entities, pairs):
for tag, xyz in zip(mag_ent["tags"], mag_ent["xyz"]): for tag, xyz in zip(mag_ent["tags"], mag_ent["xyz"]):
# coordinates and tag # coordinates and tag
print(f"{tag} {xyz[0]} {xyz[1]} {xyz[2]}") print(f"{tag} {xyz[0]} {xyz[1]} {xyz[2]}")
print("Consistency check passed: ", mag_ent["K_consistency"]) print("Consistency check: ", mag_ent["K_consistency"])
print("Anisotropy diag: ", mag_ent["K"]) print("Anisotropy diag: ", mag_ent["K"])
print("") print("")

@ -9,7 +9,7 @@
"name": "stderr", "name": "stderr",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"[Daniels-MacBook-Air.local:69249] shmem: mmap: an error occurred while determining whether or not /var/folders/yh/dx7xl94n3g52ts3td8qcxjcc0000gn/T//ompi.Daniels-MacBook-Air.501/jf.0/4095016960/sm_segment.Daniels-MacBook-Air.501.f4150000.0 could be created.\n" "[Mac:75276] shmem: mmap: an error occurred while determining whether or not /var/folders/yh/dx7xl94n3g52ts3td8qcxjcc0000gn/T//ompi.Mac.501/jf.0/1847132160/sm_segment.Mac.501.6e190000.0 could be created.\n"
] ]
}, },
{ {
@ -31,7 +31,7 @@
"import numpy as np\n", "import numpy as np\n",
"import sisl\n", "import sisl\n",
"import sisl.viz\n", "import sisl.viz\n",
"from src.grogu_magn.useful import *\n", "from src.grogu_magn.utils import *\n",
"from mpi4py import MPI\n", "from mpi4py import MPI\n",
"import pickle\n", "import pickle\n",
"from numpy.linalg import inv\n", "from numpy.linalg import inv\n",
@ -64,236 +64,8 @@
] ]
}, },
{ {
"cell_type": "code", "cell_type": "markdown",
"execution_count": 8,
"metadata": {}, "metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'parameters': {'path': '/Users/danielpozsar/Downloads/nojij/Fe3GeTe2/monolayer/soc/lat3_791/Fe3GeTe2.fdf',\n",
" 'outpath': './Fe3GeTe2_benchmark_on_15k_300eset.pickle',\n",
" 'scf_xcf_orientation': array([0, 0, 1]),\n",
" 'ref_xcf_orientations': [{'o': array([1, 0, 0]),\n",
" 'vw': [array([0, 1, 0]), array([0, 0, 1])]},\n",
" {'o': array([0, 1, 0]), 'vw': [array([1, 0, 0]), array([0, 0, 1])]},\n",
" {'o': array([0, 0, 1]), 'vw': [array([1, 0, 0]), array([0, 1, 0])]}],\n",
" 'kset': 15,\n",
" 'kdirs': 'xy',\n",
" 'ebot': -13,\n",
" 'eset': 300,\n",
" 'esetp': 1000,\n",
" 'parallel_size': 1,\n",
" 'cell': array([[ 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",
" 'magnetic_entities': [{'atom': 3,\n",
" 'l': 2,\n",
" 'orbital_indeces': array([41, 42, 43, 44, 45, 46, 47, 48, 49, 50], dtype=int32),\n",
" 'spin_box_indeces': array([ 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,\n",
" 95, 96, 97, 98, 99, 100, 101]),\n",
" 'tags': ['[3]Fe(2)'],\n",
" 'xyz': [array([-7.33915874e-06, 4.14927851e-06, 1.16575858e+01])],\n",
" 'energies': array([[3.7401678 , 3.74017175],\n",
" [3.74220127, 3.74213439],\n",
" [3.73476964, 3.73476766]])},\n",
" {'atom': 4,\n",
" 'l': 2,\n",
" 'orbital_indeces': array([56, 57, 58, 59, 60, 61, 62, 63, 64, 65], dtype=int32),\n",
" 'spin_box_indeces': array([112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,\n",
" 125, 126, 127, 128, 129, 130, 131]),\n",
" 'tags': ['[4]Fe(2)'],\n",
" 'xyz': [array([-7.32698766e-06, 4.15827452e-06, 8.91242254e+00])],\n",
" 'energies': array([[3.74019159, 3.74019195],\n",
" [3.74219584, 3.74215943],\n",
" [3.73479045, 3.7347924 ]])},\n",
" {'atom': 5,\n",
" 'l': 2,\n",
" 'orbital_indeces': array([71, 72, 73, 74, 75, 76, 77, 78, 79, 80], dtype=int32),\n",
" 'spin_box_indeces': array([142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,\n",
" 155, 156, 157, 158, 159, 160, 161]),\n",
" 'tags': ['[5]Fe(2)'],\n",
" 'xyz': [array([ 1.89546671, 1.09439132, 10.2850027 ])],\n",
" 'energies': array([[2.17502663, 2.17528404],\n",
" [2.17552502, 2.17546899],\n",
" [2.16824905, 2.16824905]])}],\n",
" 'pairs': [{'ai': 0,\n",
" 'aj': 1,\n",
" 'Ruc': array([0, 0, 0]),\n",
" 'dist': 2.745163300331324,\n",
" 'tags': ['[3]Fe(2)', '[4]Fe(2)'],\n",
" 'energies': array([[-3.52462334e-02, 5.22790048e-06, -5.22902762e-06,\n",
" -3.50238913e-02],\n",
" [-3.72242252e-02, 1.25410885e-08, -1.25222693e-08,\n",
" -3.69712117e-02],\n",
" [-4.75204846e-02, -4.03632805e-09, 1.21323601e-09,\n",
" -4.75204833e-02]]),\n",
" 'J_iso': -39.91775489990159,\n",
" 'J_S': array([-2.32809260e+00, 1.41154602e-06, -9.40957764e-09, 1.41154602e-06,\n",
" -1.35443302e+00, 5.63570534e-07, -9.40957764e-09, 5.63570534e-07,\n",
" 3.68252563e+00]),\n",
" 'D': array([ 5.22846405e-03, -1.25316789e-05, -2.62478203e-06]),\n",
" 'J': array([[-4.22458475e+01, 1.41154602e-06, -9.40957764e-09],\n",
" [ 1.41154602e-06, -4.12721879e+01, 5.63570534e-07],\n",
" [-9.40957764e-09, 5.63570534e-07, -3.62352293e+01]])},\n",
" {'ai': 0,\n",
" 'aj': 2,\n",
" 'Ruc': array([0, 0, 0]),\n",
" 'dist': 2.5835033632437767,\n",
" 'tags': ['[3]Fe(2)', '[5]Fe(2)'],\n",
" 'energies': array([[-6.59077017e-02, 3.37863278e-03, -3.30542979e-03,\n",
" -6.63454261e-02],\n",
" [-6.53414853e-02, 5.87819515e-03, -5.72736940e-03,\n",
" -6.56325743e-02],\n",
" [-6.10282408e-02, -5.29979330e-05, -5.41931672e-05,\n",
" -6.09661079e-02]]),\n",
" 'J_iso': -64.2035893374817,\n",
" 'J_S': array([ 0.90424825, 0.05359555, -0.07541288, 0.05359555, 0.5167559 ,\n",
" -0.0366015 , -0.07541288, -0.0366015 , -1.42100415]),\n",
" 'D': array([ 3.34203129e+00, -5.80278227e+00, 5.97617073e-04]),\n",
" 'J': array([[-6.32993411e+01, 5.35955501e-02, -7.54128755e-02],\n",
" [ 5.35955501e-02, -6.36868334e+01, -3.66014961e-02],\n",
" [-7.54128755e-02, -3.66014961e-02, -6.56245935e+01]])},\n",
" {'ai': 1,\n",
" 'aj': 2,\n",
" 'Ruc': array([0, 0, 0]),\n",
" 'dist': 2.583501767937866,\n",
" 'tags': ['[4]Fe(2)', '[5]Fe(2)'],\n",
" 'energies': array([[-6.58989484e-02, -3.39791181e-03, 3.33318257e-03,\n",
" -6.63392511e-02],\n",
" [-6.53345476e-02, -5.88748024e-03, 5.74610477e-03,\n",
" -6.56271418e-02],\n",
" [-6.10283154e-02, -5.29935811e-05, -5.41914581e-05,\n",
" -6.09661874e-02]]),\n",
" 'J_iso': -64.1990652847126,\n",
" 'J_S': array([ 0.9024007 , 0.05359252, 0.07068773, 0.05359252, 0.51528204,\n",
" 0.03236462, 0.07068773, 0.03236462, -1.41768273]),\n",
" 'D': array([-3.36554719e+00, 5.81679250e+00, 5.98938514e-04]),\n",
" 'J': array([[-6.32966646e+01, 5.35925196e-02, 7.06877343e-02],\n",
" [ 5.35925196e-02, -6.36837832e+01, 3.23646213e-02],\n",
" [ 7.06877343e-02, 3.23646213e-02, -6.56167480e+01]])},\n",
" {'ai': 0,\n",
" 'aj': 2,\n",
" 'Ruc': array([-1, -1, 0]),\n",
" 'dist': 2.5834973202859075,\n",
" 'tags': ['[3]Fe(2)', '[5]Fe(2)'],\n",
" 'energies': array([[-6.51429577e-02, -6.76632987e-03, 6.57042041e-03,\n",
" -6.54030227e-02],\n",
" [-6.67108762e-02, -4.56940315e-07, 2.56674082e-07,\n",
" -6.71912559e-02],\n",
" [-6.09363975e-02, -4.25058611e-07, 6.24865400e-07,\n",
" -6.10603021e-02]]),\n",
" 'J_iso': -64.40746869580421,\n",
" 'J_S': array([ 2.81689694e-01, -9.99033947e-05, 1.00133116e-04, -9.99033947e-05,\n",
" 1.23775856e+00, 9.79547273e-02, 1.00133116e-04, 9.79547273e-02,\n",
" -1.51944825e+00]),\n",
" 'D': array([-6.66837514e+00, 3.56807199e-04, -5.24962006e-04]),\n",
" 'J': array([[-6.41257790e+01, -9.99033947e-05, 1.00133116e-04],\n",
" [-9.99033947e-05, -6.31697101e+01, 9.79547273e-02],\n",
" [ 1.00133116e-04, 9.79547273e-02, -6.59269169e+01]])},\n",
" {'ai': 1,\n",
" 'aj': 2,\n",
" 'Ruc': array([-1, -1, 0]),\n",
" 'dist': 2.583495745338251,\n",
" 'tags': ['[4]Fe(2)', '[5]Fe(2)'],\n",
" 'energies': array([[-6.51430169e-02, 6.76649535e-03, -6.57056420e-03,\n",
" -6.54030961e-02],\n",
" [-6.67170573e-02, 6.60963771e-07, -8.06624581e-07,\n",
" -6.71939352e-02],\n",
" [-6.09365168e-02, -4.22426970e-07, 6.21599885e-07,\n",
" -6.10604139e-02]]),\n",
" 'J_iso': -64.40900602860754,\n",
" 'J_S': array([ 2.81831507e-01, -9.95864576e-05, 7.28304048e-05, -9.95864576e-05,\n",
" 1.23919957e+00, -9.79655745e-02, 7.28304048e-05, -9.79655745e-02,\n",
" -1.52103108e+00]),\n",
" 'D': array([ 6.66852978e+00, -7.33794176e-04, -5.22013428e-04]),\n",
" 'J': array([[-6.41271745e+01, -9.95864576e-05, 7.28304048e-05],\n",
" [-9.95864576e-05, -6.31698065e+01, -9.79655745e-02],\n",
" [ 7.28304048e-05, -9.79655745e-02, -6.59300371e+01]])},\n",
" {'ai': 0,\n",
" 'aj': 2,\n",
" 'Ruc': array([-1, 0, 0]),\n",
" 'dist': 2.583541444641373,\n",
" 'tags': ['[3]Fe(2)', '[5]Fe(2)'],\n",
" 'energies': array([[-6.58846583e-02, 3.39716065e-03, -3.33236087e-03,\n",
" -6.63246913e-02],\n",
" [-6.53283870e-02, -5.87805205e-03, 5.72733140e-03,\n",
" -6.56193992e-02],\n",
" [-6.10130098e-02, 5.33726660e-05, 5.35283836e-05,\n",
" -6.09512751e-02]]),\n",
" 'J_iso': -64.18690345424889,\n",
" 'J_S': array([ 0.9015663 , -0.05345052, 0.07536033, -0.05345052, 0.51805291,\n",
" -0.03239989, 0.07536033, -0.03239989, -1.41961921]),\n",
" 'D': array([ 3.36476076e+00, 5.80269172e+00, -7.78587899e-05]),\n",
" 'J': array([[-6.32853372e+01, -5.34505248e-02, 7.53603270e-02],\n",
" [-5.34505248e-02, -6.36688505e+01, -3.23998894e-02],\n",
" [ 7.53603270e-02, -3.23998894e-02, -6.56065227e+01]])},\n",
" {'ai': 1,\n",
" 'aj': 2,\n",
" 'Ruc': array([-1, 0, 0]),\n",
" 'dist': 2.5835398672184064,\n",
" 'tags': ['[4]Fe(2)', '[5]Fe(2)'],\n",
" 'energies': array([[-6.58936437e-02, -3.37805282e-03, 3.30480739e-03,\n",
" -6.63310120e-02],\n",
" [-6.53215421e-02, 5.88691588e-03, -5.74535321e-03,\n",
" -6.56142142e-02],\n",
" [-6.10131569e-02, 5.33672949e-05, 5.35282678e-05,\n",
" -6.09514260e-02]]),\n",
" 'J_iso': -64.18749916411404,\n",
" 'J_S': array([ 0.90467906, -0.05344778, -0.07078134, -0.05344778, 0.5154147 ,\n",
" 0.03662271, -0.07078134, 0.03662271, -1.42009377]),\n",
" 'D': array([-3.34143011e+00, -5.81613454e+00, -8.04864431e-05]),\n",
" 'J': array([[-6.32828201e+01, -5.34477814e-02, -7.07813383e-02],\n",
" [-5.34477814e-02, -6.36720845e+01, 3.66227144e-02],\n",
" [-7.07813383e-02, 3.66227144e-02, -6.56075929e+01]])},\n",
" {'ai': 1,\n",
" 'aj': 2,\n",
" 'Ruc': array([-2, 0, 0]),\n",
" 'dist': 5.951322298958084,\n",
" 'tags': ['[4]Fe(2)', '[5]Fe(2)'],\n",
" 'energies': array([[ 0.00472963, 0.00046075, -0.0003119 , 0.00466184],\n",
" [ 0.00364709, -0.00085554, 0.00093509, 0.0036577 ],\n",
" [ 0.00540057, -0.00061296, 0.00070181, 0.00550046]]),\n",
" 'J_iso': 4.59955059881751,\n",
" 'J_S': array([-0.02046716, -0.0444248 , -0.03977157, -0.0444248 , 0.43165605,\n",
" -0.07442493, -0.03977157, -0.07442493, -0.41118888]),\n",
" 'D': array([ 0.3863217 , 0.8953163 , -0.65738037]),\n",
" 'J': array([[ 4.57908344, -0.0444248 , -0.03977157],\n",
" [-0.0444248 , 5.03120664, -0.07442493],\n",
" [-0.03977157, -0.07442493, 4.18836172]])},\n",
" {'ai': 1,\n",
" 'aj': 2,\n",
" 'Ruc': array([-3, 0, 0]),\n",
" 'dist': 9.638732176310562,\n",
" 'tags': ['[4]Fe(2)', '[5]Fe(2)'],\n",
" 'energies': array([[ 9.75938878e-06, 1.25731290e-04, -5.67323532e-05,\n",
" -1.49392424e-04],\n",
" [-1.47825232e-04, -3.25058913e-04, 3.35824948e-04,\n",
" -2.23552488e-04],\n",
" [-4.63060805e-04, -3.68335462e-04, 3.64462081e-04,\n",
" -4.12155989e-04]]),\n",
" 'J_iso': -0.23103792475126567,\n",
" 'J_S': array([-0.08681631, 0.00193669, -0.00538302, 0.00193669, -0.07518869,\n",
" -0.03449947, -0.00538302, -0.03449947, 0.162005 ]),\n",
" 'D': array([ 0.09123182, 0.33044193, -0.36639877]),\n",
" 'J': array([[-0.31785424, 0.00193669, -0.00538302],\n",
" [ 0.00193669, -0.30622661, -0.03449947],\n",
" [-0.00538302, -0.03449947, -0.06903292]])}],\n",
" 'runtime': {'start_time': 0.988331583,\n",
" 'setup_time': 1.0880625,\n",
" 'H_and_XCF_time': 1.55488075,\n",
" 'site_and_pair_dictionaries_time': 1.603311625,\n",
" 'k_set_time': 1.618691125,\n",
" 'reference_rotations_time': 1.848489583,\n",
" 'green_function_inversion_time': 295.988709083,\n",
" 'end_time': 296.320685333}}"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [ "source": [
"file = open(\"Fe3GeTe2_benchmark_on_15k_300eset.pickle\", \"rb\")\n", "file = open(\"Fe3GeTe2_benchmark_on_15k_300eset.pickle\", \"rb\")\n",
"object_file = pickle.load(file)\n", "object_file = pickle.load(file)\n",
@ -325,17 +97,37 @@
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
"ename": "TypeError", "name": "stdout",
"evalue": "function takes exactly 5 arguments (1 given)", "output_type": "stream",
"output_type": "error", "text": [
"traceback": [ "================================================================================================================================================================\n",
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "Input file: \n",
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", "/Users/danielpozsar/Downloads/nojij/Fe3GeTe2/monolayer/soc/lat3_791/Fe3GeTe2.fdf\n",
"Cell \u001b[0;32mIn[2], line 73\u001b[0m\n\u001b[1;32m 71\u001b[0m fdf \u001b[38;5;241m=\u001b[39m sisl\u001b[38;5;241m.\u001b[39mget_sile(path)\n\u001b[1;32m 72\u001b[0m \u001b[38;5;66;03m# read in hamiltonian\u001b[39;00m\n\u001b[0;32m---> 73\u001b[0m dh \u001b[38;5;241m=\u001b[39m \u001b[43mfdf\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mread_hamiltonian\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 74\u001b[0m simulation_parameters[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcell\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m fdf\u001b[38;5;241m.\u001b[39mread_geometry()\u001b[38;5;241m.\u001b[39mcell\n\u001b[1;32m 76\u001b[0m \u001b[38;5;66;03m# unit cell index\u001b[39;00m\n", "Output file: \n",
"File \u001b[0;32m~/Documents/oktatás/elte/phd/grogu_project/.venv/lib/python3.9/site-packages/sisl/io/siesta/fdf.py:2239\u001b[0m, in \u001b[0;36mfdfSileSiesta.read_hamiltonian\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 2235\u001b[0m order \u001b[38;5;241m=\u001b[39m _parse_output_order(\n\u001b[1;32m 2236\u001b[0m kwargs\u001b[38;5;241m.\u001b[39mpop(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124morder\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m), \u001b[38;5;28;01mTrue\u001b[39;00m, [\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mnc\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mTSHS\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mHSX\u001b[39m\u001b[38;5;124m\"\u001b[39m], []\n\u001b[1;32m 2237\u001b[0m )\n\u001b[1;32m 2238\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m f \u001b[38;5;129;01min\u001b[39;00m order:\n\u001b[0;32m-> 2239\u001b[0m H \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mgetattr\u001b[39;49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43mf\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43m_r_hamiltonian_\u001b[39;49m\u001b[38;5;132;43;01m{\u001b[39;49;00m\u001b[43mf\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mlower\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;132;43;01m}\u001b[39;49;00m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 2240\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m H \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 2241\u001b[0m _track(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mread_hamiltonian, \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfound file \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mf\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m)\n", "./Fe3GeTe2_notebook.pickle\n",
"File \u001b[0;32m~/Documents/oktatás/elte/phd/grogu_project/.venv/lib/python3.9/site-packages/sisl/io/siesta/fdf.py:2271\u001b[0m, in \u001b[0;36mfdfSileSiesta._r_hamiltonian_hsx\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 2269\u001b[0m H \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 2270\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m f\u001b[38;5;241m.\u001b[39mis_file():\n\u001b[0;32m-> 2271\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[43mhsxSileSiesta\u001b[49m\u001b[43m(\u001b[49m\u001b[43mf\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mversion\u001b[49m \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m0\u001b[39m:\n\u001b[1;32m 2272\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mgeometry\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m kwargs:\n\u001b[1;32m 2273\u001b[0m \u001b[38;5;66;03m# to ensure we get the correct orbital count\u001b[39;00m\n\u001b[1;32m 2274\u001b[0m kwargs[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mgeometry\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mread_geometry(\u001b[38;5;28;01mTrue\u001b[39;00m)\n", "Number of nodes in the parallel cluster: 1\n",
"File \u001b[0;32m~/Documents/oktatás/elte/phd/grogu_project/.venv/lib/python3.9/site-packages/sisl/io/siesta/binaries.py:737\u001b[0m, in \u001b[0;36mhsxSileSiesta.version\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 734\u001b[0m \u001b[38;5;129m@property\u001b[39m\n\u001b[1;32m 735\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mversion\u001b[39m(\u001b[38;5;28mself\u001b[39m) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m \u001b[38;5;28mint\u001b[39m:\n\u001b[1;32m 736\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124;03m\"\"\"The version of the file\"\"\"\u001b[39;00m\n\u001b[0;32m--> 737\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43m_siesta\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mread_hsx_version\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfile\u001b[49m\u001b[43m)\u001b[49m\n", "================================================================================================================================================================\n",
"\u001b[0;31mTypeError\u001b[0m: function takes exactly 5 arguments (1 given)" "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: 10\n",
"k point directions: xy\n",
"Ebot: -13\n",
"Eset: 300\n",
"Esetp: 1000\n",
"================================================================================================================================================================\n",
"Setup done. Elapsed time: 4.909605666 s\n",
"================================================================================================================================================================\n"
] ]
} }
], ],
@ -343,7 +135,9 @@
"################################################################################\n", "################################################################################\n",
"#################################### INPUT #####################################\n", "#################################### INPUT #####################################\n",
"################################################################################\n", "################################################################################\n",
"path = \"/Users/danielpozsar/Documents/oktatás/elte/phd/grogu_project/data/lat3_791/Fe3GeTe2.fdf\"\n", "path = (\n",
" \"/Users/danielpozsar/Downloads/nojij/Fe3GeTe2/monolayer/soc/lat3_791/Fe3GeTe2.fdf\"\n",
")\n",
"outfile = \"./Fe3GeTe2_notebook\"\n", "outfile = \"./Fe3GeTe2_notebook\"\n",
"\n", "\n",
"# this information needs to be given at the input!!\n", "# this information needs to be given at the input!!\n",
@ -374,7 +168,7 @@
" dict(ai=1, aj=2, Ruc=np.array([-3, 0, 0])),\n", " dict(ai=1, aj=2, Ruc=np.array([-3, 0, 0])),\n",
"]\n", "]\n",
"# Brilloun zone sampling and Green function contour integral\n", "# Brilloun zone sampling and Green function contour integral\n",
"kset = 15\n", "kset = 10\n",
"kdirs = \"xy\"\n", "kdirs = \"xy\"\n",
"ebot = -13\n", "ebot = -13\n",
"eset = 300\n", "eset = 300\n",
@ -490,7 +284,7 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Hamiltonian and exchange field rotated. Elapsed time: 11.290487791 s\n", "Hamiltonian and exchange field rotated. Elapsed time: 5.473272791 s\n",
"================================================================================================================================================================\n" "================================================================================================================================================================\n"
] ]
} }
@ -581,7 +375,7 @@
"\n", "\n",
"\n", "\n",
"# Check if exchange field has scalar part\n", "# Check if exchange field has scalar part\n",
"max_xcfs = abs(np.array(np.array([f[\"c\"] for f in traced]))).max()\n", "max_xcfs = abs(np.array(np.array([f[\"c\"] / 2 for f in traced]))).max()\n",
"if max_xcfs > 1e-12:\n", "if max_xcfs > 1e-12:\n",
" warnings.warn(\n", " warnings.warn(\n",
" f\"Exchange field has non negligible scalar part. Largest value is {max_xcfs}\"\n", " f\"Exchange field has non negligible scalar part. Largest value is {max_xcfs}\"\n",
@ -650,7 +444,7 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Site and pair dictionaries created. Elapsed time: 11.50304025 s\n", "Site and pair dictionaries created. Elapsed time: 5.680114458 s\n",
"================================================================================================================================================================\n" "================================================================================================================================================================\n"
] ]
} }
@ -774,14 +568,14 @@
"name": "stderr", "name": "stderr",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"k loop: 0%| | 0/225 [00:00<?, ?it/s]" "k loop: 0%| | 0/100 [00:00<?, ?it/s]"
] ]
}, },
{ {
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"k set created. Elapsed time: 11.526158208 s\n", "k set created. Elapsed time: 5.716477833 s\n",
"================================================================================================================================================================\n" "================================================================================================================================================================\n"
] ]
} }
@ -809,7 +603,7 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Rotations done perpendicular to quantization axis. Elapsed time: 11.790519875 s\n", "Rotations done perpendicular to quantization axis. Elapsed time: 6.074103166 s\n",
"================================================================================================================================================================\n" "================================================================================================================================================================\n"
] ]
} }
@ -865,7 +659,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 11, "execution_count": 8,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -873,15 +667,15 @@
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Starting matrix inversions\n", "Starting matrix inversions\n",
"Total number of k points: 225\n", "Total number of k points: 100\n",
"Number of energy samples per k point: 300\n", "Number of energy samples per k point: 300\n",
"Total number of directions: 3\n", "Total number of directions: 3\n",
"Total number of matrix inversions: 202500\n", "Total number of matrix inversions: 90000\n",
"The shape of the Hamiltonian and the Greens function is 84x84=7056\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", "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 matrix inversion: 0.5 KB\n",
"Expected memory usage per k point for parallel inversion: 450.0 KB\n", "Expected memory usage per k point for parallel inversion: 450.0 KB\n",
"Expected memory usage on root node: 98.876953125 MB\n", "Expected memory usage on root node: 43.9453125 MB\n",
"================================================================================================================================================================\n" "================================================================================================================================================================\n"
] ]
}, },
@ -889,16 +683,23 @@
"name": "stderr", "name": "stderr",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"k loop: 100%|██████████| 225/225 [09:42<00:00, 2.59s/it]\n" "k loop: 100%|██████████| 100/100 [03:17<00:00, 1.97s/it]"
] ]
}, },
{ {
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Calculated Greens functions. Elapsed time: 593.774521541 s\n", "Calculated Greens functions. Elapsed time: 203.218047166 s\n",
"================================================================================================================================================================\n" "================================================================================================================================================================\n"
] ]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"\n"
]
} }
], ],
"source": [ "source": [
@ -998,16 +799,16 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 12, "execution_count": 9,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Total charge: 39.907801636668175\n", "Total charge: 39.857798089095745\n",
"Total charge: 39.90780156034552\n", "Total charge: 39.85779799083869\n",
"Total charge: 39.992244200462636\n", "Total charge: 39.95778482001014\n",
"Magnetic entities integrated.\n", "Magnetic entities integrated.\n",
"Pairs integrated.\n", "Pairs integrated.\n",
"Magnetic parameters calculated.\n", "Magnetic parameters calculated.\n",
@ -1032,7 +833,7 @@
"[0 0 1] --» [array([1, 0, 0]), array([0, 1, 0])]\n", "[0 0 1] --» [array([1, 0, 0]), array([0, 1, 0])]\n",
"================================================================================================================================================================\n", "================================================================================================================================================================\n",
"Parameters for the contour integral:\n", "Parameters for the contour integral:\n",
"Number of k points: 15\n", "Number of k points: 10\n",
"k point directions: xy\n", "k point directions: xy\n",
"Ebot: -13\n", "Ebot: -13\n",
"Eset: 300\n", "Eset: 300\n",
@ -1049,190 +850,207 @@
"[5]Fe(2) 1.8954667088117545 1.0943913231921656 10.285002698393109\n", "[5]Fe(2) 1.8954667088117545 1.0943913231921656 10.285002698393109\n",
"\n", "\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: 6.818420305920725e-05\n",
"Anisotropy diag: [-0.07482326 -0.00552873 0. ]\n",
"\n",
"[4]Fe(2) -7.326987662162937e-06 4.158274523275774e-06 8.912422537596708\n",
"Consistency check: 7.686025895869975e-05\n",
"Anisotropy diag: [ 0.0004411 -0.07750451 0. ]\n",
"\n",
"[5]Fe(2) 1.8954667088117545 1.0943913231921656 10.285002698393109\n",
"Consistency check: 5.268649241663148e-05\n",
"Anisotropy diag: [ 0.01120506 -0.0414785 0. ]\n",
"\n",
"================================================================================================================================================================\n",
"Exchange [meV]\n", "Exchange [meV]\n",
"----------------------------------------------------------------------------------------------------------------------------------------------------------------\n", "----------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
"Magnetic entity1 Magnetic entity2 [i j k] d [Ang]\n", "Magnetic entity1 Magnetic entity2 [i j k] d [Ang]\n",
"----------------------------------------------------------------------------------------------------------------------------------------------------------------\n", "----------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
"[3]Fe(2) [4]Fe(2) [0 0 0] d [Ang] 2.745163300331324\n", "[3]Fe(2) [4]Fe(2) [0 0 0] d [Ang] 2.745163300331324\n",
"Isotropic: -87.36625034925267\n", "Isotropic: -84.46399731420344\n",
"DMI: [ 3.21770364e-02 -1.00594555e-03 -3.51968374e-07]\n", "DMI: [ 1.88620081e-01 -7.64018484e-04 -4.37922496e-07]\n",
"Symmetric-anisotropy: [ 2.12625625e+00 7.29980046e-05 -4.82064787e-05 7.29980046e-05\n", "Symmetric-anisotropy: [ 2.38296852e+00 1.42209663e-04 -6.68866203e-05 1.42209663e-04\n",
" 2.14479369e+00 -9.50239206e-06 -4.82064787e-05 -9.50239206e-06\n", " 2.40029619e+00 -8.14152579e-06 -6.68866203e-05 -8.14152579e-06\n",
" -4.27104994e+00]\n", " -4.78326471e+00]\n",
"J: [-8.52399941e+01 7.29980046e-05 -4.82064787e-05 7.29980046e-05\n", "J: [-8.20810288e+01 1.42209663e-04 -6.68866203e-05 1.42209663e-04\n",
" -8.52214567e+01 -9.50239206e-06 -4.82064787e-05 -9.50239206e-06\n", " -8.20637011e+01 -8.14152579e-06 -6.68866203e-05 -8.14152579e-06\n",
" -9.16373003e+01]\n", " -8.92472620e+01]\n",
"Energies for debugging: \n", "Energies for debugging: \n",
"array([[-9.16002498e-02, 3.21865388e-05, -3.21675340e-05,\n", "array([[-8.92399658e-02, 1.88628223e-04, -1.88611940e-04,\n",
" -9.17228673e-02],\n", " -8.91429459e-02],\n",
" [-9.16743508e-02, 1.05415203e-06, -9.57739074e-07,\n", " [-8.92545582e-02, 8.30905104e-07, -6.97131863e-07,\n",
" -9.17598493e-02],\n", " -8.91774451e-02],\n",
" [-7.87200461e-02, -7.33499730e-08, -7.26460363e-08,\n", " [-7.49844563e-02, -1.42647586e-07, -1.41771741e-07,\n",
" -7.87201389e-02]])\n", " -7.49846125e-02]])\n",
"J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)\n", "J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)\n",
"array([-0.09175985, -0.07872005, -0.09160025])\n", "array([-0.08917745, -0.07498446, -0.08923997])\n",
"Test J_xx = E(y,z) = E(z,y)\n", "Test J_xx = E(y,z) = E(z,y)\n",
"-0.09175984926880505 -0.07872013892300818\n", "-0.08917744514035186 -0.07498461245605947\n",
"\n", "\n",
"[3]Fe(2) [5]Fe(2) [0 0 0] d [Ang] 2.5835033632437767\n", "[3]Fe(2) [5]Fe(2) [0 0 0] d [Ang] 2.5835033632437767\n",
"Isotropic: -41.52730925965426\n", "Isotropic: -41.629965239513076\n",
"DMI: [ 1.17785417e+00 -2.06225136e+00 -4.69189233e-05]\n", "DMI: [ 1.16104440e+00 -2.02989607e+00 1.42007213e-04]\n",
"Symmetric-anisotropy: [ 0.02746399 0.15418338 -0.07648137 0.15418338 -0.1972997 -0.04062499\n", "Symmetric-anisotropy: [-0.3583508 0.2300684 -0.0464857 0.2300684 -0.60812243 -0.03183621\n",
" -0.07648137 -0.04062499 0.16983571]\n", " -0.0464857 -0.03183621 0.96647323]\n",
"J: [-4.14998453e+01 1.54183382e-01 -7.64813730e-02 1.54183382e-01\n", "J: [-4.19883160e+01 2.30068404e-01 -4.64857039e-02 2.30068404e-01\n",
" -4.17246090e+01 -4.06249865e-02 -7.64813730e-02 -4.06249865e-02\n", " -4.22380877e+01 -3.18362116e-02 -4.64857039e-02 -3.18362116e-02\n",
" -4.13574736e+01]\n", " -4.06634920e+01]\n",
"Energies for debugging: \n", "Energies for debugging: \n",
"array([[-0.04145412, 0.00121848, -0.00113723, -0.04156529],\n", "array([[-0.04075812, 0.00119288, -0.00112921, -0.04080062],\n",
" [-0.04126082, 0.00213873, -0.00198577, -0.04129418],\n", " [-0.04056886, 0.00207638, -0.00198341, -0.04056711],\n",
" [-0.04188393, -0.00015423, -0.00015414, -0.04170551]])\n", " [-0.04367555, -0.00022993, -0.00023021, -0.04340952]])\n",
"J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)\n", "J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)\n",
"array([-0.04129418, -0.04188393, -0.04145412])\n", "array([-0.04056711, -0.04367555, -0.04075812])\n",
"Test J_xx = E(y,z) = E(z,y)\n", "Test J_xx = E(y,z) = E(z,y)\n",
"-0.04129418024412361 -0.041705510285739864\n", "-0.04056710918296237 -0.04340952290351278\n",
"\n", "\n",
"[4]Fe(2) [5]Fe(2) [0 0 0] d [Ang] 2.583501767937866\n", "[4]Fe(2) [5]Fe(2) [0 0 0] d [Ang] 2.583501767937866\n",
"Isotropic: -41.532465661632486\n", "Isotropic: -41.63818539049319\n",
"DMI: [-1.16839004e+00 2.04641313e+00 -4.67852015e-05]\n", "DMI: [-1.15569804e+00 2.01131866e+00 1.42813172e-04]\n",
"Symmetric-anisotropy: [ 0.02908454 0.15418348 0.06718218 0.15418348 -0.19939635 0.03271419\n", "Symmetric-anisotropy: [-0.35474671 0.23007014 0.03254717 0.23007014 -0.61181222 0.01758968\n",
" 0.06718218 0.03271419 0.17031181]\n", " 0.03254717 0.01758968 0.96655893]\n",
"J: [-4.15033811e+01 1.54183477e-01 6.71821756e-02 1.54183477e-01\n", "J: [-4.19929321e+01 2.30070141e-01 3.25471741e-02 2.30070141e-01\n",
" -4.17318620e+01 3.27141946e-02 6.71821756e-02 3.27141946e-02\n", " -4.22499976e+01 1.75896770e-02 3.25471741e-02 1.75896770e-02\n",
" -4.13621538e+01]\n", " -4.06716265e+01]\n",
"Energies for debugging: \n", "Energies for debugging: \n",
"array([[-0.0414585 , -0.0012011 , 0.00113568, -0.04157913],\n", "array([[-0.04076979, -0.00117329, 0.00113811, -0.04082375],\n",
" [-0.0412658 , -0.0021136 , 0.00197923, -0.04130058],\n", " [-0.04057347, -0.00204387, 0.00197877, -0.04057565],\n",
" [-0.0418846 , -0.00015423, -0.00015414, -0.04170618]])\n", " [-0.04367625, -0.00022993, -0.00023021, -0.04341022]])\n",
"J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)\n", "J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)\n",
"array([-0.04130058, -0.0418846 , -0.0414585 ])\n", "array([-0.04057565, -0.04367625, -0.04076979])\n",
"Test J_xx = E(y,z) = E(z,y)\n", "Test J_xx = E(y,z) = E(z,y)\n",
"-0.04130058163838069 -0.04170618060677052\n", "-0.04057564848089523 -0.043410215712362775\n",
"\n", "\n",
"[3]Fe(2) [5]Fe(2) [-1 -1 0] d [Ang] 2.5834973202859075\n", "[3]Fe(2) [5]Fe(2) [-1 -1 0] d [Ang] 2.5834973202859075\n",
"Isotropic: -41.516776604415945\n", "Isotropic: -41.66159765171782\n",
"DMI: [-2.41730078e+00 8.52711009e-05 3.85154429e-05]\n", "DMI: [-2.33447929e+00 5.88920633e-05 -4.25773045e-05]\n",
"Symmetric-anisotropy: [-3.24863466e-01 -1.57805287e-04 1.53264979e-04 -1.57805287e-04\n", "Symmetric-anisotropy: [-7.33142752e-01 -1.52756996e-04 1.46307682e-04 -1.52756996e-04\n",
" 1.46547000e-01 7.51504636e-02 1.53264979e-04 7.51504636e-02\n", " -2.16761810e-01 4.07813099e-02 1.46307682e-04 4.07813099e-02\n",
" 1.78316466e-01]\n", " 9.49904562e-01]\n",
"J: [-4.18416401e+01 -1.57805287e-04 1.53264979e-04 -1.57805287e-04\n", "J: [-4.23947404e+01 -1.52756996e-04 1.46307682e-04 -1.52756996e-04\n",
" -4.13702296e+01 7.51504636e-02 1.53264979e-04 7.51504636e-02\n", " -4.18783595e+01 4.07813099e-02 1.46307682e-04 4.07813099e-02\n",
" -4.13384601e+01]\n", " -4.07116931e+01]\n",
"Energies for debugging: \n", "Energies for debugging: \n",
"array([[-4.11335642e-02, -2.49245124e-03, 2.34215032e-03,\n", "array([[-4.05161871e-02, -2.37526060e-03, 2.29369798e-03,\n",
" -4.11229167e-02],\n", " -4.04786366e-02],\n",
" [-4.15433560e-02, -2.38536080e-07, -6.79938781e-08,\n", " [-4.09071991e-02, -2.05199745e-07, -8.74156186e-08,\n",
" -4.17094547e-02],\n", " -4.09798629e-02],\n",
" [-4.16175425e-02, 1.96320730e-07, 1.19289844e-07,\n", " [-4.32780824e-02, 1.10179692e-07, 1.95334301e-07,\n",
" -4.19738255e-02]])\n", " -4.38096179e-02]])\n",
"J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)\n", "J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)\n",
"array([-0.04170945, -0.04161754, -0.04113356])\n", "array([-0.04097986, -0.04327808, -0.04051619])\n",
"Test J_xx = E(y,z) = E(z,y)\n", "Test J_xx = E(y,z) = E(z,y)\n",
"-0.04170945467884016 -0.041973825462496055\n", "-0.040979862867913205 -0.043809617939982115\n",
"\n", "\n",
"[4]Fe(2) [5]Fe(2) [-1 -1 0] d [Ang] 2.583495745338251\n", "[4]Fe(2) [5]Fe(2) [-1 -1 0] d [Ang] 2.583495745338251\n",
"Isotropic: -41.514139744541524\n", "Isotropic: -41.651354364546386\n",
"DMI: [ 2.41735105e+00 -1.91201970e-04 3.71831534e-05]\n", "DMI: [ 2.33450755e+00 -3.01207900e-04 -4.35448493e-05]\n",
"Symmetric-anisotropy: [-3.21261199e-01 -1.57863970e-04 1.40654575e-04 -1.57863970e-04\n", "Symmetric-anisotropy: [-7.24739149e-01 -1.52908277e-04 1.43933638e-04 -1.52908277e-04\n",
" 1.43245335e-01 -7.51485430e-02 1.40654575e-04 -7.51485430e-02\n", " -2.27695138e-01 -4.07805826e-02 1.43933638e-04 -4.07805826e-02\n",
" 1.78015864e-01]\n", " 9.52434287e-01]\n",
"J: [-4.18354009e+01 -1.57863970e-04 1.40654575e-04 -1.57863970e-04\n", "J: [-4.23760935e+01 -1.52908277e-04 1.43933638e-04 -1.52908277e-04\n",
" -4.13708944e+01 -7.51485430e-02 1.40654575e-04 -7.51485430e-02\n", " -4.18790495e+01 -4.07805826e-02 1.43933638e-04 -4.07805826e-02\n",
" -4.13361239e+01]\n", " -4.06989201e+01]\n",
"Energies for debugging: \n", "Energies for debugging: \n",
"array([[-4.11342275e-02, 2.49249959e-03, -2.34220250e-03,\n", "array([[-4.05168794e-02, 2.37528813e-03, -2.29372696e-03,\n",
" -4.11235752e-02],\n", " -4.04793245e-02],\n",
" [-4.15380203e-02, 5.05473958e-08, -3.31856545e-07,\n", " [-4.08809608e-02, 1.57274262e-07, -4.45141537e-07,\n",
" -4.16963053e-02],\n", " -4.09418727e-02],\n",
" [-4.16182136e-02, 1.95047123e-07, 1.20680816e-07,\n", " [-4.32787745e-02, 1.09363428e-07, 1.96453126e-07,\n",
" -4.19744966e-02]])\n", " -4.38103143e-02]])\n",
"J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)\n", "J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)\n",
"array([-0.04169631, -0.04161821, -0.04113423])\n", "array([-0.04094187, -0.04327877, -0.04051688])\n",
"Test J_xx = E(y,z) = E(z,y)\n", "Test J_xx = E(y,z) = E(z,y)\n",
"-0.04169630526113004 -0.04197449662603875\n", "-0.04094187270410039 -0.04381031432397496\n",
"\n", "\n",
"[3]Fe(2) [5]Fe(2) [-1 0 0] d [Ang] 2.583541444641373\n", "[3]Fe(2) [5]Fe(2) [-1 0 0] d [Ang] 2.583541444641373\n",
"Isotropic: -41.518970343111015\n", "Isotropic: -41.622961610451405\n",
"DMI: [1.16817703e+00 2.06220317e+00 7.21860779e-06]\n", "DMI: [ 1.15553716e+00 2.03004764e+00 -1.00662008e-04]\n",
"Symmetric-anisotropy: [ 0.03010538 -0.15396904 0.07631411 -0.15396904 -0.20084252 -0.03269774\n", "Symmetric-anisotropy: [-0.35259845 -0.22988479 0.04629996 -0.22988479 -0.61302608 -0.01757494\n",
" 0.07631411 -0.03269774 0.17073714]\n", " 0.04629996 -0.01757494 0.96562453]\n",
"J: [-4.14888650e+01 -1.53969044e-01 7.63141143e-02 -1.53969044e-01\n", "J: [-4.19755601e+01 -2.29884795e-01 4.62999578e-02 -2.29884795e-01\n",
" -4.17198129e+01 -3.26977448e-02 7.63141143e-02 -3.26977448e-02\n", " -4.22359877e+01 -1.75749425e-02 4.62999578e-02 -1.75749425e-02\n",
" -4.13482332e+01]\n", " -4.06573371e+01]\n",
"Energies for debugging: \n", "Energies for debugging: \n",
"array([[-0.04144688, 0.00120087, -0.00113548, -0.04156696],\n", "array([[-0.04075738, 0.00117311, -0.00113796, -0.04081079],\n",
" [-0.04124959, -0.00213852, 0.00198589, -0.04128287],\n", " [-0.04055729, -0.00207635, 0.00198375, -0.0405554 ],\n",
" [-0.04187266, 0.00015398, 0.00015396, -0.04169486]])\n", " [-0.04366118, 0.00022978, 0.00022999, -0.04339572]])\n",
"J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)\n", "J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)\n",
"array([-0.04128287, -0.04187266, -0.04144688])\n", "array([-0.0405554 , -0.04366118, -0.04075738])\n",
"Test J_xx = E(y,z) = E(z,y)\n", "Test J_xx = E(y,z) = E(z,y)\n",
"-0.04128287386394945 -0.041694856070965985\n", "-0.040555403759627504 -0.043395716365454126\n",
"\n", "\n",
"[4]Fe(2) [5]Fe(2) [-1 0 0] d [Ang] 2.5835398672184064\n", "[4]Fe(2) [5]Fe(2) [-1 0 0] d [Ang] 2.5835398672184064\n",
"Isotropic: -41.51853887711384\n", "Isotropic: -41.62008807379083\n",
"DMI: [-1.17770380e+00 -2.04619919e+00 9.44971395e-06]\n", "DMI: [-1.16093102e+00 -2.01118580e+00 -9.97040031e-05]\n",
"Symmetric-anisotropy: [ 0.02607311 -0.15396929 -0.0672924 -0.15396929 -0.19537854 0.0406109\n", "Symmetric-anisotropy: [-0.36016123 -0.22988672 -0.03265224 -0.22988672 -0.60539869 0.03182552\n",
" -0.0672924 0.0406109 0.16930543]\n", " -0.03265224 0.03182552 0.96555993]\n",
"J: [-4.14924658e+01 -1.53969287e-01 -6.72923993e-02 -1.53969287e-01\n", "J: [-4.19802493e+01 -2.29886721e-01 -3.26522393e-02 -2.29886721e-01\n",
" -4.17139174e+01 4.06108984e-02 -6.72923993e-02 4.06108984e-02\n", " -4.22254868e+01 3.18255164e-02 -3.26522393e-02 3.18255164e-02\n",
" -4.13492334e+01]\n", " -4.06545281e+01]\n",
"Energies for debugging: \n", "Energies for debugging: \n",
"array([[-0.04144387, -0.00121831, 0.00113709, -0.04155449],\n", "array([[-0.04074714, -0.00119276, 0.00112911, -0.04078908],\n",
" [-0.04125459, 0.00211349, -0.00197891, -0.04128939],\n", " [-0.04056191, 0.00204384, -0.00197853, -0.04056407],\n",
" [-0.04187334, 0.00015398, 0.00015396, -0.04169554]])\n", " [-0.04366189, 0.00022979, 0.00022999, -0.04339642]])\n",
"J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)\n", "J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)\n",
"array([-0.04128939, -0.04187334, -0.04144387])\n", "array([-0.04056407, -0.04366189, -0.04074714])\n",
"Test J_xx = E(y,z) = E(z,y)\n", "Test J_xx = E(y,z) = E(z,y)\n",
"-0.041289392429914126 -0.04169553910557238\n", "-0.04056407415889504 -0.043396424451279274\n",
"\n", "\n",
"[4]Fe(2) [5]Fe(2) [-2 0 0] d [Ang] 5.951322298958084\n", "[4]Fe(2) [5]Fe(2) [-2 0 0] d [Ang] 5.951322298958084\n",
"Isotropic: -1.7091250393227355\n", "Isotropic: -1.7294071924601657\n",
"DMI: [ 0.03576957 0.26364426 -0.18258214]\n", "DMI: [-0.08510436 0.24159561 1.44684598]\n",
"Symmetric-anisotropy: [ 0.06980213 0.03737695 0.02629686 0.03737695 -0.14019341 -0.03727655\n", "Symmetric-anisotropy: [ 0.09622056 0.08175665 0.02144594 0.08175665 -0.06049024 -0.0414623\n",
" 0.02629686 -0.03727655 0.07039128]\n", " 0.02144594 -0.0414623 -0.03573033]\n",
"J: [-1.63932291 0.03737695 0.02629686 0.03737695 -1.84931845 -0.03727655\n", "J: [-1.63318663 0.08175665 0.02144594 0.08175665 -1.78989743 -0.0414623\n",
" 0.02629686 -0.03727655 -1.63873376]\n", " 0.02144594 -0.0414623 -1.76513752]\n",
"Energies for debugging: \n", "Energies for debugging: \n",
"array([[-1.60572733e-03, 7.30461189e-05, 1.50698510e-06,\n", "array([[-1.72606525e-03, -4.36420623e-05, 1.26566667e-04,\n",
" -1.77828935e-03],\n", " -1.82716801e-03],\n",
" [-1.67174019e-03, -2.89941114e-04, 2.37347403e-04,\n", " [-1.80420979e-03, -2.63041556e-04, 2.20149672e-04,\n",
" -1.62742800e-03],\n", " -1.73934458e-03],\n",
" [-1.92034755e-03, -2.19959089e-04, 1.45205198e-04,\n", " [-1.75262685e-03, 1.36508933e-03, -1.52860262e-03,\n",
" -1.65121781e-03]])\n", " -1.52702868e-03]])\n",
"J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)\n", "J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)\n",
"array([-0.00162743, -0.00192035, -0.00160573])\n", "array([-0.00173934, -0.00175263, -0.00172607])\n",
"Test J_xx = E(y,z) = E(z,y)\n", "Test J_xx = E(y,z) = E(z,y)\n",
"-0.0016274280031076719 -0.0016512178077259976\n", "-0.0017393445796559598 -0.0015270286786416\n",
"\n", "\n",
"[4]Fe(2) [5]Fe(2) [-3 0 0] d [Ang] 9.638732176310562\n", "[4]Fe(2) [5]Fe(2) [-3 0 0] d [Ang] 9.638732176310562\n",
"Isotropic: -0.09189981541370944\n", "Isotropic: -0.4535195863892767\n",
"DMI: [ 0.00859892 0.0105977 -0.36714056]\n", "DMI: [ 0.04836847 0.05429183 -0.15906095]\n",
"Symmetric-anisotropy: [-0.05448044 -0.03796364 -0.01728604 -0.03796364 0.04913009 -0.00640036\n", "Symmetric-anisotropy: [ 0.14297234 -0.0154665 0.00345288 -0.0154665 0.19102043 0.01270769\n",
" -0.01728604 -0.00640036 0.00535035]\n", " 0.00345288 0.01270769 -0.33399277]\n",
"J: [-0.14638025 -0.03796364 -0.01728604 -0.03796364 -0.04276972 -0.00640036\n", "J: [-0.31054725 -0.0154665 0.00345288 -0.0154665 -0.26249915 0.01270769\n",
" -0.01728604 -0.00640036 -0.08654947]\n", " 0.00345288 0.01270769 -0.78751236]\n",
"Energies for debugging: \n", "Energies for debugging: \n",
"array([[-4.10410032e-05, 1.49992875e-05, -2.19856035e-06,\n", "array([[-7.80081681e-04, 3.56607876e-05, -6.10761579e-05,\n",
" -1.34816950e-05],\n", " -7.42232776e-04],\n",
" [-1.32057931e-04, 6.68833577e-06, 2.78837344e-05,\n", " [-7.94943031e-04, -5.77447108e-05, 5.08389441e-05,\n",
" -1.85874459e-04],\n", " -8.34582436e-04],\n",
" [-7.20577538e-05, -3.29176918e-04, 4.05104201e-04,\n", " [ 2.17234470e-04, -1.43594444e-04, 1.74527450e-04,\n",
" -1.06886051e-04]])\n", " 2.13487935e-04]])\n",
"J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)\n", "J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)\n",
"array([-1.85874459e-04, -7.20577538e-05, -4.10410032e-05])\n", "array([-0.00083458, 0.00021723, -0.00078008])\n",
"Test J_xx = E(y,z) = E(z,y)\n", "Test J_xx = E(y,z) = E(z,y)\n",
"-0.00018587445917353333 -0.00010688605065147818\n", "-0.0008345824358667467 0.0002134879350515751\n",
"\n", "\n",
"================================================================================================================================================================\n", "================================================================================================================================================================\n",
"Runtime information: \n", "Runtime information: \n",
"Total runtime: 583.827944292 s\n", "Total runtime: 198.828617583 s\n",
"----------------------------------------------------------------------------------------------------------------------------------------------------------------\n", "----------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
"Initial setup: 0.10415358400000052 s\n", "Initial setup: 0.12195141599999992 s\n",
"Hamiltonian conversion and XC field extraction: 0.657 s\n", "Hamiltonian conversion and XC field extraction: 0.564 s\n",
"Pair and site datastructure creatrions: 0.213 s\n", "Pair and site datastructure creatrions: 0.207 s\n",
"k set cration and distribution: 0.023 s\n", "k set cration and distribution: 0.036 s\n",
"Rotating XC potential: 0.264 s\n", "Rotating XC potential: 0.358 s\n",
"Greens function inversion: 581.984 s\n", "Greens function inversion: 197.144 s\n",
"Calculate energies and magnetic components: 0.582 s\n" "Calculate energies and magnetic components: 0.398 s\n"
] ]
} }
], ],
@ -1288,6 +1106,11 @@
" print(\"Pairs integrated.\")\n", " print(\"Pairs integrated.\")\n",
"\n", "\n",
" # calculate magnetic parameters\n", " # calculate magnetic parameters\n",
" for mag_ent in magnetic_entities:\n",
" Kxx, Kyy, Kzz, consistency = calculate_anisotropy_tensor(mag_ent)\n",
" mag_ent[\"K\"] = np.array([Kxx, Kyy, Kzz]) * sisl.unit_convert(\"eV\", \"meV\")\n",
" mag_ent[\"K_consistency\"] = consistency\n",
"\n",
" for pair in pairs:\n", " for pair in pairs:\n",
" J_iso, J_S, D, J = calculate_exchange_tensor(pair)\n", " J_iso, J_S, D, J = calculate_exchange_tensor(pair)\n",
" pair[\"J_iso\"] = J_iso * sisl.unit_convert(\"eV\", \"meV\")\n", " pair[\"J_iso\"] = J_iso * sisl.unit_convert(\"eV\", \"meV\")\n",
@ -1331,7 +1154,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 10,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -1339,7 +1162,7 @@
"evalue": "invalid syntax (3105939143.py, line 1)", "evalue": "invalid syntax (3105939143.py, line 1)",
"output_type": "error", "output_type": "error",
"traceback": [ "traceback": [
"\u001b[0;36m Cell \u001b[0;32mIn[13], 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" "\u001b[0;36m Cell \u001b[0;32mIn[10], 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"
] ]
} }
], ],

Loading…
Cancel
Save