Creating Instances of the AimqbParameters Data Type

Creating Instances of the AimqbParameters Data Type#

aiida-aimall provides a data class to validate the inputs provided to AIMQB. This is provided through the AimqbParameters from aiida_aimall.data. AimqbParameters takes a dictionary as input and validates that the keys are valid AIMQB command line input, and that their associated values are of the correct datatype. These parameters are then used in AimqbCalculations Further, for use in aiida-aimall calculations and workflows, the nogui option is automatically added for all instances of AimqbParameters. This is to run the software without the graphical user interface, which is not needed as part of the automated AIMAll calculations provided here. Therefore, the nogui option should not be passed as AimqbParameters input.

Supported Options#

The list of supported command line options from AIMAll’s website is given in the below table. Currently, only the datatype is verified; checks are not in place to ensure that strings are in a set of accepted values. For instance, iasmesh should be one of sparse/medium/fine/veryfine/superfine, but AimqbParameters only validates that a string was provided. If an incorrect option were provided, the AimqbCalculation that these parameters were provided to would fail.

Command Line

Data Type

Description

Valid Options

Default

bim

str

Basin integration method

auto/proaim/promega/promega1/promega5

auto

iasmesh

str

Target spacing between adjacent IAS paths

sparse/medium/fine/veryfine/superfine

fine

capture

str

Gradient path capture method

auto/basic/extended

auto

boaq

str

Basin outer angular quadrature

auto/auto_gs2/auto_gs4/gs1/gs2/gs3/gs4/gs5/gs6 /gs7/gs8/gs9/gs10/gs15/gs20/gs25 /gs30/gs35/gs40/gs45/gs50/gs55/gs60 /leb23/leb25/leb27/leb29/leb31/leb32

auto

ehren

int

Whether and how to calculate atomic Ehrenfest forces

0/1/2

0

feynman

bool

Print Feynman force data to file

False/True

False

iasprops

bool

Calculate IAS Properties

False/True

False

magprops

str

Method for calculating magnetic response properties

none/igaim/csgtb/giao

none

source

bool

Print atomic source contributions to electron density at critical points

False/True

False

iaswrite

bool

Write IAS data to .iasviz files

False/True

False

atidsprop

str

Controls calculation of isodensity surface properties

no/0.001/all

0.001

encomp

int

Atomic energy components to calculate

0/1/2/3/4

1

warn

bool

Show warning message boxes when appropriate

False/True

True

scp

str

Show calculation progress in log window

false/true/some

some

delmog

bool

Delete the .mog files

False/True

True

skipint

bool

Skip atomic integrations

False/True

False

f2w

str

Filetype to create from .fchk

wfx/wfn

wfx

f2wonly

bool

Only create wfx from .fchk, not run calculation

False/True

False

atoms

str

Which atoms to determine critical point connectivity and properties

all/i,j,k… (i,j,k… atoms to calculate), all_i,j,k

all

mir

float

Maximum atomic integration radius

auto/10.0/12.0/13.5/etc.

auto

cpconn

str

Intensity of search for connectivity between CPs

moderate/complex/simple/basic

moderate

intveeaa

str

Algorithm for Vee(A,A) calculatiosn

old/new

new

atlaprhocps

bool

Find Laplacian of Electron Density Critical Points

False/True

False

wsp

bool

Wrote a molecular graph and other special GradRho paths to .mgpviz

False/True

True

nproc

int

Number of processors to use

1/2/etc.

1

naat

int

Number of atoms to calculate at a time

1/2/etc.

1

shm_lmax

int

Controls printing of Spherical Harmonic Moments

-1/0/1/2/etc.

5

maxmem

int

Memory to use

800/1200/1800/2400/etc.

800 for 32 bit, 2400 for 64 bit

verifyw

str

Whether to verify wavefunction or ONLY verify wavefunction

yes/no/only

yes

saw

bool

No description in documentation

False/True

False

autonnacps

bool

Automatically incorporate NNACPs

False/True

True

Creating AimqbParameters#

Creating AimqbParameters is straightforward, as presented in the following code.

[6]:
from aiida.plugins import DataFactory
from aiida import load_profile

load_profile()
AimqbParameters = DataFactory('aimall.aimqb')

aim_input = AimqbParameters(parameter_dict={'naat': 2,'nproc':4})

You can view the command line parameters that an AimqbCalculation will synthesize from the generated data using the cmdline_params method, passing an example input file name. Note how -nogui is included despite not being provided to AimqbParameters.

[5]:
aim_input.cmdline_params('input_file.wfx')
[5]:
['-naat=2', '-nproc=4', '-nogui', 'input_file.wfx']

Further you can view the data as a string using the __str__ method.

[8]:
aim_input.__str__()
[8]:
"uuid: 7fdc4972-c183-403f-98a2-55092e81467b (unstored)\n{'naat': 2, 'nproc': 4}"

Passing an incorrect datatype for any given key will result in an error, as seen below when a string ‘two’ is passed to naat.

[9]:
aim_input = AimqbParameters(parameter_dict={'naat': 'two','nproc':4})
---------------------------------------------------------------------------
MultipleInvalid                           Traceback (most recent call last)
Cell In[9], line 1
----> 1 aim_input = AimqbParameters(parameter_dict={'naat': 'two','nproc':4})

File ~/Documents/KLGNotes/PythonPackages/aiida-aimall/src/aiida_aimall/data/__init__.py:68, in AimqbParameters.__init__(self, parameter_dict, **kwargs)
     59 def __init__(self, parameter_dict=None, **kwargs):
     60     """Constructor for the data class
     61
     62     Usage: ``AimqbParameters(parameter_dict{'ignore-case': True})``
   (...)
     66
     67     """
---> 68     parameter_dict = self.validate(parameter_dict)
     69     super().__init__(dict=parameter_dict, **kwargs)

File ~/Documents/KLGNotes/PythonPackages/aiida-aimall/src/aiida_aimall/data/__init__.py:82, in AimqbParameters.validate(self, parameters_dict)
     71 def validate(self, parameters_dict):
     72     """Validate command line options.
     73
     74     Uses the voluptuous package for validation. Find out about allowed keys using::
   (...)
     80     :returns: validated dictionary
     81     """
---> 82     return AimqbParameters.schema(parameters_dict)

File ~/anaconda3/envs/aiida/lib/python3.12/site-packages/voluptuous/schema_builder.py:281, in Schema.__call__(self, data)
    279 """Validate data against this schema."""
    280 try:
--> 281     return self._compiled([], data)
    282 except er.MultipleInvalid:
    283     raise

File ~/anaconda3/envs/aiida/lib/python3.12/site-packages/voluptuous/schema_builder.py:625, in Schema._compile_dict.<locals>.validate_dict(path, data)
    622     raise er.MultipleInvalid(errors)
    624 out = data.__class__()
--> 625 return base_validate(path, data.items(), out)

File ~/anaconda3/envs/aiida/lib/python3.12/site-packages/voluptuous/schema_builder.py:458, in Schema._compile_mapping.<locals>.validate_mapping(path, iterable, out)
    456     errors.append(er.RequiredFieldInvalid(msg, path + [key]))
    457 if errors:
--> 458     raise er.MultipleInvalid(errors)
    460 return out

MultipleInvalid: expected int for dictionary value @ data['naat']