\(\newcommand{\AA}{\text{Å}}\)
CRYSTALpytools.base.propd3 module
The Properties_inputBASE
object is strictly structured by ‘blocks’, which, in general, is defined as keywords that are closed by ‘END’. It is inherited from the BlockBASE object and is inherited by the Properties_input object. All the blocks are organized in layers and each corresponds to a list of keywords that can be called and set. The current structure of Properties_inputBASE
is listed below:
Layer 1: Optional, repeated block (same calculation, another time) append1
to append5
Layer 2: Data grid and DFT/MP2 correlation energy ECHG
, POTM
, CLAS
, EDFT/ENECOR
, ADFT/ACOR
For the usages of BlockBASE and Properties_input objects, please refer to the corresponding documentations.
Examples
Note that methods listed below are for Properties_input objects, which is typically consistent with Properties_inputBASE
, except file read and write functions.
To set a band structure and a projected doss calculation:
>>> obj = Properties_input()
>>> obj.band('Band calc title', 3, 6, 188, 203, 224, 1, 0,
[[[0, 0, 0], [3, 0, 0]], # A 3*2*3 list, for 3 line segments, 2 ending points of each segment, xyz for each point
[[3, 0, 0], [2, 2, 0]],
[[2, 2, 0], [0, 0, 0]]])
>>> obj.newk(8, 16, 1, 0)
>>> obj.doss(1, 600, 203, 224, 1, 12, 0, [[-1, 57], [-1, 64]]) # Project to atom 54 and atom 64
By calling the ‘block-like’ attribute, a sub-block object will be automatically generated if no such object is saved in the upper block object. It also be initialized and deleted in a similar way as keyword commands.
>>> obj = Properties_input()
>>> obj.echg() # Initialize ECHG
>>> obj.echg(None) # Remove ECHG
>>> obj.echg(0, 95) # Charge density map, Npoint of MAPNET is 95 (default value 100)
To set the values of keywords, their names are called as methods:
>>> obj.echg.coordina([-2.498, 0., 1.696], [-2.498, 0., -1.696], [-1.249, -2.164, -1.696])
>>> obj.echg.rectangu() # Print RECTANGU keyword, without value
>>> obj.echg.margins(3, 3, 3, 3)
Though one can set CRYSTAL input object by manually setting up all the attributes, it is also possible to read a template d3 file and do modifications.
>>> obj = Properties_input('charge2d.d3')
>>> obj.echg(None) # Remove ECHG block
>>> obj.ech3(100) # Define ECH3 block
>>> obj.ech3.range(-10, 10) # Range of Non-periodic direction
>>> obj.to_file('charge3d.d3') # Print it into file
It is also possible to set individual blocks by a string. This is achieved by simply assigning the string variable as input when calling the corresponding method.
>>> obj.ech3('ECH3\n100\nRANGE\n-10\n10\n')
As stressed in the doc of base.inputbase, repeated keywords not protected by sub-blocks are not permitted. That leads to problems when, for example, plotting the charge difference map to analyze bonds, where ‘ECHG’ is repeated twice in the main block. To address this, the following sub-block is called when the second ‘ECHG’ is used:
>>> obj = Properties_input()
>>> obj.echg(0) # Set the first ECHG. MAPNET density = 100, default value is used.
>>> obj.echg.coordina([-2.498, 0., 1.696], [-2.498, 0., -1.696], [-1.249, -2.164, -1.696])
>>> obj.echg.rectangu()
>>> obj.echg.margins(3, 3, 3, 3)
>>> obj.append1() # Initialize the first appended calculation
>>> obj.append1.pato(1, 0)
>>> obj.append1.echg(0) # Set the second ECHG. MAPNET density = 100, default value is used.
>>> obj.append1.echg.coordina([-2.498, 0., 1.696], [-2.498, 0., -1.696], [-1.249, -2.164, -1.696])
>>> obj.append1.echg.rectangu()
>>> obj.append1.echg.margins(3, 3, 3, 3)
5 appended calculations (append1
to append5
) at most can be added and the Properties_input
object is the initial calculation, so the same keyword, which is not protected by subblocks, can repeat 6 times at most. Error is reported if it appears more than 6 times.
To examine the data in a block object, including the Properties_input obj itself, call the data
attribute.
>>> print(obj.data)
Classes and methods of keywords used in ‘properties’ input file (d3).
- class PInputBlock
Bases:
BlockBASE
The base class of a ‘property input block’, i.e., a properties calculation, with non-repeated keywords.
- rdfmwf(rdfmwf='')
- band(TITLE='', NLINE='', ISS='', NSUB='', INZB='', IFNB='', IPLO='', LPR66='', path=[])
path
can either be a NLINE*2 list of string (labels), or a NLINE*2*3 list of int (fractional coordinates).
- anbd(NK='', NB='', TOL='', *args)
- bwidth(INZB='', IFNB='')
- commens(ICASO='')
- pato(IBN='', NPR='')
- nosymada(nosymada='')
- newk(*args)
Inputs are separated by comma.
- pban(NB='', nbands=[])
- pgeomw(pgeomw='')
- pdide(EMI='', EMX='')
- property adft
Subblock object ADFT.
- property acor
Alias of block ADFT.
- property edft
Subblock object EDFT.
- property enecor
Alias of block EDFT.
- property clas
Subblock object CLAS. Call
self.clas()
to set parameters. Callself.clas.coordina()
(for example) to set mapnet keywords.- Parameters:
IDER (int) – Order of the derivative
IFOR (int) – Number of point multipoles
charge (list) – Formal net charge
NPY (int) – Number of points (MAPNET). Default 100.
- property echg
Subblock object ECHG. Call
self.echg()
to set parameters. Callself.echg.coordina()
(for example) to set mapnet keywords.- Parameters:
IDER (int) – Order of the derivative
NPY (int) – Number of points (MAPNET). Default 100.
- property ech3
Subblock object ECH3. Call
self.ech3()
to set parameters. Callself.ech3.range()
(for example) to set 3D grid keywords.- Parameters:
NP (int) – Number of points along the first direction
- property potm
Subblock object POTM. Call
self.potm()
to set parameters. Callself.potm.coordina()
(for example) to set mapnet keywords.- Parameters:
IDER (int) – Order of the derivative
ITOL (int) – Penetration tolerance
NPY (int) – Number of points (MAPNET). Default 100.
- property pot3
Subblock object POT3. Call
self.pot3()
to set parameters. Callself.pot3.range()
(for example) to set 3D grid keywords.- Parameters:
NP (int) – Number of points along the first direction
ITOL (int) – Penetration tolerance
- potc(ICA='', NPU='', IPA='', datagrid=[])
datagrid
corresponds to X, Y, Z, ZP, ZM and ZD parameters, which can be NPU*3 (ICA=0
), 2*1 (ICA=1
) or 3*1 (ICA=2
) lists.
- hirshchg(hchg='')
- ppan(pchg='')
- emdldm(N='', PMAX='', STEP='', IPLO='', hkl=[], ICASO='', NSA1='', NSA2='')
hkl
is a N*3 list of int.
- kinetemd(PMAX='', PINT='', STEP='', STEPDIST='', ICASO='')
- poli(IDIPO='', ITENS='', LPR68='')
- polspin(IDIPO='', ITENS='', LPR68='')
- anisotro(keyword='', N='', IA='')
Available keywords: ‘ALL’, ‘UNIQUE’, ‘SELECT’
- isotropic(keyword='', N='', IA='')
Available keywords: ‘ALL’, ‘UNIQUE’, ‘SELECT’
- doss(NPRO='', NPT='', INZB='', IFNB='', IPLO='', NPOL='', NPR='', *args)
Energy range (BMI, BMA, 2*1 list) and projections (N, NDM, Nproj*(NDM+1) list) are defined by extendable list variables. If both are defined, projections should be the last entry.
- coop(NINT='', NPT='', INZB='', IFNB='', IPLO='', NPOL='', NPR='', *args)
Energy range (BMI, BMA, 2*1 list) and projections (N, NDM, Nproj*(NDM+1) list) are defined by extendable list variables. If both are defined, projections should be the last entry.
- cohp(NINT='', NPT='', INZB='', IFNB='', IPLO='', NPOL='', NPR='', *args)
Energy range (BMI, BMA, 2*1 list) and projections (N, NDM, Nproj*(NDM+1) list) are defined by extendable list variables. If both are defined, projections should be the last entry.
- pscf(pscf='')
- static _doss_like(NPRO, NPT, INZB, IFNB, IPLO, NPOL, NPR, arg)
Get formatted input text for ‘DOSS’-like keywords, including ‘DOSS’, ‘COHP’ and ‘COOP’.
- class Properties_inputBASE
Bases:
PInputBlock
The base class of Properties_input class. At maximum 5 same ‘properties’ calculations can be appended
- property append1
- property append2
- property append3
- property append4
- property append5
- analyze_text(data)
Analyze formatted d3 file.
- Parameters:
data (str) – Formatted string.
- class EDFT
Bases:
BlockBASE
EDFT sub-block
- becke(becke='')
- savin(savin='')
- radial(NR='', RL=[], IL=[])
- angular(NI='', AL=[], IA=[])
- print(prt='')
- printout(prt='')
- tolldens(ID='')
- tollgrid(IG='')
- class Grid2D(header='')
Bases:
BlockBASE
A base class for 2D data grid (ECHG, POTM, CLAS).
- Parameters:
header (str) – Formatted headers
- coordina(crda='', crdb='', crdc='')
- atoms(IA='', IB='', IC='')
IA IB IC are 4*1 lists
- rectangu(rec='')
- margins(ABM='', CDM='', ADM='', BCM='')
- print(prt='')
- angstrom(ang='')
- bohr(br='')
- fraction(frac='')
- class ECHG(header='')
Bases:
Grid2D
Class for ECHG. Initialization can be done by formatted string only. Otherwise call this object from upper block.
- Parameters:
IDER (int) – Order of the derivative
NPY (int) – Number of points (MAPNET)
- class POTM(header='')
Bases:
Grid2D
Class for POTM. Initialization can be done by formatted string only. Otherwise call this object from upper block.
- Parameters:
IDER (int) – Order of the derivative
ITOL (int) – Penetration tolerance
NPY (int) – Number of points (MAPNET)
- class CLAS(header='')
Bases:
Grid2D
Class for CLAS. Initialization can be done by formatted string only. Otherwise call this object from upper block.
- Parameters:
IDER (int) – Order of the derivative
IFOR (int) – Number of point multipoles
charge (list) – Formal net charge
NPY (int) – Number of points (MAPNET)
- class Grid3DBASE(header='')
Bases:
BlockBASE
A base class for 3D data grid (ECH3, POT3). Not for ‘GRID3D’ keyword
- Parameters:
header (str) – Formatted headers
- scale(scale1='', scale2='', scale3='')
- range(rg1='', rg2='', rg3='')
Inputs are 2*1 lists.
[minvalue, maxvalue]
. The sequence of rg123 is consistent with CRYSTAL (2D: z; 1D: y, z; 0D: x, y, z)
- class ECH3(header='')
Bases:
Grid3DBASE
Class for ECH3. Initialization can be done by formatted string only. Otherwise call this object from upper block.
- Parameters:
NP (int) – Number of points along the first direction
- class POT3(header='')
Bases:
Grid3DBASE
Class for POT3. Initialization can be done by formatted string only. Otherwise call this object from upper block.
- Parameters:
NP (int) – Number of points along the first direction
ITOL (int) – Penetration tolerance