From 8b2afbb555684eefabbfb49edcde6009c8f7e01c Mon Sep 17 00:00:00 2001 From: Daniel Pozsar Date: Fri, 1 Nov 2024 10:55:54 +0100 Subject: [PATCH] could not read hamiltonian, tested for a bunch of sisl versions --- Fe3GeTe2_3-791lat_short-1.txt | 70 ------------------- pyproject.toml | 4 +- requirements.txt | 2 +- simmetries.txt | 120 --------------------------------- test.ipynb | 122 +++++++++++++++++++++++++++++++--- 5 files changed, 117 insertions(+), 201 deletions(-) delete mode 100644 Fe3GeTe2_3-791lat_short-1.txt delete mode 100644 simmetries.txt diff --git a/Fe3GeTe2_3-791lat_short-1.txt b/Fe3GeTe2_3-791lat_short-1.txt deleted file mode 100644 index 99d4228..0000000 --- a/Fe3GeTe2_3-791lat_short-1.txt +++ /dev/null @@ -1,70 +0,0 @@ -======================================== -Cell Angstroms -3.7910 0.0000 0.0000 --1.8955 3.2831 0.0000 -0.0000 0.0000 20.5700 -======================================== - -Atom Angstrom -# Label, x y z Sx Sy Sz #Q Lx Ly Lz Jx Jy Jz --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -Te1 1.8955 1.0943 13.1698 -0.0000 0.0000 -0.1543 # 5.9345 -0.0000 0.0000 -0.0537 -0.0000 0.0000 -0.2080 -Te2 1.8955 1.0943 7.4002 0.0000 -0.0000 -0.1543 # 5.9345 0.0000 -0.0000 -0.0537 0.0000 -0.0000 -0.2080 -Ge3 -0.0000 2.1887 10.2850 0.0000 0.0000 -0.1605 # 3.1927 -0.0000 0.0000 0.0012 0.0000 0.0000 -0.1593 -Fe4 -0.0000 0.0000 11.6576 0.0001 -0.0001 2.0466 # 8.3044 0.0000 -0.0000 0.1606 0.0001 -0.0001 2.2072 -Fe5 -0.0000 0.0000 8.9124 -0.0001 0.0001 2.0466 # 8.3044 -0.0000 0.0000 0.1606 -0.0001 0.0001 2.2072 -Fe6 1.8955 1.0944 10.2850 0.0000 0.0000 1.5824 # 8.3296 -0.0000 -0.0000 0.0520 -0.0000 0.0000 1.6344 -================================================================================================================================== - -Exchange meV --------------------------------------------------------------------------------- -# at1 at2 i j k # d (Ang) --------------------------------------------------------------------------------- -Fe4 Fe5 0 0 0 # 2.7452 -Isotropic -82.0854 -DMI 0.12557 -0.00082199 6.9668e-08 -Symmetric-anisotropy -0.60237 -0.83842 -0.00032278 -1.2166e-05 -3.3923e-05 --------------------------------------------------------------------------------- -Fe4 Fe6 0 0 0 # 2.5835 -Isotropic -41.9627 -DMI 1.1205 -1.9532 0.0018386 -Symmetric-anisotropy 0.26007 -0.00013243 0.12977 -0.069979 -0.042066 --------------------------------------------------------------------------------- -Fe4 Fe4 1 0 0 # 3.791 -Isotropic 11.3817 -DMI -0.027065 5.0079 1.2495 -Symmetric-anisotropy 0.25899 0.61356 0.00018352 -8.2489e-06 -0.059116 --------------------------------------------------------------------------------- -Fe4 Fe5 1 0 0 # 4.6806 -Isotropic -2.9464 -DMI 1.7 0.0069825 6.4657 -Symmetric-anisotropy 0.44323 0.056997 1.7739e-05 0.14942 1.077e-05 --------------------------------------------------------------------------------- -Fe4 Fe6 1 0 0 # 5.9513 -Isotropic -1.9722 -DMI -0.044414 0.34777 0.55124 -Symmetric-anisotropy 0.19364 -0.10179 -0.057654 0.023297 0.033722 --------------------------------------------------------------------------------- -Fe4 Fe4 2 0 0 # 7.582 -Isotropic -2.5085 -DMI 0.015126 0.020638 -0.26104 -Symmetric-anisotropy -0.145 -0.021424 6.948e-05 3.0356e-05 -0.18409 -================================================================================ - -On-site meV ----------------------------------------- -Fe4 -0.16339 0.16068 0 0 0 0 -======================================== - -# ----------------------GROGU INFORMATION---------------------- -# Grogu calculation was performed with a k-grid equal to 100 100 1 -# On-site Projection is performed over l = 2 -# Original DFT calculation with quantization axis along the z direction - -Notation -Double-counting true -Spin-normalized true -Exchange-factor 0.5 -On-site-factor 1 -======================================== diff --git a/pyproject.toml b/pyproject.toml index 187cb8e..8dc1b11 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,8 +20,8 @@ kewords = [ requires-python = ">=3.9" dependencies = [ "numpy==1.24.4", - "scipy", - "sisl==0.14.3", + "scipy==1.10.1", + "sisl==0.13", "netcdf4==1.6.2", "openmpi", "mpi4py", diff --git a/requirements.txt b/requirements.txt index 81c9cc2..6d0475e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ # Package dependencies numpy==1.24.4 scipy==1.10.1 -sisl==0.14.1 +sisl==0.13 netcdf4==1.6.2 openmpi mpi4py diff --git a/simmetries.txt b/simmetries.txt deleted file mode 100644 index 36444de..0000000 --- a/simmetries.txt +++ /dev/null @@ -1,120 +0,0 @@ -Number of nodes in the parallel cluster: 4 - k loop: 0% 0/100 [00:00 104\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 105\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m 106\u001b[0m simulation_parameters[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mgeom\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m fdf\u001b[38;5;241m.\u001b[39mread_geometry()\n", + "File \u001b[0;32m~/Documents/oktatás/elte/phd/grogu_project/.venv/lib/python3.9/site-packages/sisl/io/siesta/fdf.py:2062\u001b[0m, in \u001b[0;36mfdfSileSiesta.read_hamiltonian\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 2060\u001b[0m order \u001b[38;5;241m=\u001b[39m _listify_str(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;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 2061\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m f \u001b[38;5;129;01min\u001b[39;00m order:\n\u001b[0;32m-> 2062\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 2063\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 2064\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:2094\u001b[0m, in \u001b[0;36mfdfSileSiesta._r_hamiltonian_hsx\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 2092\u001b[0m H \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 2093\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m f\u001b[38;5;241m.\u001b[39mis_file():\n\u001b[0;32m-> 2094\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 2095\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 2096\u001b[0m \u001b[38;5;66;03m# to ensure we get the correct orbital count\u001b[39;00m\n\u001b[1;32m 2097\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, order\u001b[38;5;241m=\u001b[39m[\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;124mfdf\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/sisl/io/siesta/binaries.py:663\u001b[0m, in \u001b[0;36mhsxSileSiesta.version\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 660\u001b[0m \u001b[38;5;129m@property\u001b[39m\n\u001b[1;32m 661\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 662\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--> 663\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)" + ] + } + ], "source": [ "# this cell mimicks an input file\n", "fdf = sisl.get_sile(\"./lat3_791/Fe3GeTe2.fdf\") # ./Jij_for_Marci_6p45ang/CrBr.fdf\n", @@ -61,6 +114,23 @@ "pairs = [\n", " # isotropic should be -82 meV\n", " dict(ai=0, aj=1, Ruc=np.array([0, 0, 0])),\n", + " dict(ai=0, aj=1, Ruc=np.array([1, 0, 0])),\n", + " dict(ai=0, aj=1, Ruc=np.array([-1, 0, 0])),\n", + " dict(ai=0, aj=1, Ruc=np.array([2, 0, 0])),\n", + " dict(ai=0, aj=1, Ruc=np.array([-2, 0, 0])),\n", + " dict(ai=0, aj=1, Ruc=np.array([0, 1, 0])),\n", + " dict(ai=0, aj=1, Ruc=np.array([0, -1, 0])),\n", + " dict(ai=0, aj=1, Ruc=np.array([0, 2, 0])),\n", + " dict(ai=0, aj=1, Ruc=np.array([0, -2, 0])),\n", + " dict(ai=1, aj=0, Ruc=np.array([0, 0, 0])),\n", + " dict(ai=1, aj=0, Ruc=np.array([1, 0, 0])),\n", + " dict(ai=1, aj=0, Ruc=np.array([-1, 0, 0])),\n", + " dict(ai=1, aj=0, Ruc=np.array([2, 0, 0])),\n", + " dict(ai=1, aj=0, Ruc=np.array([-2, 0, 0])),\n", + " dict(ai=1, aj=0, Ruc=np.array([0, 1, 0])),\n", + " dict(ai=1, aj=0, Ruc=np.array([0, -1, 0])),\n", + " dict(ai=1, aj=0, Ruc=np.array([0, 2, 0])),\n", + " dict(ai=1, aj=0, Ruc=np.array([0, -2, 0])),\n", " # these should all be around -41.9 in the isotropic part\n", " # dict(ai=0, aj=2, Ruc=np.array([0, 0, 0])),\n", " # dict(ai=1, aj=2, Ruc=np.array([0, 0, 0])),\n", @@ -137,7 +207,19 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "NameError", + "evalue": "name 'dh' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[4], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m NO \u001b[38;5;241m=\u001b[39m \u001b[43mdh\u001b[49m\u001b[38;5;241m.\u001b[39mno \u001b[38;5;66;03m# shorthand for number of orbitals in the unit cell\u001b[39;00m\n\u001b[1;32m 3\u001b[0m \u001b[38;5;66;03m# preprocessing Hamiltonian and overlap matrix elements\u001b[39;00m\n\u001b[1;32m 4\u001b[0m h11 \u001b[38;5;241m=\u001b[39m dh\u001b[38;5;241m.\u001b[39mtocsr(dh\u001b[38;5;241m.\u001b[39mM11r)\n", + "\u001b[0;31mNameError\u001b[0m: name 'dh' is not defined" + ] + } + ], "source": [ "NO = dh.no # shorthand for number of orbitals in the unit cell\n", "\n", @@ -230,7 +312,19 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "NameError", + "evalue": "name 'dh' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[5], line 3\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;66;03m# for every site we have to store 3 Greens function (and the associated _tmp-s) in the 3 reference directions\u001b[39;00m\n\u001b[1;32m 2\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m i, mag_ent \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28menumerate\u001b[39m(magnetic_entities):\n\u001b[0;32m----> 3\u001b[0m parsed \u001b[38;5;241m=\u001b[39m parse_magnetic_entity(\u001b[43mdh\u001b[49m, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mmag_ent) \u001b[38;5;66;03m# parse orbital indexes\u001b[39;00m\n\u001b[1;32m 4\u001b[0m magnetic_entities[i][\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124morbital_indeces\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m parsed\n\u001b[1;32m 5\u001b[0m \u001b[38;5;66;03m# calculate spin box indexes\u001b[39;00m\n", + "\u001b[0;31mNameError\u001b[0m: name 'dh' is not defined" + ] + } + ], "source": [ "# for every site we have to store 3 Greens function (and the associated _tmp-s) in the 3 reference directions\n", "for i, mag_ent in enumerate(magnetic_entities):\n", @@ -684,7 +778,19 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "NameError", + "evalue": "name 'dh' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[1], line 3\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mmatplotlib\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mpyplot\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mplt\u001b[39;00m\n\u001b[0;32m----> 3\u001b[0m coords \u001b[38;5;241m=\u001b[39m \u001b[43mdh\u001b[49m\u001b[38;5;241m.\u001b[39mxyz[\u001b[38;5;241m-\u001b[39m\u001b[38;5;241m3\u001b[39m:]\n\u001b[1;32m 6\u001b[0m plt\u001b[38;5;241m.\u001b[39mfigure(figsize\u001b[38;5;241m=\u001b[39m(\u001b[38;5;241m15\u001b[39m, \u001b[38;5;241m5\u001b[39m))\n\u001b[1;32m 7\u001b[0m plt\u001b[38;5;241m.\u001b[39msubplot(\u001b[38;5;241m131\u001b[39m)\n", + "\u001b[0;31mNameError\u001b[0m: name 'dh' is not defined" + ] + } + ], "source": [ "import matplotlib.pyplot as plt\n", "\n",