Computational and Hamiltonian parameters

class pylada.dftcrystal.electronic.Electronic[source]

Bases: pylada.dftcrystal.input.AttrBlock

DFT attribute block.

add_keyword(name, value=None)

Adds/Sets input keyword.

dft

Attribute block which holds parameters defining the Hamiltonian used in the calculation. It is an instance of Dft.

anderson = None

Applies Anderson mixing method.

Andersen mixing does not require any input. It expects None (default, does nothing), True or False. The latter is equivalent to None.

atomspin = None

Atomic spins.

Defines the atomic spins.

>>> functional.atomspin.up = range(5)*2 + 1
>>> functional.atomspin.down = range(5)*2 + 2

For spin-polarized calculations, this would result in the CRYSTAL input:

ATOMSPIN
8
2 1 4 1 6 1 8 1
1 -1 3 -1 5 -1 7 -1

There are two main variables, up and down, which are lists of atomic labels. up contains the atoms which at the start of the calculation should have an up spin, and down those atoms with a down spin. A third variable, other, corresponds to the ‘’irrelevant’’ atoms, as per CRYSTAL‘s input.

Alternatively, the up and down variables can be reached via indexing:

>>> functional.atomspin[1] is functional.atomspin.up
True
>>> functional.atomspin[-1] is functional.atomspin.down
True
>>> functional.atomspin[0] is functional.atomspin.other
True

Note

A number of settings will disable this keyword:

  • py:attr:~pylada.dftcrystal.functional.dft.spin is False
  • py:attr:~pylada.dftcrystal.functional.dft.spin is None or True, and the appropriate wavefunction exists.
betalock = None

Locks in the number of beta electrons.

This tag presents the same user-interface as spinlock.

biposize = None

Size of buffer for Coulomb integrals bipolar expansions.

Should be None(default), True, or False.

broyden = None

Applies broyden mixing method.

Broyden takes three inputs:

>>> functional.broyden.w0     = 1e-4
>>> functional.broyden.imix   = 50
>>> functional.broyden.istart = 2

The above results in:

BROYDEN
0.0001 50 2

The first attribute should be a floating point, whereas the second and third should be integers. The second item should be between 0 and 100, excluded, and the third larger than two. The input can also be set and accessed as an array:

>>> functional.broyden = [1e-4, 50, 2]
>>> functional.broyden[1] = 25
>>> functional.broyden.imix
25
cmplxfac = None

Computaional weight of complex vs real k-points.

exchsize = None

Size of buffer for exchange integrals bipolar expansions.

Should be None(default), True, or False.

fmixing = None

Fock mixing during electronic minimiztion.

Should be None(default) or an integer.

guessp = None

Reads density matrix from disk.

  • If True and restart is not None, then copies crystal.f9 to fort.20 in the working directory and adds GUESSP keyword to the input. Alternatively, if a later crystal.f98 file is found, then it is transformed to an unformatted file and copied to fort.20.
  • If True but restart is None or the file crystal.f9 does not exist, then does nothing.
  • If False or None, does nothing.

Note

There seems to be a strange bug, at least on crays, where the crystal.f9 file is likely to be corrupt as far as the main CRYSTAL program can tell. However, it can still be read by PROPERTIES and transformed to a valid f98 file. That file can then be transformed back to a valid f9 file. To ensure correctness, this procedure is followed each time an f9 file is found.

levshift = None

Artificial shift between the valence and conduction band.

Opens the gap between occupied and unoccupied bands for better numerical behavior. It can be set as follows:

>>> functional.levshift = 5 * decihartree, False

The first parameter is the amount by which to open the gap. It should either an integer, or a signed energy quantity (see quantities). In the latter case, the input is converted to decihartree and rounded to the nearest integer.

The second parameter specifies whether to keep (True) or remove (False) the shift after diagonalization.

maxcycle = None

Maximum number of electronic minimization steps.

Should be None(default) or an integer.

mpp = None

Whether to use MPP or Pcrystal when running mpi.

If True and more than one process is requested, switches to using MPPcrystal as opposed to Pcrystal. This only works under the assumption that pylada.crystal_program is implemented correctly.

nobipcou = None

Whether to compute bielectronic Coulomb integrals exactly.

Should be None(default), True, or False.

nobipexc = None

Whether to compute bielectronic exchange integrals exactly.

Should be None(default), True, or False.

nobipola = None

Whether to compute bielectronic integrals exactly.

Should be None(default), True, or False.

nofmwf = None

Whether to print formatted wavefunctions to disk.

Should be None(default), True, or False.

nomondir = None

Whether store monoelectronic integrals to disk.

If True, the monoelctronic integrals are computed once at the start of the SCF calculation and re-read from disk at each geometric optimization step. Should be None(default), True, or False.

nosymada = None

Whether to not use symmetry adapted functions.

Should be None(default), True, or False.

poleordr = None

Coulomb intergrals pole truncation.

Should be None(default), or an integer between 0 and 6 included.

postscf = None

Whether to continue despite lack of electronic convergence.

ppan = None

Mulliken population analysis.

Should None(default), True, or False.

savewf = None

Whether to save wavefunctions at each step.

Should be None(default), True, or False.

scfdir = None

