Skip to content

Commit

Permalink
Merge pull request #53 from vishnu2709/master
Browse files Browse the repository at this point in the history
Added documentation for lsms using ReadTheDocs
  • Loading branch information
meisenbach authored Oct 13, 2023
2 parents 30b8944 + 841b9f8 commit ac0580d
Show file tree
Hide file tree
Showing 31 changed files with 672 additions and 24 deletions.
13 changes: 13 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: "2"

build:
os: "ubuntu-22.04"
tools:
python: "3.10"

python:
install:
- requirements: docs/requirements.txt

sphinx:
configuration: docs/source/conf.py
24 changes: 0 additions & 24 deletions doc/manual/Makefile

This file was deleted.

File renamed without changes.
File renamed without changes.
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
File renamed without changes.
File renamed without changes.
File renamed without changes.
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sphinx==7.1.2
sphinx-rtd-theme==1.3.0rc1
19 changes: 19 additions & 0 deletions docs/source/acquisition.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
************
Getting LSMS
************

The code can be obtained from the github repo (https://github.com/mstsuite/lsms)

.. parsed-literal::
git clone https://github.com/mstsuite/lsms.git
LSMS has the following dependencies

1. Fortran and C++
2. Cmake
3. HDF5
4. BLAS and LAPACK
5. MPI
6. (Optional) CUDA/ROCm for GPU acceleration

Lua and LibXC are included - if you would like to use a pre-existing lua or LibXC installation it can be linked during the build process
47 changes: 47 additions & 0 deletions docs/source/conductivity.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
************************
Electrical Resistivity
************************

lsms can also calculate electrical resistivity from the Kubo-Greenwood equation. To do this, first perform a standard self-consistent calculation. Then copy the converged potential to the starting potential and copy the restart file

.. parsed-literal::
cp w_<systemid> v_<systemid>
cp i_lsms.restart i_lsms.dos
Change the mode to conductivity

.. parsed-literal::
lsmsMode="kubo"
Then run lsms

.. parsed-literal::
mpirun -np <number of MPI ranks> $LSMS_PATH/lsms i_lsms.kubo
The stdout will print the electrical resistivity in units of :math:`\mu\Omega`-cm

.. parsed-literal::
TOTAL RESISTIVITY (in microOhm-cm)
412.992 -1.32721 -1.86057
0.540036 408.027 -0.912385
-2.64419 -0.598773 416.019
For a spin-polarized system, the spin up and down resistivities are calculated separately and the resistors are added in parallel.

.. parsed-literal::
RESISTIVITY SPIN 1 (in microOhm-cm)
289.029 -0.206822 0.193379
-0.222593 289.206 0.0590624
0.0231963 -0.48124 289.46
RESISTIVITY SPIN 2 (in microOhm-cm)
262.711 0.162251 -0.491042
-0.173043 261.377 0.476058
-0.993332 1.08469 262.733
TOTAL RESISTIVITY (in microOhm-cm)
137.621 -0.00159926 -0.0911053
-0.0977167 137.294 0.144432
-0.26754 0.190146 137.724
Currently the resistivity implementation is non-relativistic. A relativistic implementation will be added in the future.
35 changes: 35 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Configuration file for the Sphinx documentation builder.

# -- Project information

project = 'LSMS'
copyright = '2023, mstsuite'
author = 'Markus Eisenbach et al'

release = '0.4'
version = '0.4.0'

# -- General configuration

extensions = [
'sphinx.ext.duration',
'sphinx.ext.doctest',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.intersphinx',
]

intersphinx_mapping = {
'python': ('https://docs.python.org/3/', None),
'sphinx': ('https://www.sphinx-doc.org/en/master/', None),
}
intersphinx_disabled_domains = ['std']

templates_path = ['_templates']

# -- Options for HTML output

html_theme = 'sphinx_rtd_theme'

# -- Options for EPUB output
epub_show_urls = 'footnote'
31 changes: 31 additions & 0 deletions docs/source/dos.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
******************
Density of States
******************

To get DOS, first a standard self-consistent calculation (as described in the previous sections) must be performed. Once that is done, copy the restart file to a new input file and the converged potential as the new starting potential

.. parsed-literal::
cp i_lsms.restart i_lsms.dos
cp w_<systemid> v_<systemid>
Edit the i_lsms.dos for dos calculations. First set the mode for DOS

.. parsed-literal::
lsmsMode="dos"
Change the energy contour settings so that the points are parallel to the real energy axis

.. parsed-literal::
energyContour.grid=3
energyContour.npts= <number of energy points>
energyContour.ebot= <starting energy value>
energyContour.etop= <final energy value>
energyContour.eibot= <imaginary part>
It is important to specify ``energyContour.eibot`` as we cannot traverse the real energy line due to singularities. Hence adding a small imaginary part to the energy is necessary. Generallyvalues between 0.001 and 0.005 Ryd are good choices.

lsms will generate an output file called ``dos.out`` with three columns

1. Real part of the energy.
2. Imaginary part of the energy.
3. Total Density of States
28 changes: 28 additions & 0 deletions docs/source/gfm.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
******************************************
Green's Function at Matsubara Frequencies
******************************************

lsms can write out the Green's function at the Matsubara frequencies. To do this, set the mode and the required temperature

.. parsed-literal::
lsmsMode = "gf_out"
temperature = <Temperature in Kelvin>
The relevant energy points are given by

.. math::
E_n = E_F + \pi ik_B T(2n + 1)
To generate these energy points, we need to set the appropriate contour in the input file

.. parsed-literal::
energyContour.grid=4
energyContour.npts= <number of points>
lsms will generate output files of the form ``greens_functions_<atom index>.out``, containing the local Green's function in blocks for each energy. There are five columns in each energy block

1. Spin index
2. L = (l,m) index
3. L' = (l',m') index
4. Real part of G(L,L')
5. Imaginary part of G(L,L')
22 changes: 22 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Welcome to the LSMS documentation!
===================================

**LSMS** is a high-performance software package for scalable first-principles calculations of materials using locally self-consistent multiple scattering theory.

Use the sidebar to navigate to the required section.

.. note::

This project is under active development.

.. toctree::
:hidden:

acquisition
installation
running
inputfile
outputfile
dos
gfm
conductivity
Loading

0 comments on commit ac0580d

Please sign in to comment.