5#ifndef SEAMS_TOPO_FINGERPRINT_H_
6#define SEAMS_TOPO_FINGERPRINT_H_
38using Rows = std::vector<std::vector<int>>;
66std::uint64_t
wlHash(
const std::vector<std::vector<int>> &adjacency,
int root,
67 int rounds,
const std::vector<int> &colours = {});
73 const std::vector<int> &colours = {});
78 const std::vector<int> &colours = {});
85 const std::vector<int> &dirtyAtoms,
86 int hops,
int maxRingSize = 7,
87 const std::vector<int> &colours = {});
90std::string
hex(std::uint64_t value);
132 int maxRingSize = 7,
const std::vector<int> &colours = {});
FrameFingerprint fingerprint(const Rows &rows, int hops=2, int maxRingSize=7, const std::vector< int > &colours={})
Keys of every atom, their histogram, the ring census up to maxRingSize, and the frame key.
std::uint64_t wlHash(const std::vector< std::vector< int > > &adjacency, int root, int rounds, const std::vector< int > &colours={})
Weisfeiler-Lehman refinement hash of a graph given by local adjacency lists; root (or -1) starts in i...
LibraryMatch matchLibraries(const Rows &rows, const std::vector< KeyLibrary > &libs, int maxRingSize=7, const std::vector< int > &colours={})
Match against libraries at several depths: an atom takes the label of the deepest library that holds ...
LocalKey localKey(const Rows &rows, int atom, int hops, const std::vector< int > &colours={})
Key of the rooted neighbourhood of atom.
std::string writeLibrary(const KeyLibrary &lib)
Text form: a header line # method M hops H colours C (C is 0 or 1; a header without it means uncolour...
FrameFingerprint incrementalFingerprint(const FrameFingerprint &prev, const Rows &rows, const std::vector< int > &dirtyAtoms, int hops, int maxRingSize=7, const std::vector< int > &colours={})
Recompute local keys only for the hop-ball of dirtyAtoms and keep the rest of prev.
std::string hex(std::uint64_t value)
Hex string of a 64-bit hash.
LibraryMatch matchLibrary(const FrameFingerprint &fp, const KeyLibrary &lib)
Look every atom key of fp up in lib.
std::vector< std::vector< int > > Rows
Neighbour rows by index, each row leading with the atom itself, as nneigh::neighbourListByIndex retur...
void addToLibrary(KeyLibrary &lib, const FrameFingerprint &fp, const std::string &label)
Add every distinct key of fp under label; a key already present under other labels carries all of the...
std::vector< int > hopNeighbourhood(const Rows &rows, int atom, int hops)
Atoms within hops bonds of atom, the atom itself first, then in breadth-first order.
KeyLibrary readLibrary(const std::string &text)
std::vector< std::uint64_t > wlAtom
per-atom WL hash used in the frame key
std::string method
method of the local keys
std::vector< std::string > atomKeys
one local key per atom
std::map< std::string, int > classes
local key -> number of atoms carrying it
bool coloured
keys carry vertex colours
std::string key
hash of the sorted local keys and the ring census
std::vector< int > ringCensus
ringCensus[s] = primitive rings of size s
A dictionary from local keys to labels: the keys of reference structures (a polymorph library),...
std::map< std::string, std::string > labelOf
key -> label
std::string method
"nauty" or "wl"
bool coloured
keys were computed with vertex colours
std::map< std::string, int > counts
label -> atoms, "" for unmatched
std::vector< std::string > labels
per atom; "" when no key matches
std::vector< int > depth
per atom: hops of the library that named it, 0 when none
int edges
bonds among them
std::string method
"nauty" or "wl"
int vertices
atoms in the neighbourhood, centre included
std::string key
canonical certificate or refinement hash