setVerbosity

setVerbosity(verbosity_settings=None, **kwargs)

Set the verbosity of logging output in ATK Python.

Both pre-defined verbosity settings (MinimalLog or SilentLog) or the verbosity of specific logging regions can be specified.

Information on the logging region that each line in the logging output belongs to can be obtained with showVerbosityRegions().

Parameters:verbosity_settings (dict) – Dictionary of verbosity settings.

Usage Examples

Pre-defined verbosity settings

Two pre-defined dictionaries of verbosity settings are available. The MinimalLog provides a minimalistic but useful QuantumATK logging output:

# QuantumATK verbosity
setVerbosity(MinimalLog)

# Set up configuration
molecule_configuration = MoleculeConfiguration(
    elements=[Nitrogen, Hydrogen, Hydrogen, Hydrogen],
    cartesian_coordinates=[[ 0.     ,  0.      ,  0.124001],
                           [ 0.     ,  0.941173, -0.289336],
                           [ 0.81508, -0.470587, -0.289336],
                           [-0.81508, -0.470587, -0.289336]]*Angstrom
    )

# Calculator
calculator = LCAOCalculator()
molecule_configuration.setCalculator(calculator)
molecule_configuration.update()

Below is shown a section of the resulting QuantumATK logging output:

+------------------------------------------------------------------------------+
| DiagonalizationSolver parallelization report.                                |
+------------------------------------------------------------------------------+
| Total number of processes: 1                                                 |
| Total number of k-points: 1                                                  |
| Processes per k-point: 1                                                     |
| Number of process groups: 1                                                  |
+------------------------------------------------------------------------------+

+------------------------------------------------------------------------------+
| Checkpoint Handler                                                           |
| Filename : /tmp/checkpoint84760295.nc                                        |
| Interval : 0.5 h                                                             |
+------------------------------------------------------------------------------+
|   0 E = -4.24374 dE =  1.000000e+00 dH =  3.517309e-01                       |
|   1 E =  -3.5362 dE =  7.075433e-01 dH =  2.714105e-01                       |
|   2 E = -3.59261 dE =  5.641406e-02 dH =  1.945382e-02                       |
|   3 E = -3.46562 dE =  1.269879e-01 dH =  4.965302e-02                       |
|   4 E = -3.46231 dE =  3.316244e-03 dH =  3.647576e-03                       |
|   5 E = -3.45492 dE =  7.386256e-03 dH =  2.002716e-03                       |
|   6 E = -3.45729 dE =  2.373353e-03 dH =  8.340864e-04                       |
|   7 E = -3.45728 dE =  1.267347e-05 dH =  8.863979e-05                       |
| Calculation Converged in 7 steps                                             |
|                                                                              |
| Fermi Level  = -1.544221 eV                                                  |
+------------------------------------------------------------------------------+

The pre-defined SilentLog dictionary completely silences all QuantumATK logging output (verbosity for all logging regions is False).

# QuantumATK verbosity
setVerbosity(SilentLog)

# Set up configuration
molecule_configuration = MoleculeConfiguration(
    elements=[Nitrogen, Hydrogen, Hydrogen, Hydrogen],
    cartesian_coordinates=[[ 0.     ,  0.      ,  0.124001],
                           [ 0.     ,  0.941173, -0.289336],
                           [ 0.81508, -0.470587, -0.289336],
                           [-0.81508, -0.470587, -0.289336]]*Angstrom
    )

# Calculator
calculator = LCAOCalculator()
molecule_configuration.setCalculator(calculator)
molecule_configuration.update()

which results in nothing but a minimal header in the logging output:

+------------------------------------------------------------------------------+
|                                                                              |
| Atomistix ToolKit 2016.0                                                     |
|                                                                              |
+------------------------------------------------------------------------------+

Advanced usage

Instruct QuantumATK Python to avoid printing time stamps, the size of density matrices, progress bars, and checkpoint file information in the logging output:

# QuantumATK verbosity
verbosity = {
    'TIME_STAMP': False,
    'MATRIX_SIZES': False,
    'PROGRESS_BARS': False,
    'CHECKPOINT_FILE': False,
}
setVerbosity(verbosity)

# Set up configuration
molecule_configuration = MoleculeConfiguration(
    elements=[Nitrogen, Hydrogen, Hydrogen, Hydrogen],
    cartesian_coordinates=[[ 0.     ,  0.      ,  0.124001],
                           [ 0.     ,  0.941173, -0.289336],
                           [ 0.81508, -0.470587, -0.289336],
                           [-0.81508, -0.470587, -0.289336]]*Angstrom
    )

# Calculator
calculator = LCAOCalculator()
molecule_configuration.setCalculator(calculator)
molecule_configuration.update()

Note that the verbosity settings are given as a Python dictionary (key–value pairs). Below is shown a section of the resulting QuantumATK logging output:

