From 4aa46e72a7508e9d9096ca649b4c332316dc5e4d Mon Sep 17 00:00:00 2001 From: ialcon <160740748+ialcon@users.noreply.github.com> Date: Thu, 8 Aug 2024 13:00:46 +0200 Subject: [PATCH] Changes to S_02 --- S_02/run.ipynb | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/S_02/run.ipynb b/S_02/run.ipynb index 4ab3af0..f2502cf 100644 --- a/S_02/run.ipynb +++ b/S_02/run.ipynb @@ -16,17 +16,17 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Analysing output from Siesta makes analysis much easier since many things are intrinsically enabled through `sisl`, i.e. orbital numbering etc. may easily be handled with `sisl`.\n", + "Analysing output from Siesta makes analysis much easier since many things are intrinsically enabled through `sisl` - i.e. orbital numbering etc. may easily be handled with `sisl`.\n", "\n", - "In this example we will use Siesta to calculate the *heavy* part, i.e. the projected density of states for a fine $k$-point sampling. The formula used to calculate the projected density of states is:\n", + "In this example we will use Siesta to calculate the *heavy* part, i.e. the projected density-of-states for a fine $k$-point sampling. The formula used to calculate the projected density-of-states is:\n", "\\begin{align}\n", - " \\mathrm{PDOS}_\\nu(E) &= \\int \\mathrm d k \\sum_i \\psi^*_{i,k,\\nu} [\\mathbf S(k) | \\psi_{i,k}\\rangle]_\\nu D(E-\\epsilon_i),\n", + " \\mathrm{PDOS}_\\nu(E) &= \\int \\mathrm d k \\sum_i \\psi^*_{i,k,\\nu} [\\mathbf S(k) | \\psi_{i,k}\\rangle]_\\nu D(E-\\epsilon_{i}(k)),\n", " \\\\\n", - " \\mathrm{DOS}(E) &= \\int \\mathrm d k \\sum_i D(E-\\epsilon_i) = \\sum_\\nu \\mathrm{PDOS}_\\nu(E),\n", + " \\mathrm{DOS}(E) &= \\int \\mathrm d k \\sum_i D(E-\\epsilon_{i}(k)) = \\sum_\\nu \\mathrm{PDOS}_\\nu(E),\n", "\\end{align}\n", - "with $D(\\Delta E)$ being the distribution function (in Siesta, this is the Gaussian distribution function).\n", - "Finally, we will also compare with the same calculation using `sisl` to ensure that correctness of both methods.\n", - "Note that `sisl` is (for now) not MPI parallelized and thus for large systems it may be *way* more efficient to use Siesta to calculate PDOS, but use `sisl` to post-process the PDOS data.\n", + "Where *E* is the energy, $D(\\Delta E)$ is the distribution function (in Siesta, this is the Gaussian distribution function) and $\\epsilon_{i}(k)$ and $\\mathbf S(k)$ are the ith eigenvalue and overlap matrix, respectively, at a given **k**-point. $\\psi_{i,k}$ is the ith **k**-resolved eigenstate, and $\\psi^*_{i,k,\\nu}$ is the corresponding complex-conjugate resolved for a concrete atomic orbital $\\nu$. \n", + "Finally, we will do the same calculation using `sisl` to ensure the correctness of both methods.\n", + "Note that `sisl` is (for now) not MPI parallelized and thus for large systems it may be *way* more efficient to use Siesta to calculate PDOS, and then use `sisl` to post-process the PDOS data.\n", "\n", "The system will again be graphene." ] @@ -85,8 +85,8 @@ " siesta RUN.fdf | tee RUN.out\n", "\n", "Subsequently, we will read in the PDOS information and post-process it. \n", - "First we will data found in the `siesta.PDOS.xml` file, 3 quantities will be returned:\n", - "1. The geometry (as found in the XML file), this also contains all atomic species etc.\n", + "First we will extract data found in the `siesta.PDOS.xml` file. Three quantities will be returned:\n", + "1. The geometry (as found in the XML file) - this also contains all atomic species etc.\n", "2. The energy grid used\n", "3. Orbital and energy resolved DOS\n", "\n", @@ -124,12 +124,15 @@ "4. Read in the Hamiltonian (as done in [S 1](../S_01/run.ipynb)) and create a Monkhorst-Pack grid as the one in Siesta input. Use this snippet to calculate the PDOS using `sisl`\n", "\n", " mp = sisl.MonkhorstPack(H, [nx, ny, 1])\n", - " mp_avg = mp.apply.average\n", - " pdos = mp_avg.PDOS(E, eta=True)\n", + " def wrap_multiple(eigenstate):\n", + " DOS = eigenstate.DOS(E)\n" + " PDOS = eigenstate.PDOS(E)\n" + " return sisl.oplist([DOS, PDOS])\n", + " DOS, PDOS = mp.apply.average.eigenstate(wrap=wrap_multiple, eta=True)\n", "\n", - " Search the API documentation for the `MonkhorstPack.apply.average` method and figure out what it does. Note, there are other `MonkhorstPack.apply.*` methods, these are all extremely useful when calculating many quantities of data in a Brillouin-zone object.\n", + " Search the API documentation for the `MonkhorstPack.apply.average` method and figure out what it does. Note, there are other `MonkhorstPack.apply.*` methods - these are all extremely useful when calculating many quantities of data in a Brillouin-zone object.\n", "5. Compare the Siesta PDOS with sisl PDOS, why are they different? \n", - " *HINT*: $\\sigma$. Check the API for the `PDOS` method." + " *HINT*: $\\sigma$. Check the API for the `PDOS` method in the Siesta manual (https://siesta-project.org/SIESTA_MATERIAL/Docs/Manuals/siesta-4.1.5.pdf)." ] }, { @@ -152,7 +155,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" },