AMML vibrational_energies property has list of array type
Some recent changes in the language, possibly in the AMML extension, caused a change in the data type of the vibrational_energies
property.
Before the change(s) causing this issue, one could print the vibrational_energies
of some system using the following print statement:
print(prop_samplesys.vibrational_energies)
This would yield the following output example, which has the structure of list
data type (in agreement with the docs):
(vibrational_energies: 0.449841563, 0.06830918400000001, 0.06776672, 0.042461001000000005, 0.021697368, 0.021071967) [electron_volt]
Currently, the same print
statement will yield the following (notice the extra set of square brackets):
(vibrational_energies: [0.449841563, 0.06830918400000001, 0.06776672, 0.042461001000000005, 0.021697368, 0.021071967]) [electron_volt]
^ ^
Which looks like a sort of list-of-arrays type, with only one element. Since it is not a pure list, nor array, standard operations of each data type not always work. For example subscripting the series to retrieve the first element in the list yields:
input> print(prop_samplesys.vibrational_energies[0])
output> [0.449841563, 0.06830918400000001, 0.06776672, 0.042461001000000005, 0.021697368, 0.021071967] [electron_volt]
The resulting array can be assigned to a new variable, but regular array operations don't seem to work (such as individual element extraction).
This issue is problematic for the implementation of the use case.
In particular, the current implementation to calculate the Zero-Point Energy (ZPE) relies on the sum
operation:
zpe(vibrational_energies) = 0.5*sum(vibrational_energies)
However sum
requires numeric data of the series type.
If the vibrational_energies
is used with the current series-array structure the following error message is produced:
Type error: /home/my_dir/sample_tst/vre-sample.vm:74:27 --> vib_ener <--
Object must be series or reference to series
This error can be reproduced by running the attached model vre-sample.vm script.