{ "cells": [ { "cell_type": "markdown", "source": [ "### Interfacing with Other Codes\n", "\n", "An important thing to point out about computational material science is that there are many ways to represent each individual atomic system. Force calculators like LAMMPS and ShengBTE occasionally transform the coordinates of your input files while calculating FC's to match their internal convention. Please ensure all coordinate systems are consistent across your simulation.\n", "This especially applies when you calculate harmonic force constants at a high level of theory (e.g. using DFPT for second-order FC's) but use a faster method with different code for third-order FC's.\n", "An example would be if you used second-order FC's from Quantum Espresso, and then use ShengBTE's thirdorder package to calculate third-order FC's by finite difference. The thirdorder package will silently transform unitcell's with negative coordinate when possible.\n", "\n", "\n", "#### LAMMPS library setup\n", "\n", "In order to use LAMMPS with ASE, it needs to be compiled a lib\n", "```bash\n", "cd path/to/lammps/src\n", "make yes-manybody\n", "make yes-molecule\n", "...\n", "make mpi mode=shlib\n", "```\n", "Next, activate your environment\n", "```\n", "conda activate kaldo\n", "```\n", "or if you used `virtualenv`\n", "```\n", "source ~/kaldo/bin/activate\n", "```\n", "and finally install `lammpslib` using\n", "```\n", "make install-python\n", "```\n", "Update 07/2020: It you are having any issue with the July 2020 version of `lammpslib`, try using the October 2019 version.\n", "\n", "#### LAMMPS executable setup\n", "\n", "You can use LAMMPS executable directly, as illustrated in the example folder.\n", "For that purpose, you will need the [LAMMPS user-phonon package by Charles Sievers](https://lammps.sandia.gov/doc/Packages_details.html#pkg-user-phonon) to calculate the dynamical matrix and the third order interatomic force constants.\n", "\n", "#### Quantum Espresso setup\n", "\n", "In order to use QE with ASE, Set the environment variable:\n", "```bash\n", "export ASE_ESPRESSO_COMMAND=\"mpirun -np 4 /path/to/pw.x -in PREFIX.pwi > PREFIX.pwo\"\n", "```\n", "Update 01/2021: It you are having any issue with ASE version 3.20+, try using ASE version 3.19.1.\n", "\n", "\n", "See the [ASE documentation](https://wiki.fysik.dtu.dk/ase/ase/calculators/calculators.html) for more info.\n", "\n", "\n", "### Output Storage\n", "\n", "#### Default Storage\n", "\n", "When using the storage `formatted`, kALDo stores the following dense tensor as formatted, human readable, files:\n", "\n", "- `frequency` $(n_{kpoints}, n_{modes})$. mode changes first k changes after\n", "- `velocity_alpha` $(n_{kpoints}, n_{modes})$\n", "- `physical_mode___` $(n_{kpoints}, n_{modes})$\n", "\n", "- `//heat_capacity` $(n_{kpoints}, n_{modes})$\n", "- `//population` $(n_{kpoints}, n_{modes})$\n", "\n", "- `/////conductivity__` $(n_{kpoints}, n_{modes})$ where the `/` folder is created only if those values are defined\n", "- `///diffusivity` $(n_{kpoints}, n_{modes})$\n", "- `////mean_free_path` $(n_{kpoints}, n_{modes})$\n", "- `///lifetime` $(n_{kpoints}, n_{modes})$\n", "- `///bandwidth` $(n_{kpoints}, n_{modes})$\n", "- `///phase_space` $(n_{kpoints}, n_{modes})$\n", "- `flux_dense` $(n_{kpoints}, n_{modes}, n_{kpoints}, n_{modes})$, when `diffusivity_threshold` is not specified.\n", "- `//flux_sparse` $(n_{kpoints}, n_{modes}, n_{kpoints}, n_{modes})$. Sparse only when `diffusivity_threshold` is specified.\n", "\n", "\n", "The folder structure depends on the input parameters to the Phonon Object\n", "and in parenthesis is the shape of the tensor. All of the above observables are stored in a dense format, \n", "except for `flux_alpha` which is stored as formatted file in a `index value` format.\n", "\n", "The following tensors are stored in raw binary format and help saving time when performing different simulations on the same sample.\n", "\n", "- `_eigensystem (eigenvalues and eigenvectors)`\n", "- `_dynmat_derivatives`\n", "- `///_generalized_diffusivity` \n", "- `///_ps_and_gamma_tensor`\n", "- `///_ps_and_gamma`, when only RTA conductivity is required\n", "\n", "#### Alternative Storage\n", "\n", "Other storage options available are `numpy` and `hdf5` where all the files are saved as one of those formats.\n", "Finally the `memory` option doesn't store any permanent files.\n", "\n", "### Units\n", "\n", "\n", "| Measurement | Units |\n", "|-------------------------|--------------------------|\n", "| Distances | $A$ |\n", "| Masses | $g/N_A$ |\n", "| Frequencies | $THz$ |\n", "| Potential Derivatives | $eV/(A^2)$ or $eV/(A^3)$ |\n", "| Conductivity [$\\kappa$] | $\\frac{W}{m\\ K}$ |" ], "metadata": { "collapsed": false }, "id": "9b84543855dcb709" } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.6" } }, "nbformat": 4, "nbformat_minor": 5 }