Dear all,
as a first step, by following the notes for the MomentTensorPotentialTraining class (see https://docs.quantumatk.com/manual/Types/MomentTensorPotentialTraining/MomentTensorPotentialTraining.html#momenttensorpotentialtraining-c (https://docs.quantumatk.com/manual/Types/MomentTensorPotentialTraining/MomentTensorPotentialTraining.html#momenttensorpotentialtraining-c)), I obtained a trained MTP potential set, stored in the mtp_study.hdf5 file.
Then, I would like to get the calculator that employes this potential set, as explained in the example:
mtp_calculator = moment_tensor_potential_training.momentTensorPotentialCalculators()[0]
How can I achieve this by reading the "mtp_study.hdf5" file? Alternatively, what is the procedure to obtain a suitable calculator from the MTPPotential instantiated from the "mtp_study.mtp" file?
Thank you very much for you help!
Best regards
Hi,
You may try the below to get the MTP calculator from .hdf5 file.
moment_tensor_potential_training=nlread('mtp_study.hdf5',MomentTensorPotentialTraining)[-1]
mtp_calculator = moment_tensor_potential_training.momentTensorPotentialCalculators()[0]
Easy way to use the calculator from .mtp file is to follow this manual page which is also what Anders suggested in previous comment
https://docs.quantumatk.com/tutorials/combining_potentials/combining_potentials.html
Basically doing this
potentialSet = TremoloXPotentialSet('potential_name')
potentialSet.addParticleType(ParticleType.fromElement(Oxygen))
.
....add other elements...
.
potentialSet.addPotential(MTPPotential(file='mtp_study.mtp'))
calculator = TremoloXCalculator(parameters=potentialSet)
bulk_configuration.setCalculator(calculator)
I hope this answers your question.
With regards,
Suresh