Input file generation: Difference between revisions

From The Yambo Project
Jump to navigation Jump to search
No edit summary
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
In this tutorial you will learn how to generate and modify an input file with Yambo.
In this module you will learn how to generate and modify an input file with Yambo.


== Prerequisites ==
== Prerequisites ==
'''Previous modules'''
'''Previous modules'''
* Initialization for [[Bulk_material:_h-BN|bulk hBN]].
* Initialization for [[Bulk_material:_h-BN|bulk hBN]] or [[2D_material:_h-BN_sheet|2D hBN]]
Below you will find all the instructions for the '''bulk hBN''' case.


'''You will need''':
'''You will need''':
* The <code>SAVE</code> databases for bulk hBN ('''Download here''')
* The <code>SAVE</code> databases for bulk hBN
* The <code>yambo</code> executable
* The <code>yambo</code> executable


== Launch the input file generator ==
== Input file generator ==
First, move to the appropriate folder and initialize the Yambo databases if you haven't already done so.
$ cd YAMBO_TUTORIALS/hBN/YAMBO
$ yambo       


Yambo generates its own input files: you just tell the code what you want to calculate by launching Yambo along with one or more '''lowercase''' options.  
Yambo generates its own input files: you just tell the code what you want to calculate by launching Yambo along with one or more '''lowercase''' options.  
Line 33: Line 37:
  -l :GoWo Quasiparticle lifetimes
  -l :GoWo Quasiparticle lifetimes
  -a :ACFDT Total Energy
  -a :ACFDT Total Energy
Note that multiple options can be used together (in some cases this is actually a necessity). For instance:
yambo -o c -k hartree      Calculate optical spectra including local field effects (Hartree approximation)
yambo -x -g n -p p            Perform a Hartree-Fock and GW calculation using a plasmon-pole approximation


After launching Yambo with a lowercase option, Yambo will generate an appropriate input file (default name: <code>yambo.in</code>) and launch the <code>vi</code> editor. (Editor choice can be changed at configure; alternatively you can use the <code>-Q</code> run time option).  
Any time you launch Yambo with a lowercase option, Yambo will generate the appropriate input file (default name: ''yambo.in'') and launch the <code>vi</code> editor.  