+------------------------------------------------------------------------------+
| DiagonalizationSolver parallelization report.                                |
+------------------------------------------------------------------------------+
| Total number of processes: 1                                                 |
| Total number of k-points: 1                                                  |
| Processes per k-point: 1                                                     |
| Number of process groups: 1                                                  |
+------------------------------------------------------------------------------+
+------------------------------------------------------------------------------+
| Density Matrix Report                       DM        DD                     |
+------------------------------------------------------------------------------+
|   0   N   [  0.000 ,  0.000 ,  0.124 ]    5.35681   0.35681                  |
|   1   H   [  0.000 ,  0.941 , -0.289 ]    0.88105  -0.11895                  |
|   2   H   [  0.815 , -0.471 , -0.289 ]    0.88107  -0.11893                  |
|   3   H   [ -0.815 , -0.471 , -0.289 ]    0.88107  -0.11893                  |
+------------------------------------------------------------------------------+
|   0 E = -4.24374 dE =  1.000000e+00 dH =  3.517309e-01                       |
+------------------------------------------------------------------------------+
+------------------------------------------------------------------------------+
| Density Matrix Report                       DM        DD                     |
+------------------------------------------------------------------------------+
|   0   N   [  0.000 ,  0.000 ,  0.124 ]    5.25696   0.25696                  |
|   1   H   [  0.000 ,  0.941 , -0.289 ]    0.91429  -0.08571                  |
|   2   H   [  0.815 , -0.471 , -0.289 ]    0.91437  -0.08563                  |
|   3   H   [ -0.815 , -0.471 , -0.289 ]    0.91437  -0.08563                  |
+------------------------------------------------------------------------------+
|   1 E =  -3.5362 dE =  7.075433e-01 dH =  2.714105e-01                       |
+------------------------------------------------------------------------------+

Pre-defined dictionaries of verbosity settings can be combined with keywords, e.g to produce a minimalistic logging output, but keeping the otherwise silenced SCF_HEADER verbose:

# QuantumATK verbosity
setVerbosity(MinimalLog, SCF_HEADER=True)

It is also possible to specify the verbosity dictionary from scratch, e.g. to produce the equivalent of MinimalLog:

# QuantumATK verbosity
verbosity = {
    'TIME_STAMP': True,
    'MULLIKEN_REPORT': False,
    'PROGRESS_BARS': False,
    'SCF_HEADER': False,
    'GRID_INFO': False,
    'MATRIX_SIZES': False,
    'SCF_PROGRESS_END': False,
    'GRID_TOOL_INFO': False,
    'MEMORY_INFO': False,
    'INITIALIZE_HAMILTONIAN': False,
}
setVerbosity(verbosity)

Notes

Most parts of the QuantumATK logging output is associated with a “logging region”, see showVerbosityRegions(). The default QuantumATK verbosity mode is True for all logging regions, i.e., to print out all available logging output. Use the setVerbosity() function to enable/disable verbosity for specific logging regions.

Information about which logging region each line in the logging output belongs to can be obtained using showVerbosityRegions().

See also saveVerbositySettings() for saving custom verbosity settings for later use.

MinimalLog

The MinimalLog dictionary of verbosity settings is reproduced below:

verbosity = {
    'TIME_STAMP': True,
    'MULLIKEN_REPORT': False,
    'PROGRESS_BARS': False,
    'SCF_HEADER': False,
    'GRID_INFO': False,
    'MATRIX_SIZES': False,
    'SCF_PROGRESS_END': False,
    'GRID_TOOL_INFO': False,
    'MEMORY_INFO': False,
    'INITIALIZE_HAMILTONIAN': False,
}

All available logging regions

The following is a list all currently available logging regions:

  • ALL
  • ATOMIC_CALCULATOR
  • ATOMIC_CONFIGURATION
  • BANDSTRUCTURE
  • BONDS_WARNING
  • CALCULATOR_UPDATE
  • CHECKPOINT_FILE
  • CHEMICAL_POTENTIAL
  • CONTOUR_INFO
  • COUNTERPOISE_CORRECTION
  • CRYSTAL_STRUCTURE_PREDICTION
  • DEATH_DATE
  • DELTATEST
  • DENSITYOFSTATES
  • DEPRECATION_WARNING
  • DEVICEDENSITYOFSTATES
  • DIAGONALIZATION_INFO
  • DYNAMICAL_MATRIX
  • EFFECTIVEBANDSTRUCTURE
  • ELASTICCONSTANTS
  • ELECTRON_PHONON
  • FEAST_DIAGONALIZER
  • FERMI_LEVEL
  • FORCES_CONVERGED
  • GRID_INFO
  • GRID_TOOL_INFO
  • GRIMME2
  • GRIMME3
  • HAMILTONIAN_DERIVATIVES
  • HARMONIC_CALCULATOR
  • HTST
  • INELASTICTRANSMISSION
  • INITIAL_STATE
  • INITIALIZE_HAMILTONIAN
  • LBFGS_MESSAGE
  • LCAO_INITILIZATION
  • MATRIX_SIZES
  • MD_PROGRESS
  • MD_RESTART
  • MD_STEP
  • MEMORY_INFO
  • MEMORY_USAGE
  • MOBILITY
  • MULLIKEN_REPORT
  • NEB_CONVERGED
  • NEB_INFO
  • NEB_PARALLEL_INFO
  • NEB_PREOPTIMIZATION_INFO
  • NEB_STEP
  • NEB_WARNING
  • NELDER_MEAD
  • NLPRINT
  • NLREAD_ERROR
  • NLREPACK
  • NLSAVE_WARNING
  • OPTIMIZATION_CELL
  • OPTIMIZATION_FORCES_CLASSICAL
  • OPTIMIZATION_FORCES_QUANTUM
  • OPTIMIZATION_STRESS
  • PARALLEL_INFO
  • PDOS_WARNING
  • PROGRESS_BARS
  • RESTART_INFO
  • REUSE_ELECTRODE
  • SCF_CONVERGED
  • SCF_HEADER
  • SCF_PROGRESS
  • SCF_PROGRESS_END
  • SCF_WARNING
  • SCFLOOP_INFO
  • SLATERORBITAL
  • SPINTRANSFERTORQUE
  • SPLINE_INTERPOLATION
  • STM
  • STRESS_CONVERGED
  • TIME_STAMP
  • TIMING_REPORT
  • TRANSMISSIONPATHWAYS
  • TRANSMISSIONSPECTRUM