nanotools.checkconv module

Created on 2021-06-16

@author: Vincent Michaud-Rioux

class nanotools.checkconv.CheckPrecision(reference_calculator, calculators: ~typing.List[~nanotools.totalenergy.TotalEnergy] = [], etol=<Quantity(0.001, 'electron_volt')>, parameter: str = 'resolution')[source]

Bases: Base

CheckPrecision class.

Examples:

from nanotools.checkprecision import CheckPrecision
from nanotools.totalenergy import TotalEnergy
ecalc = TotalEnergy.read("nano_scf_out.json")
ecalc.solver.set_stdout("resculog.out")
calc = CheckPrecision(ecalc, parameter="resolution", etol=1.e-3)
calc.solve()
calculators

Stores the calculators for each element of charge_deltas.

Type:

list

etol

Total energy tolerance.

Type:

pint.registry.Quantity

parameter

Parameter to converge (“k-sampling” or “resolution”).

Type:

str

get_delta_etots()[source]

Returns the energy errors taking the highest resolution as reference.

plot(filename=None, show=True)[source]

Generates a plot of the error as a function of parameter.

Parameters:
  • filename (str, optional) – If not None, then the figure is saved to filename.

  • show (bool, optional) – If True block and show figure. If False, do not show figure.

Returns:

A figure handle.

Return type:

fig (matplotlib.figure.Figure)