== Choosing input parameters ==
Editor choice can be changed at configure; alternatively you can use the <code>-Q</code> run time option to skip the automatic editing (do this if you are not familiar with <code>vi</code>!):
Yambo will also read various parameters from existing database files and/or input files and use them to suggest values or ranges.  
$ yambo -x -Q
Let's illustrate this by calculating the static screening for bulk hBN.
yambo: input file yambo.in created
cd YAMBO_TUTORIALS/hBN/YAMBO
$ emacs yambo.in    ''or your favourite editing tool''
yambo        ''(initialize, if you haven't already done so)''
 
  yambo -b
==Combining options==
and look at the generated input file. Inside you will see a suggested range of bands, which Yambo guesses from the core <code>ns.db1</code> database.
Multiple options can be used together to activate various tasks or runlevels (in some cases this is actually a necessity).
  % BndsRnXd
For instance, to generate an input file for optical spectra including local field effects (Hartree approximation), do (and then exit)
    1 | 100 |                 # [Xd] Polarization function bands
$ yambo -o c -k hartree      ''which switches on:''
optics                      # [R OPT] Optics
chi                          # [R CHI] Dyson equation for Chi.
Chimod= "Hartree"            # [X] IP/Hartree/ALDA/LRC/BSfxc
To perform a Hartree-Fock and GW calculation using a plasmon-pole approximation, do (and then exit):
$ yambo -x -g n -p p        ''which switches on:''
HF_and_locXC                # [R XX] Hartree-Fock Self-energy and Vxc
gw0                          # [R GW] GoWo Quasiparticle energy levels
ppa                          # [R Xp] Plasmon Pole Approximation
em1d                        # [R Xd] Dynamical Inverse Dielectric Matrix     
Each runlevel activates its own list of variables and flags.
 
==Changing input parameters ==
Yambo reads various parameters from existing database files and/or input files and uses them to suggest values or ranges.  
Let's illustrate this by generating the input file for a Hartree-Fock calculation.  
 
  $ yambo -x
Inside the generated input file you should find:
[[Variables#EXXRLvcs|EXXRLvcs]] =  3187        RL    # [XX] Exchange RL components
  %[[Variables#QPkrange|QPkrange]]                    # [GW] QP generalized Kpoint/Band indices
  1| 14|  1|100|
  %
  %
Change these values to <code> 8 |  9  | </code>, save and exit the editor. Now launch the input file generator again:
The <code>QPkrange</code> variable (follow the link for a detailed explanation) suggests a range of k-points (1 to 14) and bands (1 to 100) based on what it finds in the core database ''SAVE/ns.db1'', i.e. as defined by the DFT code. Leave that variable alone, and instead modify the previous variable to <code>EXXRLvcs=  1000        RL</code>
yambo -b
 
and notice that your chosen values remain: they are simply read from the <code>yambo.in</code> file. Now run the calculation:
Save the file, and now generate the input a second time with <code>yambo -x</code>. You will see:
yambo
  EXXRLvcs= 1009        RL
After a few seconds, the code finishes. If you now look inside the SAVE folder, you will see several new databases:
This indicates that Yambo has read the new input value (1000 G-vectors), checked the database of G-vector shells ''(SAVE/ndb.gops)'',
  $ ls SAVE
and changed the input value to one that fits a completely closed shell.
ns.db1 ns.wf '''ndb.dip_iR_and_P''' '''ndb.em1s''' ns.gops ns.kindx [...]
 
Delete the input file <code>yambo.in</code>, and generate the input file for a different task: optical response in the independent particle approximation.
Last, note that Yambo variables can be expressed in different '''units'''. In this case, <code>RL</code> can be replaced by an energy unit like Ry, eV, Ha, etc. Energy units are generally better as they are independent of the cell size. Technical information is available on the [[Variables]] page.  
$ rm yambo.in
 
$ yambo -o c
The input file generator of Yambo is thus an ''intelligent'' parser, which interacts with the user and the existing databases. For this reason we recommend that you always use Yambo to generate the input files, rather than making them yourself.
Looking inside the input file you will find:
% BndsRnXd
  8 |  9 |                  # [Xd] Polarization function bands
%
Here, Yambo has read from the <code>ndb.dip_iR_and_P</code> database and suggests to use the previous values. If at this stage, you decide to change these values (increase the range), Yambo will ''recompute'' the relevant database.


== Links ==
<br>
* [[Command_line_options|Command line options]]
{| style="width:100%" border="1"
* [[Tutorials|Back to tutorials menu]]
|style="width:15%; text-align:left"|Prev: [[Initialization|Initialization]]
|style="width:70%; text-align:center"|Now: [[Tutorials|Tutorials Home]] --> [[First_steps:_a_walk_through_from_DFT_to_optical_properties|First steps]] --> [[Bulk_material:_h-BN|bulk hBN]] / [[2D_material:_h-BN_sheet|2D hBN]] --> [[Input_file_generation|Input file]]
|style="width:15%; text-align:right"|Next: [[Command_line_options|Command line options]]
|-
|}

Latest revision as of 10:14, 21 April 2017

In this module you will learn how to generate and modify an input file with Yambo.

Prerequisites

Previous modules

Below you will find all the instructions for the bulk hBN case.

You will need:

  • The SAVE databases for bulk hBN
  • The yambo executable

Input file generator

First, move to the appropriate folder and initialize the Yambo databases if you haven't already done so.

$ cd YAMBO_TUTORIALS/hBN/YAMBO
$ yambo        

Yambo generates its own input files: you just tell the code what you want to calculate by launching Yambo along with one or more lowercase options. (Uppercase options are considered in the following section).

To see the list of runlevels and options, run yambo -h or better,

$ yambo -H
Tool: yambo 4.1.2 rev.14024
Description: A shiny pot of fun and happiness [C.D.Hogan] 
[Upper case options]
-i		:Initialization
-o <opt>	:Optics [opt=(c)hi is (G)-space / (b)se is (eh)-space ]
-k <opt>	:Kernel [opt=hartree/alda/lrc/hf/sex] 
-y <opt>	:BSE solver [opt=h/d/(p/f)i]  
                (h)aydock/(d)iagonalization/(i)nversion
-r		:Coulomb potential
-x		:Hartree-Fock Self-energy and local XC
-d		:Dynamical Inverse Dielectric Matrix
-b		:Static Inverse Dielectric Matrix
-p <opt>	:GW approximations [opt=(p)PA/(c)HOSEX]
-g <opt>	:Dyson Equation solver
                [opt=(n)ewton/(s)ecant/(g)reen]
-l		:GoWo Quasiparticle lifetimes
-a		:ACFDT Total Energy

Any time you launch Yambo with a lowercase option, Yambo will generate the appropriate input file (default name: yambo.in) and launch the vi editor.

Editor choice can be changed at configure; alternatively you can use the -Q run time option to skip the automatic editing (do this if you are not familiar with vi!):

$ yambo -x -Q
yambo: input file yambo.in created
$ emacs yambo.in     or your favourite editing tool

Combining options

Multiple options can be used together to activate various tasks or runlevels (in some cases this is actually a necessity). For instance, to generate an input file for optical spectra including local field effects (Hartree approximation), do (and then exit)

$ yambo -o c -k hartree       which switches on:
optics                       # [R OPT] Optics
chi                          # [R CHI] Dyson equation for Chi.
Chimod= "Hartree"            # [X] IP/Hartree/ALDA/LRC/BSfxc

To perform a Hartree-Fock and GW calculation using a plasmon-pole approximation, do (and then exit):

$ yambo -x -g n -p p        which switches on:
HF_and_locXC                 # [R XX] Hartree-Fock Self-energy and Vxc
gw0                          # [R GW] GoWo Quasiparticle energy levels
ppa                          # [R Xp] Plasmon Pole Approximation
em1d                         # [R Xd] Dynamical Inverse Dielectric Matrix      

Each runlevel activates its own list of variables and flags.

Changing input parameters

Yambo reads various parameters from existing database files and/or input files and uses them to suggest values or ranges. Let's illustrate this by generating the input file for a Hartree-Fock calculation.

$ yambo -x

Inside the generated input file you should find:

EXXRLvcs =  3187        RL    # [XX] Exchange RL components
%QPkrange                    # [GW] QP generalized Kpoint/Band indices
  1| 14|  1|100|
%

The QPkrange variable (follow the link for a detailed explanation) suggests a range of k-points (1 to 14) and bands (1 to 100) based on what it finds in the core database SAVE/ns.db1, i.e. as defined by the DFT code. Leave that variable alone, and instead modify the previous variable to EXXRLvcs= 1000 RL

Save the file, and now generate the input a second time with yambo -x. You will see:

 EXXRLvcs=  1009        RL

This indicates that Yambo has read the new input value (1000 G-vectors), checked the database of G-vector shells (SAVE/ndb.gops), and changed the input value to one that fits a completely closed shell.

Last, note that Yambo variables can be expressed in different units. In this case, RL can be replaced by an energy unit like Ry, eV, Ha, etc. Energy units are generally better as they are independent of the cell size. Technical information is available on the Variables page.

The input file generator of Yambo is thus an intelligent parser, which interacts with the user and the existing databases. For this reason we recommend that you always use Yambo to generate the input files, rather than making them yourself.


Prev: Initialization Now: Tutorials Home --> First steps --> bulk hBN / 2D hBN --> Input file Next: Command line options