Previous topic

BigDFT.InputActions module

Next topic

BigDFT.Fragments module

This Page

BigDFT.Logfiles module

This module is useful to process a logfile of BigDFT run, in yaml format. It also provides some tools to extract typical informations about the run, like the energy, the eigenvalues and so on.

class BigDFT.Logfiles.Logfile(*args, **kwargs)[source]

Import a Logfile from a filename in yaml format, a list of filenames, an archive (compressed tar file), a dictionary or a list of dictionaries.

Parameters:
  • args (strings) – logfile names to be parsed
  • kwargs

    keyword arguments

    • archive: name of the archive from which retrieve the logfiles
    • member: name of the logfile within the archive. If absent, all the files of the archive will be considered as args
    • label: the label of the logfile instance
    • dictionary: parsed logfile given as a dictionary, serialization of the yaml logfile
Example:
>>> l = Logfile('one.yaml','two.yaml')
>>> l = Logfile(archive='calc.tgz')
>>> l = Logfile(archive='calc.tgz',member='one.yaml')
>>> l = Logfile(dictionary=dict1)
>>> l = Logfile(dictionary=[dict1, dict2])

Todo

Document the automatically generated attributes, perhaps via an inner function in futile python module

geopt_plot()[source]

For a set of logfiles construct the convergence plot if available. Plot the Maximum value of the forces against the difference between the minimum value of the energy and the energy of the iteration. Also an errorbar is given indicating the noise on the forces for a given point. Show the plot as per plt.show() with matplotlib.pyplots as plt

Example:
>>> tt=Logfile('log-with-geometry-optimization.yaml')
>>> tt.geopt_plot()
get_brillouin_zone()[source]

Return an instance of the BrillouinZone class, useful for band structure. :returns: Brillouin Zone of the logfile :rtype: BigDFT.BZ.BrillouinZone

get_dos(label=None, npts=2500)[source]

Get the density of states from the logfile.

Parameters:
  • label (string) – id of the density of states.
  • npts (int) – number of points of the DoS curve
Returns:

Instance of the DoS class

Return type:

BigDFT.DoS.DoS

label = None

Label of the Logfile instance

reference_log = None

Position in the logfile items of the run associated to lower energy

srcdir = None

Absolute path of the directory of logfile

wfn_plot()[source]

Plot the wavefunction convergence.

BigDFT.Logfiles.find_iterations(log)[source]

Identify the different block of the iterations of the wavefunctions optimization.

Todo

Should be generalized and checked for mixing calculation and O(N) logfiles

Parameters:log (dictionary) – logfile load
Returns:wavefunction residue per iterations, per each subspace diagonalization
Return type:numpy array of rank two
BigDFT.Logfiles.floatify(scalar)[source]

Useful to make float from strings compatible from fortran

Parameters:
  • scalar (str, float) – When string representing a float that might be given in fortran notation,
  • it might be a floating point (otherwise) –
Returns:

float. The value associated to scalar as a floating point number

Example

>>> floatify('1.d-4') #this would be the same with "1.e-4" or with 0.0001
1.e-4
BigDFT.Logfiles.get_logs(files)[source]

Return a list of loaded logfiles from files, which is a list of paths leading to logfiles.

Parameters:files – List of filenames indicating the logfiles
Returns:List of Logfile instances associated to filename
BigDFT.Logfiles.plot_wfn_convergence(wfn_it, gnrm_cv)[source]

Plot the convergence of the wavefunction coming from the find_iterations function. Cumulates the plot in matplotlib.pyplot module

Parameters:
  • wfn_it – list coming from find_iterations()
  • gnrm_cv – convergence criterion for the residue of the wfn_it list