pyfplo.fedit¶
The fplo editor fedit has a pipe mode, which is documented elsewhere.
Read the documentation in fedit help screens and in the fplo manual
(FPLO..../DOC/MANUAL/doc.pdf).
This module allows to use fedit pipe mode from python scripts.
It is recommended that this class is used to manipulate =.in files.
The low level classes in module pyfplo.fploio can be used as well, but do not
ensure data consistency. E.g. one can set relativistic.type to a certain
number (if one knows, which one) but the corresponding relativistic.descriptor
would not be set automatically. Consequently the resulting =.in file
would be correct from fplo point of view but a human will be mislead when
perusing the file.
Checkout the examples delivered with fplo.
Functions¶
-
fploExecutable(suffix='')¶ Parameters: suffix (str) – for convenience, suffix is appended to the exec name Return the name of the fplo executable as
str, which fits the pyfplo version. This is an educated guess. There is no garantee that it is correct. If you compiled with a non-default build branch, this function does not return the name including the build branch suffix but just the generic name. Use suffix to select the correct executable or just write it out explicitely anyway.
Fedit¶
-
class
Fedit(recreate=False)¶ Use this class as an interface for fedit pipe mode. There are general routines and specialized routines for a lot of possible input. Altogether arbitrary input can be created. To find out valid search strings or hotkeys consult fedit itself.
recreate: please consult
resetPipeInput.Most routines take keyword arguments. One only needs to specify the keyword explicitely if a selected subset of the arguments is used. Not all arguments need be given. If all are used the keywords can be left out (however the order of arguments does).
Many options are
bool-like. In these cases the possible values areTrue,1,'t','+'orFalse,0,'f','-'.Arguments like defs in
lsdaucan be either a list of items, whose syntax is explained in each functions documentation, or an empty list[], which basically resets defs to an empty list. In other words there are no explicit counters for lists-like input. The number of list items in defs and the like is the counter. Have a look at the fedit LSDA+U submenu. There you have under CORRELATED STATES the item “(N)umber of definitions :” followed by the list of Wyckoff positions, states and F0…. To set this counter to zero usedefs=[]. If recreate orresetPipeInput(recreate=True)is used properly this is however rarely needed.Illustrative example:
import pyfplo.fedit as fedit fed=fedit.Fedit(recreate=True) # if `True`, reset to default input # (except symmetry) fed.relativistic('s') # set to scalar relativisitc # or fed.relativistic('scal') # is the same # or using the full explicit hotkey sequence # note that the individual hotkey-value pairs are separated by newline # (\n) fed.addToPipeInput('@r@\n!scal!\n@x@') # which is short for fed.addToPipeInput('@r@') # enter relativistic submenu fed.addToPipeInput('!scal!') # use search string fed.addToPipeInput('@x@') # leave submenu fed.pipeFedit(prot=True) # do the actual piping and show details
The simplest (old-style) way to create input is the following:
import pyfplo.fedit as fedit fed=fed.Fedit() fed.pipeFedit(''' # reset to default @ e@ # vxc @v@ !96! @x@ #k-mesh @k@ 16,, #done @q@ ''',prot=False)
or with variable options:
import pyfplo.fedit as fedit fed=fed.Fedit() fed.pipeFedit(''' # reset to default @ e@ # vxc @v@ !{1}! @x@ #k-mesh @k@ {0},, #done @q@ '''.format(16,'Zunger'),prot=False)
-
resetPipeInput(recreate=False)¶ Reset all pipe input. If recreate is
Truethe default-input- creation flag is set, which triggers non-symmetry input to become default after symmetry input. This way we start from a default input, which avoids a buildup of unwanted input from former manipulations.
-
addToPipeInput(txt)¶ Add any hotkey sequence to the fedit pipe input. This routine can be used for arbitrary sequences and in fact is underlying all the specialized routines. Example:
# All in one go. (Note the use of newline \n) fed.addToPipeInput('@r@\n!scal!\n@x@') # which is short for fed.addToPipeInput('@r@') # enter relativistic submenu fed.addToPipeInput('!scal!') # use search string fed.addToPipeInput('@x@') # leave submenu
-
pipeFedit(text=None, prot=None)¶ Execute the pipe mode of fedit. Use text if not
None. Note that text must end in @q@ for success. If text isNone, use the internal pipeinput collected so far. If prot isTrue, show verbose output about what is going on internally. See examples inFedit.
-
symmetry(compound=None, units=None, type=None, latcon=None, angles=None, atoms=None, spacegroup=None, setting=None, globalaxes=None, generators=None)¶ This function (like most) can be called with different key words, also sequentially, as in:
fed.symmetry(latcon=[4,5,6]) fed.symmetry(spacegroup=221)
or in a single call:
fed.symmetry(latcon=[4,5,6], spacegroup=221)
units can be a search string or a hotkey.
type (structure type) can be a search string or a hotkey.
spacegroup (
intorstr) is the group numbersetting (
str) is the setting. Consult fedit itself for proper values.Example:
fed.symmetry(spacegroup='74',setting='a-cb')
latcon can be missing or a list or string containing 3 lattice constants.
angles can be missing or a list or string of 3 axis angles.
atoms can be
[[element,position],...]whereelement(str) is the elementposition(listorstr) is a list or a string of the positions x,y,z coordinates. The comma repeater can be used. in the same way as in fedit itself.Example:
fed.symmetry(atoms=[['Sm' ,['0.123','3/4',',']]] #or fed.symmetry(atoms=[['Sm' ,[0.123,3./4,',']]] #or fed.symmetry(atoms=[['Sm' ,'0.123 3/4,']]]
Note that in python 3/4 equals 0 (integer arythmetic) while 3./4=0.75.
globalaxes can be
[active,xaxis,zaxis]whereactive(bool-like) says, if the axes are active.xaxisandzaxis(listorstr) are a list or string of 3 numbers.Example:
fed.symmetry(globalaxes=[True,[1,1,0],[-1,1,2]]) # or fed.symmetry(globalaxes=[1,"1 1 0","-1 1 2"])
generators (
list) is a list or string ofintand represents the list of valid subgroup generators. Use the fedit symmetry-information submenu in the symmetry menu to find out the desired numbers.
-
options(oplist=None)¶ oplist can be
[[OPTION,True_or_False],...]or simply[OPTION,True_or_False]for a single option, whereOPTIONis one of fedits options-menus options.True_or_Falsecan also be0or1Examples:
fed.options([['FULLBZ',1],['CALC_DOS',False]]) # or fed.options(['FULLBZ',1]) fed.options(['CALC_DOS',False])
-
spin(spin=None, initialspinsplit=None, initialspin=None, fsm=None)¶ spin can be missing or
1or2.initialspinsplit can be missing or
TrueorFalseor equivalent values.initialspin can be
[[sort,spinmoment],...]wheresort(int) is a sort/Wyckoff postition number andspinmoment(float) is the initial spin momentfsm can be missing or a list:
[True_or_False,fsmmoment]Example:
fed.spin(initialspin=[[1,2],[2,0],[3,0]]) fed.spin(spin=2,initialspinsplit=True) fed.spin(fsm=[True,2.4])
-
xcoptions(cmBJ=None)¶ cmBJ can be
Noneor afloatExample:
fed.xcoptions(cmBJ=None) fed.xcoptions(cmBJ=1.1)
-
relativistic(mode=None, quantaxis=None)¶ mode can be a search string or a hotkey.
quantaxis (
listorstr): e.g.[1,1,0]or'1 1 0'Example:
fed.relativistic('scal') # or fed.relativistic('s') # set full relativisitc and quantization axis fed.relativistic('full',quantaxis=[1,1,0])
-
bzintegration(nxyz=[12, 12, 12], temperature=None, method=None, mpparam=None)¶ nxyz (
listorstr): a list or string with 3int.temperature (
floatorstr): temp for molecules.method (
str): can be a hotkey ('T'or'M') or a search string (e.g.'tet'or'pax'). Note that'meth'will select the tetrahedreon method because'meth'matches ‘method’mpparam: can be a list
[width,order](widthin Hartree)Example:
# nxyz is the first argument to bzintegration. Hence # we can leave out the keyword fed.bzintegration([ 6, 9, 12]) # or we do it explicitely and use strings fed.bzintegration(nxyz=' 6 9 12') # choose method fed.bzintegration(method='pax',mpparam=[0.005,1]) # or all together fed.bzintegration([ 6, 9, 12],method='pax',mpparam=[0.005,1])
-
optics(active=False, bounds=None, Ne=None, jointdos=None, stopafter=None)¶ active (
bool-like): is optics active?bounds: can be a list with the content
[lbound,ubound]wherelbound… arefloatNe (
intorstr): number of energy pointsjointdos (
bool-like): see fedit help screens.stopafter (
bool-like): obvious.Example:
fed.optics(True,bounds=[0,10],Ne=2000,stopafter=True)
-
charges(vca=None, charges=None)¶ vca: can be a list:
[active,Zlist]whereactiveisbool-likeZlistis[]or[[sort,Z],...]wheresort(int): is a Wyckoff position numberZ(floatorstr): is the nuclear chargecharges can be
[mode,ionicity]wheremode(str): is a search string ('none','jel','mol') or a hotkey (1,2,3)ionicity(floatorstr): is obviousExample:
fed.charges(vca=[True,[ [1,25.2], [2,27.9]] ])
-
vxc(version=None, xfactor=None)¶ version (
str): a hotkey or search string (e.g.'5'or'Ernzerhof 96')xfactor (
floatorstr): xc-field scalingExample:
fed.vxc(version=5)
-
verbosity(level=None)¶ level (
str): a hotkey or search string (e.g.'2'or'basic')Example:
fed.verbosity(level='basic')
-
ti(z2=None, homooffset=None, forcewanniercenters=None, integrationintervals=None, kyparamintervals=None)¶ z2 (
bool-like): switch on/off the calculation of Z2 invariants.homooffset (
int): The code will determine the likely highest occupied valence band (assuming a real gap exists). Then it calculates the invariants for a set of bands from -offset to +offset around this band.forcewanniercenters (
bool-like): the Wannier center algo will additionaly be executed for centro symmetric systems.integrationintervals (
int): The Wannier centers are functions of a paramter (ky-parameter), which are obtained by “integrating” along a second direction. Here you specify the number of integration intervals.kyparamintervals (
int): This determines the number of intervals along the ky-parameter axis.Example:
fed.ti(z2=True,homooffset=4,forcewanniercenters=False, integrationintervals=40,kyparamintervals=100)
-
finuc(mode=None)¶ Finite nucleus settings.
mode (
str): hotkey or search string (e.g.3or'linear')Example:
fed.finuc('linear')
-
opc(active=True, functional=None, defs=None)¶ Orbital polarization correction.
active (
bool-like): active or not?functional (
str): hotkey or search string (e.g.1or'spin dependend')defs (list): may be
[]or[[sort,state-label],...]wheresort(int) is a wyckoff position number andstate-label(str) is something like'3d'or'4f'Example:
fed.opc(True,'spin independend',[[3,'4f'],[7,'4f']])
-
bandplot(active=True, points=None, ksteps=None, weights=None, transaxis=None, xaxis=None, zaxis=None, bwdeffile=None, ldossites=None, interval=None, restrictbands=None, idos=None, ndos=None, coeff=None)¶ Bandplot options.
active (
bool-like): is bandplot active?weights (
bool-like): is bandweights active?points (
list): can be[]or[ [label,[kx,ky,kz]] , ... ]alternatively the point can be written[label,"kx ky kz"]kstep (
int): steps between sym-pointsbwdeffile (
str): file name for band weight definitions (=.bwdef)transaxis (
bool-like): transform axes?xaxis (
listorstr): xaxis for band weightszaxis (
listorstr): xaxis for band weightsldossites (
list): list of ldos sitesidos (
bool-like): plot idos?ndos (
bool-like): plot netdos?interval (
list): dos-energy interval:[ne,lbound,ubound]wherene(int) is the number of energy pointslbound(float) is the lower energy boundubound(float) is the upper energy boundcoeff (
bool-like): trigger output of+coeffrestrictbands (
bool-like): restrict bands to windowExample:
... # let's do it in two steps: general settings fed.bandplot(active=True,ldossites=[2,17], weights=True,transaxis=True,xaxis='1 1 0',zaxis=[-1,1,0], restrictbands=True, interval=[2000,-2,3]) # high symmetry points fed.bandplot(points=[ ['$~G',[0,0,0]], ['X',[1,0,0]], ['M',[1,1,0]], ])
-
lsdau(active=True, functional=None, projection=None, defs=None, tol=None, occumode=None)¶ LSDA+U settings.
active (
bool-like): is LSDA+U active?functional (
str): hotkey or search string (e.g.2or'atomic limit')projection (
str): hotkey or search string (e.g.4or'gross')tol (
float): the inner occu-matrix loop convergence toleranceoccumode (
str): hotkey or search string (e.g.2or'fixed')defs (
list): can be[]or[[sort,state-label,[f0,f2,f4,f6]],...]or[[sort,state-label,[],[U,J,F4oF2,F6oF2]],...]. The second option with an empty F-list is for convenience. The list elements aresort(int) is a sortstate-label(str) is e.g.'3d'or'4f'f0,f2,f4,f6(float) are obviousU,J,F4oF2,F6oF2(float) are U, J, F4/F2 and F6/F2. If not needed,J,F4oF2andF6oF2can be left out. Also, ifF4oF2and/orF6oF2are not given but needed, default values are used. If only U is given all Fi, i>0 are zero and hence J is zero:s: only U is needed
p: only U and J make sense
d: U, J and F4oF2 (default 5.5/8.5)
f: U, J, F4oF2 and F6oF2 (default 2./3 and 1./2)
Example:
# explicit F2,F4, two sorts fed.lsdau(True,functional='atomic',projection='gross', ,defs=[ [3,'3d',[8,9,5,0]], [5,'3d',[8,9,5,0]], ]) # implicit F2, F4, explicit U and J, two sorts fed.lsdau(True,functional='atomic',projection='gross', ,defs=[ [3,'3d',[],[8,1]], [5,'3d',[],[8,1]], ])
-
gridoutput(active=None, stopafter=None, defs=None)¶ Define the grid output settings.
active (
bool-like): do we want it?stopafter (
bool-like): obviousdefs (
list): can be[]or a list of dicts one for each grid definition, with the following structure:[{ # first grid definition 'basis': basis, 'dir1': list_or_str, 'dir2': list_or_str, 'dir3': list_or_str, 'origin':list_or_str, 'subdiv':list_or_str, 'includeperiodicpoints': True_or_False 'createopendx': True_or_False 'scfenergywindow': list_or_str_of_two_float 'quantities':quantdict, 'outputdata':outputdatadict, 'kresolved':kresolvedlist, 'eresolved':eresolvedlist}, { # second grid definition ...}, ... ]
where not all dict keys need to be present! The individual values are
list_or_str: a list or string of 3 numbers. In case of subdiv these must beint.basis(str):'prim'or'conv'or'cart'quantdict(dict):{quantityname:True|False,...}quantityname(str):'dens','pot','scf','coul','xc','ewald'outputdatadict(dict):{outputdataname:True|False,...}outputdataname(str):index,points,'total','spin','up','down','comp'kresolvedlist(list):[]or[kresdict,...]kresdict(dict):{'name':some_name,'point':list_or_str, 'bands': list_of_int,'ewindow': [lbound, uband]}eresolvedlist(list):[]or[eresdict,...]eresdict(dict):{'name':some_name,'defs': defslist}defslist(list):[[emin,emax,de,'up'|'do'|'bo'],...]Example:
fed.gridoutput(True,stopafter=True,defs=[ { 'basis':'prim','dir1':[1,1,0],'dir2':[-1,1,0],'dir3':'0 0 1', 'origin':[-0.5,-0.5,'2/3'],'subdiv':'10 20 30', 'quantities':{'pot':True,'dens':True}, 'outputdata':{'points':True,'total':True,'spin':True}, 'kresolved':[ {'name':'Gamma','point':[0,0,0],'ewindow':[-1.1,2.4]}, {'name':'X','point':[1,0,0],'bands':'23 24 25'} ], 'eresolved':[ {'name':'r1','defs':[[-7,9,0.01,'b']]}, {'name':'r2','defs':[[-1,1,0.01,'u']]}, {'name':'r2','defs':[[-1,1,0.01,'d']]}, ] } ])
-
coreoccupation(defs=None)¶ Define the core occupation. (Experimental option)
defs (
list):[]or[ [sort,state-label,[occ,occ,...],[occ,occ,...]] , ...]wheresort(int) is a sort numberstate-label(str) is e.g.'4f'end where the last two lists (for spin up and down) are the occupation numbers for the 2*l+1 orbitals. Normally the occus should all be the same per spin channel. One only gives as many occupation numbers as indicated by the shell degeneracy (2*l+1). Example:
fed.coreoccupation(defs=[ [2,'2p',[1,1,1],[0.2,0.2,0.2]] ])
A fancy example to avoid typing: we set all orbitals to
4/14in order to get a homogenous non-polarized 4f shell with 4 electrons. For illustration we also add some polarized example for p-states:fed.coreoccupation(defs=[ [2,'4f',['4/14']*7,['4/14']*7], [3,'3p',[1]*3,['2/5']*3], ])
-
dhvaiso(active=None, isovalue=None, subdiv=None, bisections=None, upbands=None, downbands=None, wanhamfile=None, deleteoldfiles=None, needbandweights=None, addweifile=None, shifts=None)¶ Settings for the iso-branch of the dHvA module.
active (
bool-like): activate the preparation active.isovalue (
floatorstr): obvioussubdiv (
listorstr): a list or string of 3int.bisections (
int): obviousupbands (
list):[]or a list or string of band numbersdownbands (
list):[]or a list or string of band numberswanhamfile (
str): a wannier hamiltonian file name (+hamdata).addweifile (
str): a=.addweitype filedeleteoldfiles (
bool-like): obviousneedbandweights (
bool-like): obviousshifts (
list):[]or[[weight-index,factor],...]Example:
fed.dhvaiso(active=True,isovalue=-0.1,subdiv='10,',bisections='4') # special shift input (see FPLO..../DOC/MANUAL/doc.pdf) fed.dhvaiso(shifts=[ [76,0.02], [77,-0.02] ])
-
dhva(fields=None, nangles=None, anglerange=None, nplanes=None, planerange=None, bands=None, areachainthreshold=None, orbitsearchoffset=None, orbitsampleportion=None, arearadiusfactor=None, smoothnessthreshold=None, outputoptions=None, debugoptions=None)¶ Settings for the dHvA-branch of the dHvA module.
fields (
list): can be[]or[[label,[bx,by,bz]],...]alternatively a field can be written as[label,"bx by bz"]nangles (
int): number of anglesanglerange (
list): can be[from,to], wherefromandtoareint.nplanes (
int): number of planesplanerange (
list): can be[from,to], wherefromandtoareintbands (
list): can be[bandnumbers,parts,spins]wherebandnumbers(listorstr) must be[]or a list or string ofintparts(listorstr) must be[]or a list or string ofintspins(str) must be'up'or'down'or'both'or shorter'u','d'or'b'areachainthreshold (
float): seeFPLO..../DOC/MANUAL/doc.pdforbitsearchoffset (
float): seeFPLO..../DOC/MANUAL/doc.pdforbitsampleportion (
float): seeFPLO..../DOC/MANUAL/doc.pdfarearadiusfactor (
float): seeFPLO..../DOC/MANUAL/doc.pdfsmoothnessthreshold (
float): seeFPLO..../DOC/MANUAL/doc.pdfoutputoptions (
list): can be[[OPTION,True|False],...]see fedit screens forOPTIONdebugoptions (
list): can be[[OPTION,True|False],...]see fedit screens forOPTIONExample:
#first we set the fields (note, we could do all of it in one call) fed.dhva(fields=[ ['[010]',[0 ,1 ,0]], ['[100]',[1 ,0 ,0]], ['[111]','1 1 1'] ]) # focus on particular bands, all parts and spins. fed.dhva(bands=[[52,53],[],'b']) # increase accuracy fed.dhva(nangles=50,nplanes=200,noewaldcor=True)
-
basis(version=None, extensionlevel=None, add3d=None, addf=None, core4f=None, core4fNoValenceF=None, multicore=None, multisemicore=None)¶ Here some standard basis settings can be defined. If you want to switch to an extended basis in a pre-existing
=.inuse:fed=fedit.Fedit(recreate=False) fed.basis(extensionlevel=2,add3d=True,addf=True) fed.pipeFedit(prot=True)
If you want to switch to an extended basis in a pre-existing
=.inand make sure that the rest of the basis is default use:fed=fedit.Fedit(recreate=False) fed.basis(extensionlevel=2,add3d=True,addf=True, multicore=[],multisemicore=[], core4f=[],core4fNoValenceF=[]) fed.pipeFedit(prot=True)
version (
intorstr): hotkey or search string of basis versionextensionlevel (
int): the level of extended basis,- default: extensionlevel=1,
- single->double, double->tripple …: extensionlevel=2
- double->tripple, tripple->quadruple …: extensionlevel=3
add3d (
bool-like): ifTrueadd 3d if no d-orbital in defautl basis. Applies to H and He.addf (
bool-like): ifTrueadd an f-orbtial if none exists in the valence section. If the semicore section contains a 4f-state a 5f-valence orbital is added. In other words this option only consideres the valence section.core4f (
listofstrand/orint): a list of element names and/or sort numbers for which to shift an existing valence 4f-orbital into the core. The list can be a mix of names and sorts. To delete existing core4f definitions use:core4f=[]
To leave this setting alone use:
core4f=None
core4fNoValenceF (
listofstrand/orint): a list of element names and/or sort numbers for which to shift an existing valence 4f-orbital into the core and remove remaining f-polarization orbitals from the valence section completely. The list can be a mix of names and sorts. To delete existing core4f definitions use:core4fNoValenceF=[]
To leave this setting alone use:
core4fNoValenceF=None
multicore (
list-like: [ [Q0,S0],[Q1,S1],…]): the length the list defines the multiplicity of all core orbitals. The individual list members need to belistsof twofloat, the first is the Q-parameter and the second the S-parameter. Example:multicore=[[0,0],[2,10]] # double core with Q[0]=0, S[0]=0, Q[1]=2, S[1]=10
To delete an existing multicore definition use:
multicore=[]
To leave this setting alone use:
multicore=None
multisemicore (
list-like: [ [Q0,S0],[Q1,S1],…]): the length the list defines the multiplicity of all semicore orbitals. The individual list members need to belistsof twofloat, the first is the Q-parameter and the second the S-parameter. Example:multisemicore=[[0,0],[2,10]] # double core with Q[0]=0, S[0]=0, Q[1]=2, S[1]=10
To delete an existing multisemicore definition use:
multisemicore=[]
To leave this setting alone use:
multisemicore=None
-
numerics(maxL=None, thci_nr=None, thci_angmin=None, thci_angmax=None, thci_use_symmetry=None)¶ A subset of numerics menu options.
maxL (
int): cutoff for angular momentum expansion in the potential.thci_nr (
int): number of radial mesh mesh points for three center integrals.thci_angmin (
int): smallest angular mesh type (for small radii) for three center integrals.thci_angmax (
int): largets angular mesh type (for large radii) for three center integrals.thci_use_symmetry (
bool-like): use only irreducible mesh.
-
iteration(n=30, acc=None, eacc=None, method=None, mixing=None, progress=None, subdim=None, occuratio=None, criterion=None)¶ n (
int): number of iterationsacc (
floatorstr): accuracy of densityeacc (
floatorstr): accuracy of etotmethod (
str): can be missing or a search string or a hotkey (e.g.'lciterat')mixing can be a
floatprogress can be a
floatsubdim (
intorstr): maximum subspace dimensionoccuratio (
floatorstr): occu-mat/density ratiocriterion (
str): hotkey (e.g.2for ‘density’). Note that the search strings are not very usefull here, due to their similarity (historical bad design).Example:
fed.iterations(n=100,method='lciterat',mixing=0.1)
-
forces(forcemode=None, n=None, acc=None, subdim=None, vary=None, noewaldcor=None, eachstep=None)¶ forcemode (
str): can be'no','opt','single'n (
int): number of force iterationsacc (
floatorstr): accuracy criterion in eV/Angsubdim (
intorstr): maximum subspace dimensionvary (list of
intor string ofint): a list/string of sorts/Wyckoff position numbers to be varied. Empty list means ‘vary all’.noewaldcor (
bool-like): disable the expensive (marginally more accurate) nonspherical Ewald correction for forces.eachstep (
bool-like): calculate forces in each step.Example:
fed.forces('opt',acc=1e-2,vary=[5,9])
-