SINGROUP/dscribe

Can dscribe encode the atom type not in the list as "unkown type" in acsf calculation?

zjujdj opened this issue · 2 comments

hi, some atom types in my system are not such abundant, if i want to successful calculate the acsf descriptors for those systems, i must add the un-abundant atom types into the atom list, and result in the quick increase of acsf descriptors demension. So, can dscribe encode the un-abundant atom types into an unified "unkown type" and successful calculate the acsf descriptors for such systems?

many thanks!

atoms_sybols = ['C', 'O', 'N', 'S', 'P', 'F', 'Cl', 'H', 'Br', 'B', 'I']  # pdb2020 without metal
atoms_sybols = ['C', 'O', 'N', 'S', 'P', 'F', 'Cl', 'H', 'Br', 'B', 'I', 'Zn', 'Mg', 'Mn', 'Ca', 'Na', 'Fe', 'Co', 'Ni', 'K', 'Cd', 'Cu', 'Ru', 'Se']  # pdb2020
acsf = ACSF(
    species=atoms_sybols,
    rcut=8.0,
    g2_params=[[4.0, 3.17]],
    g4_params=[[0.1, 3.14, 1]],
)

Hi @zjujdj!

This you can do when you are instantiating the ASE.Atoms objects: just change the chemical species there before feeding them into ascf.create(). Example:

import numpy as np
from ase import Atoms
from dscribe.descriptors import ACSF

# Configure ACSF with a subset of species: X in this context would mean your
# unknown types.
acsf = ACSF(species=["H", "X"], rcut=1)

# This is the original system
a = Atoms(["H", "O", "C"], positions=np.random.rand(3, 3))

# Merge "unimportant" atoms under the species X.
important_atoms = set(["H"])
a.set_chemical_symbols(list(map(lambda x: x if x in important_atoms else "X", a.get_chemical_symbols())))

# Create output
output = acsf.create(a)

Because this is quite easy to do when preparing your dataset, there is no specific functionality for doing this directly with dscribe.

@lauri-codes
ohh...that looks good! many thanks, bro.