{ "metadata": { "name": "", "signature": "sha256:763b5223d6a689587275882b32094dffc6fc7d232f9e04bdc5bf7a1b929ca2d3" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "code", "collapsed": false, "input": [ "%%javascript \n", "IPython.load_extensions(\"calico-spell-check\"); " ], "language": "python", "metadata": {}, "outputs": [ { "javascript": [ "IPython.load_extensions(\"calico-spell-check\"); " ], "metadata": {}, "output_type": "display_data", "text": [ "" ] } ], "prompt_number": 8 }, { "cell_type": "markdown", "metadata": {}, "source": [ "#Occupation matrix control (OMC)\n", "To use [OMC](http://chemistry.tcd.ie/staff/people/gww/gw_new/research/methodology/) first you need to compile VASP with OMC support. On CEE cluster it is already supported.\n", "\n", "OMC patch allows to set the occupation matrices by hand, which is useful when you want to obtain specific polaron localization. By trying several localizations you can find the one corresponding to the minimum of energy.\n", "\n", "Let us consider one case, where OMC helps. As an example we will study Li diffusion in FePO$_4$ lattice using NEB DFT+U method.\n", "To get the initial structure from materialsproject.org just run:" ] }, { "cell_type": "code", "collapsed": false, "input": [ "add_loop('FePO4.pnma2','1u', 1, input_geo_format = 'mat_proj', it_folder = 'LiFePO4', mat_proj_id = 'mp-25001')" ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now you have FePO$_4$ supercell with 24 atoms. To make a NEB calculation use:" ] }, { "cell_type": "code", "collapsed": false, "input": [ "add_neb(calc['FePO4.pnma2', '1u', 1], atom_to_insert = 'Li', i_void_start = 1, i_void_final = 2, r_impurity = 1.6 )" ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "-" } }, "source": [ "This will make several actions:\n", " - Search for voids with radius less than 1.6 $\\unicode{x212B}$\n", " - Creates two configurations: start and final by inserting Li atom (see NEB Tutorial???)\n", " - Creates new calculation 'FePO4.pnma2v1.n3i1e2Lims'and copies all necessary files to server\n", " \n", "After the calculation is finished you can run:" ] }, { "cell_type": "code", "collapsed": false, "input": [ "res_loop('FePO4.pnma2v1.n3i1e2Lims', '1u', [1,2,3,4,5], show = 'mep')" ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "[](figs/mep.FePO4.pnma2.n3i1e2Lims.1u_my.png)\n", "" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The barrier is overestimated. To fix this you can start U-ramping method by choosing '1ur30' set:" ] }, { "cell_type": "code", "collapsed": false, "input": [ "add_neb(calc['FePO4.pnma2', '1u', 1], ise_new = '1ur30',\n", " atom_to_insert = 'Li', i_void_start = 1, i_void_final = 2, r_impurity = 1.6,\n", " images = 7, corenum = 14)" ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "where we also have chosen seven images to obtain more detailed path." ] }, { "cell_type": "code", "collapsed": false, "input": [ "res_loop('FePO4.pnma2v1.n7i1e2Lims',[u'1ur30'], verlist = range(10), show = 'mep' ) " ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now the MEP agrees with literature [Nakayama2011](http://pubs.acs.org/doi/abs/10.1021/cm201604g). What is the reason for \n", "difference? It is in occupation matrix. You can compare them for saddle point (versions 4 and 6) like this:" ] }, { "cell_type": "code", "collapsed": false, "input": [ "res_loop('FePO4.pnma2v1.n3i1e2Lims', '1u', [4], show = 'occ')\n", "res_loop('FePO4.pnma2v1.n7i1e2Lims', '1ur30', [6], show = 'occ' ) \n" ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Pay attention to these strings first: \n", "** -- Distances (A) from alkali ion # 25 to transition atoms: 25<->23: 3.00, 25<->21: 3.07** \n", "** -- Distances (A) from alkali ion # 25 to transition atoms: 25<->21: 2.68, 25<->23: 3.39** \n", "You can see that Li ion (#25) in the '1ur30' case is much closer to Fe (#21) atom than in '1u' case. Even the closest atoms are different. To be sure that you compare matrices on the same atoms (#21) run:" ] }, { "cell_type": "code", "collapsed": false, "input": [ "res_loop('FePO4.pnma2v1.n3i1e2Lims', '1u', [4], show = 'occ21')\n", "res_loop('FePO4.pnma2v1.n7i1e2Lims', '1ur30', [6], show = 'occ21' ) " ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [ "-- Spin 2:\n", " 1u:\n", " +---+-------+-------+-------+-------+-------+ \n", " | | dxy | dyz | dz2 | dxz |dx2-y2 | \n", " +---+-------+-------+-------+-------+-------+ \n", " | 5 | 0.18 | 0.05 | 0.05 | -0.01 | -0.05 | \n", " | 6 | 0.05 | 0.17 | -0.01 | -0.04 | -0.04 | \n", " | 7 | 0.05 | -0.01 | 0.14 | 0.05 | 0.07 | \n", " | 8 | -0.01 | -0.04 | 0.05 | 0.15 | -0.08 | \n", " | 9 | -0.05 | -0.04 | 0.07 | -0.08 | 0.16 | \n", " +---+-------+-------+-------+-------+-------+ \n", " 1u30: \n", " +---+-------+-------+-------+-------+-------+ \n", " | 5 | 0.04 | 0.02 | -0 | -0 | -0 | \n", " | 6 | 0.02 | 0.06 | -0 | 0 | -0 | \n", " | 7 | -0 | -0 | 0.21 | 0.22 | 0.28 | \n", " | 8 | -0 | 0 | 0.22 | 0.37 | 0.31 | \n", " | 9 | -0 | -0 | 0.28 | 0.31 | 0.5 | \n", " +---+-------+-------+-------+-------+-------+ \n" ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can see that the matrices for spin down are quite different. The U-ramping method found more favourable polaron localization with more pronounced dz2, dxz, and dx2-y2 components.\n", "\n", "\n", "Here we come to the point where OMC can be useful. The U-ramping method can be computationally very costly since you may need to make up 30-40 runs gradually increasing U (by 0.1 V). However, once you obtained your correct occupation matrix you can use it for other calculations. For example we can run:" ] }, { "cell_type": "code", "collapsed": false, "input": [ "add_loop('FePO4.pnma2v1.n3i1e2Lims','1u', 4, \n", " inherit_option = 'occ', \n", " id_from = ('FePO4.pnma2v1.n7i1e2Lims', '1ur30', 1),\n", " ise_new = '1uos')" ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This command will create new calculation 'FePO4.pnma2v1.n3i1e2Lims.ifo.1uos.4' which will use occupation matrix from *id_from* during relaxation and after which will make a static run without OMC.\n", "\n", "By this you can obtain correct groundstate without using U-ramping. \n", "Comment: '1uos' set is based on '1u' and contains two additional parameters: OCCEXT = 1 and sequence_set = ['0u'] (See Inputset tutorial???)" ] }, { "cell_type": "code", "collapsed": false, "input": [ "Another option, just use params['occmatrix']" ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [ "add_loop('some_it','1u', 1, params = {'occmatrix':'path_to_file'}" ], "language": "python", "metadata": {}, "outputs": [] } ], "metadata": {} } ] }