catkit.pawprint package

Submodules

catkit.pawprint.generator module

class catkit.pawprint.generator.Fingerprinter(images=None)[source]

Parent class for all fingerprint generators.

get_fp(parameters, operation_list)[source]

Return the fingerprints for a list of images of single atoms object for the given parameters. Convolutions will be performed for specific operations if the parameters is provided as a list of lists.

Parameters:
  • parameters (list of str | list of lists (M,)) – Names of seeding parameters available in the parameters database. If a list lists is provided, the number of lists must be equal to the number of operations.
  • operation_list (list of func | str (M,)) – A list of operation functions to produce the fingerprints from. The names (str) of operations functions can also be used.
Returns:

fingerprints – Fingerprints for the images produced from the provided seed parameters.

Return type:

ndarray (N, X)

catkit.pawprint.generator.get_connectivity(atoms, method=None)[source]

Returns an estimate of the connectivity matrix for a given atoms-object from CatGen.

Parameters:
  • atoms (object) – Molecular structure with out without adsorbates.
  • method (str (None or 'voronoi')) –

    Method for estimating the connectivity matrix:

    None - standard cutoff radius method. voronoi - best suited for bulk characterization.

Returns:

connectivity – Estimated connectivity matrix where n is the number of atoms in the atoms-object.

Return type:

ndarray (N, N)

catkit.pawprint.operations module

catkit.pawprint.operations.autocorrelation(atoms=None, atoms_parameters=None, connectivity=None, d=0)[source]

Autocorrelation convolution for systems without pbc.

catkit.pawprint.operations.bonding_convolution(atoms=None, atoms_parameters=None, connectivity=None)[source]

Perform convolution of metal atoms with bonded adsorbates.

catkit.pawprint.operations.derived_fp(atoms=None, atoms_parameters=None, connectivity=None, fp_1=None, fp_2=None, n_1=None, n_2=None, op=None)[source]

NOTE : This is a work in progress. I’ll redesign the whole thing to allow for arithmetic manipulation of two fingerprints.

Given two fingerprints vector, it will perform arithmetic operation to design new fingerprints.

Parameters:op (str ('add' | 'subtract' | 'divide' | 'multiply')) –

add - Adds two fingerprints of equal length raised to their given power subtract - subtracts two fingerprints of equal length raised to

their given power
mulltiply - multiply two fingerprints of equal length raised to
their given power
divide - divide two fingerprints of equal length raised to their
given power
catkit.pawprint.operations.layered_sum(atoms=None, atoms_parameters=None, connectivity=None)[source]

Sum of the properties in a layer as indicated by catkit tags.

catkit.pawprint.operations.local_ads_metal_fp(atoms=None, atoms_parameters=None, connectivity=None, fuse=False)[source]

Sum of the differences in properties of the atoms in the metal-adsorbate interface

catkit.pawprint.operations.periodic_convolution(atoms=None, atoms_parameters=None, connectivity=None, d=0, normalize=False)[source]

Return the square of each property with each atom. For distance 1 the covolutions returns the multiple of each property for all neighboring atom pairs.

catkit.pawprint.operations.raw_properties(atoms=None, atoms_parameters=None, connectivity=None)[source]

Return all atom properties without manipulation.

Module contents

class catkit.pawprint.Fingerprinter(images=None)[source]

Parent class for all fingerprint generators.

get_fp(parameters, operation_list)[source]

Return the fingerprints for a list of images of single atoms object for the given parameters. Convolutions will be performed for specific operations if the parameters is provided as a list of lists.

Parameters:
  • parameters (list of str | list of lists (M,)) – Names of seeding parameters available in the parameters database. If a list lists is provided, the number of lists must be equal to the number of operations.
  • operation_list (list of func | str (M,)) – A list of operation functions to produce the fingerprints from. The names (str) of operations functions can also be used.
Returns:

fingerprints – Fingerprints for the images produced from the provided seed parameters.

Return type:

ndarray (N, X)

class catkit.pawprint.FingerprintDB(db_name='fingerprints.db', verbose=False)[source]

A class for accessing a temporary SQLite database. This function works as a context manager and should be used as follows:

with FingerprintDB() as fpdb:
(Perform operation here)

This syntax will automatically construct the temporary database, or access an existing one. Upon exiting the indentation, the changes to the database will be automatically committed.

create_table()[source]

Creates the database table framework used in SQLite. This includes 3 tables: images, parameters, and fingerprints.

The images table currently stores ase_id information and a unqiue string. This can be adapted in the future to support atoms objects.

The parameters table stores a symbol (10 character maximum) for convenient reference and a description of the parameter.

The fingerprints table holds a unique image and parmeter ID along with a float value for each. The ID pair must be unique.

fingerprint_entry(ase_id, param_id, value)[source]

Enters a fingerprint value to the database for a given ase and parameter id.

Parameters:
  • ase_id (int) – The unique id associated with an atoms object in the database.
  • param_id (int or str) – The parameter ID or symbol associated with and entry in the parameters table.
  • value (float) – The value of the parameter for the atoms object.
get_fingerprints(ase_ids=None, params=[])[source]

Get the array of values associated with the provided parameters for each ase_id.

Parameters:
  • ase_id (list) – The ase-id associated with an atoms object in the database.
  • params (list) – List of symbols or int in parameters table to be selected.
Returns:

fingerprint – An array of values associated with the given parameters (a fingerprint) for each ase_id.

Return type:

array (n,)

get_parameters(selection=None, display=False)[source]

Get an array of integer values which correspond to the parameter IDs for a set of provided symbols.

Parameters:
  • selection (list) – Symbols in parameters table to be selected. If no selection is made, return all parameters.
  • display (bool) – Print parameter descriptions.
Returns:

parameter_ids – Integer values of selected parameters.

Return type:

array (n,)

image_entry(d, identity=None)[source]

Enters a single ase-db image into the fingerprint database. The ase-db ID with identity must be unique. If not, it will be skipped.

This table can be expanded to contain atoms objects in the future.

Parameters:
  • d (ase-db object) – Database entry to parse.
  • identity (str) – An identifier of the users choice.
Returns:

ase_id – The ase id collected.

Return type:

int

parameter_entry(symbol=None, description=None)[source]

Enters a unique parameter into the database.

Parameters:
  • symbol (str) – A unique symbol the entry can be referenced by. If None, the symbol will be the ID of the parameter as a string.
  • description (str) – A description of the parameter.