The fingerprint generator is designed to be a general purpose utility for returning manipulated parameters from a list of possible operations. The possible operations which are currently implemented cat be found in ./catogm/fingerprint/operations.py.
The complete list of seeding parameters which can be called from is available from the data dictionary produced from Mendeleev.
import json
from pprint import pprint
with open('./catogm/data/properties.json', 'r') as f:
data = json.load(f)
pprint(list(data.keys()))
A list of atoms objects can also be passed to any of the generators.This will increase the dimensionality of the numpy array returned by 1 for each atoms object in the supplied list of images. Fingerprints produced in this way are returned in the same order as the list of objects provided.
Currently, the fingerprint generator has operations for producing convolutions over all atoms in a provided list of atoms objects. These are either:
periodic_convolution_r0
Calculates the square of each atoms parameter in the unit cell.
periodic_convolution_r1
Multiplies the parameter of a given atom by its next nearest neighbors parameter types.
from catogm.fingerprint import Fingerprinter
from catogm.fingerprint.operations import convolution_d0
from catogm.fingerprint.operations import convolution_d1
from ase.build import fcc111
from ase.build import bulk
bulk = bulk('Pd', cubic=True)
bulk[3].symbol = 'Pt'
slab = fcc111('Al', size=(2, 2, 3), a=3.8, vacuum=10.0)
images = [bulk, slab]
parameters = [
'atomic_number',
'atomic_radius',
'atomic_volume',
'atomic_weight',
'dband_center_bulk',
'dband_width_bulk',
'dband_skewness_bulk',
'dband_kurtosis_bulk'
]
operations = [
convolution_d0,
convolution_d1
]
fp = Fingerprinter(images)
fingerprints = fp.get_fp(parameters, operations)
print(fingerprints)
Localized fingerprints can also be generated. This is demonstrated for a catalytic structure of Palladium with a single Carbon adsorbate.
from catogm.fingerprint import Fingerprinter
from catogm.fingerprint.operations import bonding_convolution
from ase.build import fcc111
from ase.build import add_adsorbate
atoms = fcc111('Pd', size=(2, 2, 3), vacuum=10.0)
add_adsorbate(atoms, 'C', 1, 'fcc')
# -1 is the tag convention to identify bonded atoms
tags = atoms.get_tags()
tags[-1] = -1
atoms.set_tags(tags)
parameters = [
'atomic_number',
'atomic_radius',
'atomic_volume',
'atomic_weight',
'boiling_point',
'covalent_radius_cordero',
'dipole_polarizability',
'electron_affinity',
'en_pauling',
'en_allen',
'en_ghosh',
'evaporation_heat',
'fusion_heat',
'group_id',
'period',
'heat_of_formation',
'melting_point',
'metallic_radius',
'specific_heat',
'thermal_conductivity',
'vdw_radius',
'dband_center_slab',
'dband_width_slab',
'dband_skewness_slab',
'dband_kurtosis_slab'
]
operations = [
bonding_convolution
]
fp = Fingerprinter(atoms)
fingerprints = fp.get_fp(parameters, operations)
print(fingerprints)
Currently, the default structure of and operation is as follows:
def periodic_convolution_r0( atoms, atoms_properties, connectivity):
Where the atoms
, atoms_properties
, and connectivity
properties are required. This is because these properties are passed to all operation functions currently implemented so that they do not need to be generated multiple times. This way change in future versions if it seems that these are better suited as global variables (This may makes the code overly difficult to follow).
Here is an example of a simple operation which supplies the adsorbate connectivity.
from catogm.fingerprint import Fingerprinter
from catogm.fingerprint.operations import bonding_convolution
from ase.build import fcc111
from ase.build import add_adsorbate
import numpy as np
atoms = fcc111('Pd', size=(2, 2, 3), vacuum=10.0)
add_adsorbate(atoms, 'C', 1, 'fcc')
# -1 is the tag convention to identify bonded atoms
tags = atoms.get_tags()
tags[-1] = -1
atoms.set_tags(tags)
parameters = [
'atomic_number',
'dband_center_slab',
'dband_width_slab',
'dband_skewness_slab',
'dband_kurtosis_slab'
]
def example_operation(
atoms,
atoms_properties,
connectivity):
# This is a CatKit convention
bond_index = np.where(atoms.get_tags() == -1)[0]
return np.sum(connectivity[bond_index], axis=1)
operations = [
bonding_convolution,
example_operation
]
fp = Fingerprinter(atoms)
fingerprints = fp.get_fp(parameters, operations)
print(fingerprints)