PLAMS中如何设置region

this can be done by adding the corresponding suffix to the atom properties. You could use the following snippet to append this functionality to the Molecule class. It can by called via

myMolecule.set_region({"region1": range(1,6), "region2": range(6, 12)})

or in cases where all atoms are assigned to the same region:

myMolecule.set_region("regionAll")
 
 
@add_to_class(Molecule)
def set_region(self, region):
if type(region) == dict:
for region_name, region_range in region.items():
for i in region_range:
self[i].properties.suffix = "Region="+region_name
elif type(region) == str:
for a in self:
a.properties.suffix = "Region="+region