From 37ccf42d618572b80c64cc9428c532ea21ec2851 Mon Sep 17 00:00:00 2001 From: Daniel Pozsar Date: Fri, 8 Nov 2024 09:03:14 +0100 Subject: [PATCH] ran test with anisotropy, consistency looks good, but there is no grogu data to compare with --- Fe3GeTe2_notebook.pickle | Bin 7634 -> 7977 bytes src/grogu_magn/utils.py | 6 +- test.ipynb | 613 ++++++++++++++------------------------- 3 files changed, 221 insertions(+), 398 deletions(-) diff --git a/Fe3GeTe2_notebook.pickle b/Fe3GeTe2_notebook.pickle index 4ef939fec07d44e5355ef29ce55946bf7decc0d9..6e413b110c41bd7b4f41215397a64d265725db31 100644 GIT binary patch literal 7977 zcmcgx3tUXuAD?C>QlTZZEkbSOHAy12x>>zPNl8)dG-fU{HO*umy%c#DcQ_;s?_`N6LS@quOBU5etqxn{O&pDd(Ziv-#xdJ&Rjp( zil+Ugk@kdfJXgw%!{xYCMrwR!JXbCti6Dni87y+(bHzej6fa4UaitEPl0>mc!sW{x z#F7|cjDt7sQZSMJ1_FwwCk&YH`gOA_5B3c0RvOIAyW zBbLbVITA@MD_+Qp72zb&SH_#mNrEPk3URTVD;G+{B+*Z-h>K5V@g!256{ir%g94XF|h-GrAf+r`lNy1QjBkWDg*WHp$vT4i7DF$=Mm1Hn!&o*E)mXiV#!jLad zj>k1s=t37VGeZ|;5C*PfU|^tsGyG})uxWB~PUaK~-H?6wYd~F+FienoTnp(I5QWjWs zUAe<9Z9mDjZ57o2|A8&)3Q^E@`M+d~Izk=m#ug`-u`*mvvW*GDSiTUhIf9-9Wz2+Y zKu-EUgQA1inmYnU84!k=t9UY?fkE`tEK`vP7jb056r5xm5KJB}5_KdjHe&@TFem79 zTd7)L(UGQoSN5+gdl}Np1Cd0yOk4gQq*i#^T$p0q61R&PsBZi;w>wH$(2juNH$ztB9cufdP}5pgmSKkBNX#- z9=xr++Kk~^fzKcu_hDsr{0#QPA?Xp&MnW3}Z8S6%GzVy7pgBSt3r)k3Fq6d##hf{k zq)&8h4!edcGcOoc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 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", - "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", - "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", - "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", - "\u001b[0;31mTypeError\u001b[0m: function takes exactly 5 arguments (1 given)" + "name": "stdout", + "output_type": "stream", + "text": [ + "================================================================================================================================================================\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: 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", "#################################### INPUT #####################################\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", "\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", "]\n", "# Brilloun zone sampling and Green function contour integral\n", - "kset = 15\n", + "kset = 10\n", "kdirs = \"xy\"\n", "ebot = -13\n", "eset = 300\n", @@ -490,7 +284,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Hamiltonian and exchange field rotated. Elapsed time: 11.290487791 s\n", + "Hamiltonian and exchange field rotated. Elapsed time: 5.473272791 s\n", "================================================================================================================================================================\n" ] } @@ -581,7 +375,7 @@ "\n", "\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", " warnings.warn(\n", " f\"Exchange field has non negligible scalar part. Largest value is {max_xcfs}\"\n", @@ -650,7 +444,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Site and pair dictionaries created. Elapsed time: 11.50304025 s\n", + "Site and pair dictionaries created. Elapsed time: 5.680114458 s\n", "================================================================================================================================================================\n" ] } @@ -774,14 +568,14 @@ "name": "stderr", "output_type": "stream", "text": [ - "k loop: 0%| | 0/225 [00:00