Whether to reevaluate integrals at each electronic step.

Should be None(default), True, or False.

setprint = None

Extended printing request.

Printing options consists of (keyword, value) pairs. As such, they can be inputed much like arrays:

>>> functional.setprint[66] = -5

Will result in the output:

SETPRINT
1
66 -5

which prints the eigenvalues of the first five k-points at the end of the electronic minimization loop only. The print-out options can be found in the CRYSTAL user-guide.

shrink = None

k-point description – SHRINK

The IS (or IS1, IS2, IS3) and ISP keywords are mapped to mp and gallat.

They can be used as follows:

functional.shrink.mp = 5
functional.shrink.gallat = 10

This will map IS to 5 and ISP to 10. ISP automatically set to equal IS (or IS1) when gallat is set to None:

functional.shrink.mp = 10
functional.shrink.gallat = None

This will print in the CRYSTAL input:

SHRINK
5 5

Finally, setting mp to a sequence of at most three integers will set IS to 0 and IS1, IS2 (defaults to 1), and IS3 (defaults to 1) to the relevant values:

functional.shrink.mp = [5, 6]
functional.shrink.gallat = None

This will lead to the following input, where ISP defaulted automatically to IS1:

SHRINK
0 5
5 6 1

Another option it to set mp and gallat directly:

functional.shrink = 8, 8

would result in the following ouput

SHRINK
8 8

mp will be set to the first item. and gallat to the second. There should always be two items.

smear = None

Smearing energy, if any.

Expects None (default, does nothing) or an energy wich defines the width of the smearing function.

spinlock = None

Difference in occupation between the two spin-channels.

This object takes two values, the difference between of occupations between the two spin channels, and the number of electronic minimization steps during which the lock is maintained.

>>> functional.spinlock.nspin   = 2
>>> functional.spinlock.ncycles = 30

The above sets the \(\alpha\) and \(\beta\) occupations to \(\frac{N+2}{2}\) and \(\frac{N-2}{2}\) respectively, for 30 iterations of the electronic structure minimization algorithm. It results in the input:

SPINLOCK
2 30

Alternatively, the same could be done with the 2-tuple syntax:

>>> functional.spinlock = 2, 30

If either the occupation or the cycle-lock is None, then SPINLOCK is disabled.

symadapt = None

Symmetry adapted bloch wavefunctions.

Should be None(default), True, or False.

test = None

Stop after printing ressource requirement.

Should be None(default), True, or False.

testpdim = None

Stop after processing input and performing symmetry analysis.

Should be None(default), True, or False.

toldee = None

Total energy convergence criteria.

Should be None(default) or an integer.

toldep = None

Density matrix convergence criteria.

Should be None(default) or an integer.

tolinteg = None

Integration truncation criteria.

Should be None(default) or a sequence of 5 integers.

tolpseud = None

Pseudopotential truncation criteria.

Should be None(default) or an integer.

class pylada.dftcrystal.hamiltonian.Dft[source]

Bases: pylada.dftcrystal.input.AttrBlock

DFT attribute block.

Holds parameters relative to the Hamiltonian used in the calculation. These parameters can be accessed indirectly in tha functional:

>>> functional.dft.b3lyp = True
>>> functional.dft.xxlgrid = True

The above would set the Hamiltonian to the B3LYP exchange-correlation functional and the integration grid to 64 fl.oz.

add_keyword(name, value=None)

Adds/Sets input keyword.

exchange

Name of the exchange functional to use. It should be one of the following: ‘becke’, ‘lda’, ‘pbe’, ‘pbesol’, ‘pwgga’, ‘sogga’, ‘vbh’, ‘wcgga’, or None(default).

correlat

Name of the correlation functional to use. It can be one of the following: ‘lyp’, ‘p86’, ‘pbe’, ‘pbesol’, ‘pwgga’, ‘pwlsd’, ‘pz’, ‘vbh’, ‘wl’, ‘vwn’, or None.

hybrid

Amount of exchange to add to functional. It should be a floating point or None.

nonlocal

Non-local weights on exchange-correlation. A tuple of two floating point which sets the weights of the non-local part of the exchange (first) and of the correlations (second). It can also be None.

spin

If True, then perform spin-polarized calculation. It should be None(default), True, or False.

b3lyp

Sets exchange, correlat, nonlocal to the B3LIP functional. Since it acts on/checks upon other attributes, it can only be set to True.

pbe0

Sets exchange, correlat, nonlocal correctly for the PBE0 functional. Since it acts on/checks upon other attributes, it can only be set to True.

soggaxc

Sets exchange, correlat, nonlocal correctly for the SOGGAXC functional. Since it acts on/checks upon other attributes, it can only be set to True.

angular

Contains two attributes intervals and levels which can be used to set the angular grid.

radial

Contains two attributes intervals and nbpoints which can be used to set the radial integration grid.

lgrid

Preset large integration grid.

xlgrid

Preset extra large integration grid.

xxlgrid

Preset extra extra large integration grid.

tollgrid

DFT grid weight tolerance. Should be None(default) or an integer.

tolldens

DFT density tolerance Should be None(default) or an integer.

Previous topic

Basis sets

Next topic

Crystal structure à la CRYSTAL

This Page