QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: aknair on March 6, 2023, 01:59

Title: Adding Tags for moment tensor potential
Post by: aknair on March 6, 2023, 01:59
I am trying to perform this example for bilayer MoS2 using moment tensor potential. https://docs.quantumatk.com/tutorials/combining_potentials/combining_potentials.html.

I have set tags for the the two layers (layer 1 and layer 2 as shown in the example above) and used MTP potential for the tagged layers. For interaction between the layers I use LJ potential. However, I get the following error while running the script.

Traceback (most recent call last):
  File "BL-MoS2.py", line 125, in <module>
    MtpPotential.actOnlyOnTaggedRegion('Layer1')
  File "build\lib\site-packages\tremolox\potentialsets\potentialsetbase.py", line 690, in actOnlyOnTaggedRegion
  File "build\lib\site-packages\tremolox\potentials\potentials.py", line 4346, in _limitToOneTag
RuntimeError: The MTP potential does not support the usage of tags


Is there anyway to resolve this problem?

Regards,
Akhil
Title: Re: Adding Tags for moment tensor potential
Post by: Julian Schneider on March 8, 2023, 09:26
Dear Akhil,

as the message says MTP does currently not support using tags to select the subset of atoms it acts on.
In your case I would recommend augmenting the MTP with a D3-dispersion correction, exactly as one would in DFT.
We have a fast force-field-like implementation of the D3-correction which can be combined with other force-fields (https://docs.quantumatk.com/manual/ForceField.html#dispersiond3bj-na-p-sr-ac-pd-ne-ni-f-nd-gd-pt-re-nb-rh-v-rb-at-c-xe-cs-co-cl-ce-yb-hf-ru-b-ra-pb-u-cu-ga-sb-os-au-br-tl-n-s-y-te-bi-ar-eu-pu-po-cr-mg-sc-ir-zn-pr-as-lu-mn-ca-ta-fr-se-ho-ge-rn-h-li-mo-ti-zr-o-er-ag-w-al-tm-ba-hg-tb-be-pm-tc-sm-k-pa-fe-sn-kr-cd-si-la-np-dy-th-in-i-he (https://docs.quantumatk.com/manual/ForceField.html#dispersiond3bj-na-p-sr-ac-pd-ne-ni-f-nd-gd-pt-re-nb-rh-v-rb-at-c-xe-cs-co-cl-ce-yb-hf-ru-b-ra-pb-u-cu-ga-sb-os-au-br-tl-n-s-y-te-bi-ar-eu-pu-po-cr-mg-sc-ir-zn-pr-as-lu-mn-ca-ta-fr-se-ho-ge-rn-h-li-mo-ti-zr-o-er-ag-w-al-tm-ba-hg-tb-be-pm-tc-sm-k-pa-fe-sn-kr-cd-si-la-np-dy-th-in-i-he))


It would work something like this:
Code
# Set up the MTP potential set as you normally would.
potential_set_mtp = TremoloXPotentialSet('MTP')
potential_set_mtp.addParticleType(ParticleType('Mo'))
potential_set_mtp.addParticleType(ParticleType('S'))
potential_set_mtp.addPotential(MTPPotential('mtp_filename.mtp'))

# Use the pre-defined potential set for D3 correction with BJ-damping.
potential_set_d3 = DispersionD3BJ("PBE")

# Merge both potential sets when setting up the calculator
calculator = TremoloXCalculator([potential_set_mtp, potential_set_d3])

This approach will be more accurate than the one based on a LJ potential, because it only adds the missing dispersion contribution to the otherwise accurate MTP.