3
0
mirror of https://github.com/triqs/dft_tools synced 2024-07-17 16:33:46 +02:00
dft_tools/doc/tutorials/svo_vasp/svo_notebook.ipynb

209 lines
5.8 KiB
Plaintext

{
"cells": [
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [],
"source": [
"import matplotlib\n",
"matplotlib.use(\"Pdf\")\n",
"import matplotlib.pyplot as plt\n",
"%matplotlib inline\n",
"%config InlineBackend.figure_format = 'svg'\n",
"\n",
"# set matplotlib parameters\n",
"params = {'backend': 'ps',\n",
" 'axes.labelsize': 13,\n",
" 'font.size': 13,\n",
" 'legend.fontsize': 13,\n",
" 'xtick.labelsize': 13,\n",
" 'ytick.labelsize': 13,\n",
" 'text.usetex': False,\n",
" 'text.latex.preamble': \"\\\\usepackage{mathpazo}, \\\\usepackage{amsmath}\",\n",
" 'font.family': 'sans-serif',\n",
" 'font.sans-serif': ['Computer Modern Sans serif']}\n",
"plt.rcParams.update(params)\n",
"\n",
"import warnings \n",
"warnings.filterwarnings(\"ignore\") #ignore some matplotlib warnings\n",
"\n",
"# numpy\n",
"import numpy as np\n",
"\n",
"# .. _svonotebook:"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# DFT and projections"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"from pytriqs.archive import HDFArchive"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"# import plovasp converter\n",
"import triqs_dft_tools.converters.plovasp.converter as plo_converter\n",
"# import VASPconverter\n",
"from triqs_dft_tools.converters.vasp_converter import *\n",
"# SumK\n",
"from triqs_dft_tools.sumk_dft_tools import SumkDFTTools"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Read parameters:\n",
"0 -> {'m': 0, 'l': 2, 'isite': 2, 'label': 'dxy'}\n",
"1 -> {'m': 1, 'l': 2, 'isite': 2, 'label': 'dyz'}\n",
"2 -> {'m': 2, 'l': 2, 'isite': 2, 'label': 'dz2'}\n",
"3 -> {'m': 3, 'l': 2, 'isite': 2, 'label': 'dxz'}\n",
"4 -> {'m': 4, 'l': 2, 'isite': 2, 'label': 'dx2-y2'}\n",
" Found POSCAR, title line: SrVO3\n",
" Total number of ions: 5\n",
" Number of types: 3\n",
" Number of ions for each type: [1, 1, 3]\n",
"\n",
" Total number of k-points: 729\n",
" Total number of tetrahedra: 4374\n",
"eigvals from LOCPROJ\n",
"\n",
" Spin: 1\n",
" Site: 2\n",
" Density matrix Overlap\n",
" 0.5878638 0.0015655 -0.0003729 0.0016028 -0.0000013 0.9294189 -0.0000079 -0.0000080 -0.0000079 0.0000001\n",
" 0.0015655 0.5878216 -0.0001853 -0.0015606 0.0003205 -0.0000079 0.9294189 -0.0000041 0.0000080 0.0000068\n",
" -0.0003729 -0.0001853 0.5820729 -0.0001876 0.0000001 -0.0000080 -0.0000041 0.9715784 -0.0000036 -0.0000002\n",
" 0.0016028 -0.0015606 -0.0001876 0.5878590 -0.0003219 -0.0000079 0.0000080 -0.0000036 0.9294189 -0.0000070\n",
" -0.0000013 0.0003205 0.0000001 -0.0003219 0.5820728 0.0000001 0.0000068 -0.0000002 -0.0000070 0.9715787\n",
"\n",
" Generating 1 shell...\n",
"\n",
" Shell : 1\n",
" Orbital l : 2\n",
" Number of ions: 1\n",
" Dimension : 3\n",
"Density matrix:\n",
" Site 1\n",
" 0.3333155 0.0021688 0.0022148\n",
" 0.0021688 0.3332635 -0.0021629\n",
" 0.0022148 -0.0021629 0.3333096\n",
" trace: 0.999888560089083\n",
"\n",
" Impurity density: 0.999888560089083\n",
"\n",
"Overlap:\n",
" Site 1\n",
"[[ 1. 0. -0.]\n",
" [ 0. 1. 0.]\n",
" [-0. 0. 1.]]\n",
"\n",
"Local Hamiltonian:\n",
" Site 1\n",
" 0.5635031 0.0007530 0.0007528\n",
" 0.0007530 0.5635034 -0.0007530\n",
" 0.0007528 -0.0007530 0.5635032\n",
"\n",
"Evaluating DOS...\n",
" Total number of states: [[[1.99711439 1.99526935 1.99688248]]]\n",
" Storing ctrl-file...\n",
" Storing PLO-group file 'vasp.pg1'...\n",
" Density within window: 0.9999735861893001\n"
]
}
],
"source": [
"# Generate and store PLOs\n",
"plo_converter.generate_and_output_as_text('plo.cfg', vasp_dir='./')"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Reading input from vasp.ctrl...\n",
"{\n",
" \"ngroups\": 1,\n",
" \"nk\": 729,\n",
" \"ns\": 1,\n",
" \"nc_flag\": 0\n",
"}\n",
"\n",
" No. of inequivalent shells: 1\n"
]
}
],
"source": [
"# create Converter\n",
"Converter = VaspConverter(filename = 'vasp')\n",
"# run the converter\n",
"Converter.convert_dft_input()"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
"sk = SumkDFTTools(hdf_file='vasp.h5')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"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.15+"
}
},
"nbformat": 4,
"nbformat_minor": 2
}