diff --git a/src/soap/soapy/elements.py b/src/soap/soapy/elements.py index 54366e1337ff486a2e86a09dd55d2701e284e3c4..0ff1b4c1fd81e3a825efa591f35fca1b5c3e7c2a 100644 --- a/src/soap/soapy/elements.py +++ b/src/soap/soapy/elements.py @@ -16,17 +16,17 @@ class PeriodicTable(object): ] # Allen scale element_names = ["?", - "H ","He ", - "Li ","Be ","B ","C ","N ","O ","F ","Ne ", - "Na ","Mg ","Al ","Si ","P ","S ","Cl ","Ar ", - "K ","Ca ","Sc ","Ti ","V ","Cr ","Mn ","Fe ","Co ","Ni ","Cu ","Zn ","Ga ","Ge ", "As ","Se ","Br ","Kr ", - "Rb ","Sr ","Y ","Zr ","Nb ","Mo ","Tc ","Ru ","Rh ","Pd ","Ag ","Cd ","In ","Sn ", "Sb ","Te ","I ","Xe ", - "Cs ","Ba ", - "La ","Ce ","Pr ","Nd ","Pm ","Sm ","Eu ","Gd ","Tb ","Dy ","Ho ","Er ","Tm ","Yb ","Lu ", - "Hf ","Ta ","W ","Re ","Os ","Ir ","Pt ","Au ","Hg ","Tl ","Pb ","Bi ","Po ","At ","Rn ", - "Fr ","Ra ", - "Ac ","Th ","Pa ","U ","Np ","Pu ","Am ","Cm ", "Bk ","Cf ","Es ","Fm ","Md ","No ","Lr ", - "Rf ","Db ","Sg ","Bh ","Hs ","Mt ","Ds ","Rg ","Uub", "Uut","Uuq","Uup","Uuh" ] + "H","He", + "Li","Be","B","C","N","O","F","Ne", + "Na","Mg","Al","Si","P","S","Cl","Ar", + "K ","Ca","Sc","Ti","V","Cr","Mn","Fe","Co","Ni","Cu","Zn","Ga","Ge", "As","Se","Br","Kr", + "Rb","Sr","Y","Zr","Nb","Mo","Tc","Ru","Rh","Pd","Ag","Cd","In","Sn", "Sb","Te","I","Xe", + "Cs","Ba", + "La","Ce","Pr","Nd","Pm","Sm","Eu","Gd","Tb","Dy","Ho","Er","Tm","Yb","Lu", + "Hf","Ta","W","Re","Os","Ir","Pt","Au","Hg","Tl","Pb","Bi","Po","At","Rn", + "Fr","Ra", + "Ac","Th","Pa","U","Np","Pu","Am","Cm", "Bk","Cf","Es","Fm","Md","No","Lr", + "Rf","Db","Sg","Bh","Hs","Mt","Ds","Rg","Uub", "Uut","Uuq","Uup","Uuh" ] element_mass = [-1., 1.00794, 4.00260, 6.941, 9.012187, 10.811, 12.0107, 14.00674, 15.9994, 18.99840, 20.1797, 22.98977, diff --git a/src/soap/soapy/lagraph.py b/src/soap/soapy/lagraph.py index 50d3848a6f46a3e8a99854bd8375176e8cee5fc4..f11db881d89b9cbce9f2f7bf65c7ba0fee6fe3e9 100644 --- a/src/soap/soapy/lagraph.py +++ b/src/soap/soapy/lagraph.py @@ -581,6 +581,30 @@ class ParticleGraph(object): elif descriptor_type == 'soap': # Structure structure = soap.tools.setup_structure_ase(self.label, atoms) + # Customize density + density_type = options["atomic_density"]["density_type"] + use_covrad = options["atomic_density"]["use_covrad"] + atom_rad_scale = float(options["atomic_density"]["atomic_radius"]) + # ... Particle radii + if use_covrad: + radius_map = soap.soapy.elements.periodic_table.getPropertyDict("covrad", convert=lambda x: x*atom_rad_scale) + else: + radius_map = {} + for elem in soap.soapy.elements.PeriodicTable.element_names: + radius_map[elem] = atom_rad_scale + # ... Particle 'charge' + if density_type == "elneg_density": + charge_map = soap.soapy.elements.periodic_table.getPropertyDict("elneg") + elif density_type == "z_density": + charge_map = soap.soapy.elements.periodic_table.getPropertyDict("z") + elif density_type == "number_density": + charge_map = {} + for elem in soap.soapy.elements.PeriodicTable.element_names: + charge_map[elem] = 1. + else: + raise NotImplementedError("Density type '%s'" % density_type) + # ... Apply + soap.tools.setup_structure_density(structure, radius_map=radius_map, charge_map=charge_map) # Options options_soap = soap.Options() for item in options_descriptor.items():