just running tests

class-solution
Daniel Pozsar 3 months ago
parent 6b008d0e90
commit 1ea4bfd7ab

@ -271,9 +271,18 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 4,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Hamiltonian and exchange field rotated. Elapsed time: 2.613376875 s\n",
"================================================================================================================================================================\n"
]
}
],
"source": [ "source": [
"NO = dh.no # shorthand for number of orbitals in the unit cell\n", "NO = dh.no # shorthand for number of orbitals in the unit cell\n",
"\n", "\n",
@ -371,9 +380,18 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 5,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Site and pair dictionaries created. Elapsed time: 2.628747208 s\n",
"================================================================================================================================================================\n"
]
}
],
"source": [ "source": [
"# for every site we have to store 3 Greens function (and the associated _tmp-s) in the 3 reference directions\n", "# 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", "for i, mag_ent in enumerate(magnetic_entities):\n",
@ -477,9 +495,25 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 6,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"k loop: 0%| | 0/400 [00:00<?, ?it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"k set created. Elapsed time: 2.648811208 s\n",
"================================================================================================================================================================\n"
]
}
],
"source": [ "source": [
"kset = make_kset(dirs=kdirs, NUMK=kset) # generate k space sampling\n", "kset = make_kset(dirs=kdirs, NUMK=kset) # generate k space sampling\n",
"wkset = np.ones(len(kset)) / len(kset) # generate weights for k points\n", "wkset = np.ones(len(kset)) / len(kset) # generate weights for k points\n",
@ -496,9 +530,18 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 7,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Rotations done perpendicular to quantization axis. Elapsed time: 2.901047458 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",
@ -550,9 +593,49 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 8,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Starting matrix inversions\n",
"Total number of k points: 400\n",
"Number of energy samples per k point: 100\n",
"Total number of directions: 3\n",
"Total number of matrix inversions: 120000\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: 150.0 KB\n",
"Expected memory usage on root node: 58.59375 MB\n",
"================================================================================================================================================================\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"k loop: 100%|██████████| 400/400 [03:18<00:00, 2.01it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Calculated Greens functions. Elapsed time: 201.17534975 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",
@ -645,9 +728,121 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 9,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Magnetic entities integrated.\n",
"Pairs integrated.\n",
"Magnetic parameters calculated.\n",
"##################################################################### GROGU OUTPUT #############################################################################\n",
"================================================================================================================================================================\n",
"Input file: \n",
"Not yet specified.\n",
"Output file: \n",
"test.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: 20\n",
"k point directions: xy\n",
"Ebot: -13\n",
"Eset: 100\n",
"Esetp: 100\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",
"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] Not yet.\n",
"Isotropic: -63.6758032703783\n",
"DMI: [-9.33104051e-01 -1.01015977e-03 -2.89340046e-06]\n",
"Symmetric-anisotropy: [-3.45194760e+00 1.37702774e+00 1.29440230e-03 -8.59287160e-04\n",
" 1.03571867e-04]\n",
"Energies for debugging: \n",
"array([[-6.22987755e-02, -9.33207623e-04, 9.33000479e-04,\n",
" -6.16008834e-02],\n",
" [-6.77166238e-02, 8.59287160e-07, -1.16103239e-06,\n",
" -6.71277509e-02],\n",
" [-4.95869253e-02, -1.29729570e-06, -1.29150890e-06,\n",
" -4.95886050e-02]])\n",
"J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)\n",
"array([-0.06712775, -0.04958693, -0.06229878])\n",
"Test J_xx = E(y,z) = E(z,y)\n",
"-0.06712775087066476 -0.04958860499691915\n",
"\n",
"[4]Fe(2) [5]Fe(2) [0 0 0] d [Ang] Not yet.\n",
"Isotropic: -60.98280300207994\n",
"DMI: [-3.79822521e+00 6.14860175e+00 5.42292960e-03]\n",
"Symmetric-anisotropy: [0.06335389 0.13420785 0.07070523 6.23730266 0.03599778]\n",
"Energies for debugging: \n",
"array([[-6.08485951e-02, -3.83422299e-03, 3.76222743e-03,\n",
" -6.11803648e-02],\n",
" [-6.06181097e-02, -6.23730266e-03, 6.05990085e-03,\n",
" -6.09194491e-02],\n",
" [-5.99054512e-02, -6.52823043e-05, -7.61281635e-05,\n",
" -5.98235524e-02]])\n",
"J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)\n",
"array([-0.06091945, -0.05990545, -0.0608486 ])\n",
"Test J_xx = E(y,z) = E(z,y)\n",
"-0.06091944910723846 -0.059823552399443855\n",
"\n",
"[3]Fe(2) [5]Fe(2) [0 0 0] d [Ang] Not yet.\n",
"Isotropic: -60.99404713886926\n",
"DMI: [ 3.78607092e+00 -6.13231029e+00 5.42245509e-03]\n",
"Symmetric-anisotropy: [ 0.05074819 0.13690999 0.07070521 -6.22528695 -0.04239585]\n",
"Energies for debugging: \n",
"array([[-6.08571371e-02, 3.82846677e-03, -3.74367506e-03,\n",
" -6.11817053e-02],\n",
" [-6.06264662e-02, 6.22528695e-03, -6.03933362e-03,\n",
" -6.09432989e-02],\n",
" [-5.99054277e-02, -6.52827577e-05, -7.61276679e-05,\n",
" -5.98235222e-02]])\n",
"J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)\n",
"array([-0.0609433 , -0.05990543, -0.06085714])\n",
"Test J_xx = E(y,z) = E(z,y)\n",
"-0.060943298947041494 -0.059823522197803146\n",
"\n",
"================================================================================================================================================================\n",
"Runtime information: \n",
"Total runtime: 199.56628429199998 s\n",
"----------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
"Initial setup: 0.150397667 s\n",
"Hamiltonian conversion and XC field extraction: 0.802 s\n",
"Pair and site datastructure creatrions: 0.015 s\n",
"k set cration and distribution: 0.020 s\n",
"Rotating XC potential: 0.252 s\n",
"Greens function inversion: 198.274 s\n",
"Calculate energies and magnetic components: 0.052 s\n"
]
}
],
"source": [ "source": [
"if rank == root_node:\n", "if rank == root_node:\n",
" # iterate over the magnetic entities\n", " # iterate over the magnetic entities\n",
@ -730,9 +925,18 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 10,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [
{
"ename": "SyntaxError",
"evalue": "invalid syntax (2508083104.py, line 2)",
"output_type": "error",
"traceback": [
"\u001b[0;36m Cell \u001b[0;32mIn[10], line 2\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": [
"##################################################################### GROGU OUTPUT #############################################################################\n", "##################################################################### GROGU OUTPUT #############################################################################\n",
"================================================================================================================================================================\n", "================================================================================================================================================================\n",

Loading…
Cancel
Save