# assert

Assert that the result from a previous calculation agrees with a specified value. Allowed types for comparison are integer or double. Vector and matrix notations are allowed as well. For floating point number comparisons, the precision is up to the specified margin.

For example:

helium_HF := dft(
structure( formula = He )
xc = HF
ao = 'STO-3G'
coulomb_method = direct_4idx
)
helium_DFT := dft(
structure( formula = He )
xc = PBE
ao = 'STO-3G'
)
assert(
variable = energy
value = -2.807784
margin = 0.000001
)
assert(load = helium_DFT variable = n_iter value = 1)
assert(load = helium_DFT variable = structure atom = 1 element = 2 value = 0.0 margin = 1e-12)
assert(load = helium_DFT variable = orbitals row = 1 column = 1 absolute_value = 1.0 margin = 1e-12)


This command can appear in the global context.

### Options

absolute_value

Numerical value that the absolute value of variable should match. This is an alternative to value.

• The type is real
• There is no default value.
• The value must be nonnegative
atom

Atom number (1-based indexing) to look up an atom's xyz position of a structure.

• The type is int
• There is no default value.
• The value must be positive
column

Column index (1-based indexing) to look up a value in a matrix.

• The type is int
• There is no default value.
• The value must be positive
element

Element index (1-based indexing) to look up a value in a vector.

• The type is int
• There is no default value.
• The value must be positive
load

Name of result set to load the variable from.

• The type is string
• There is no default value.
margin

Margin within which the variable should agree with the specified value.

• The type is real
• The default is 0
• The value must be nonnegative
name

Name of result set to take the variable from.

This option is deprecated.

• The type is string
• The default is previous
row

Row index (1-based indexing) to look up a value in a matrix.

• The type is int
• There is no default value.
• The value must be positive
value

Numerical value that the variable should match.

• The type is real
• There is no default value.
variable

Name of variable, to be used together with value.

This option is mandatory.

• The type is string
• There is no default value.