Persistent homology
Tools for computing persistence diagrams of local atomic environments, used to identify medium-range order and topological features.
!!! warning "Partially quarantined"
LocalPD and the standalone get_local_persistence function are currently broken and raise NotImplementedError on use. get_persistence_diagram works standalone. See Known Issues for details.
Requires the optional dionysus/diode dependencies — see Installation.
NOTE: LocalPD and the standalone get_local_persistence below are currently
broken and quarantined (raise NotImplementedError on use). Both were written
against neighborhood.get_persistence_diagram(...) as a bound method on
GlassAtoms/ASE Atoms, but that method was moved out into the standalone
get_persistence_diagram(atoms, ...) function in this module and the call
sites were never updated, so they fail with AttributeError. See
docs/vitrum/known_issues.md. get_persistence_diagram itself is unaffected
and works standalone.
get_local_persistence(atoms, center_id, cutoff)
Calculate the persistence diagram of the local environment of an atom.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
center_id
|
int or str
|
The atomic number or symbol of the central atom. |
required |
cutoff
|
float
|
The cutoff distance for the local environment. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
list |
A list of pandas.DataFrame containing the persistence diagram of the local environment. |
Source code in src/vitrum/persistent_homology.py
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | |
get_persistence_diagram(atoms, dimension=1, weights=None)
Calculate the persistence diagram of the given data points.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension
|
int
|
The dimension of the persistence diagram to calculate. Defaults to 1. |
1
|
weights
|
dict or list
|
The weights to assign to each data point. Can be a dictionary mapping chemical symbols to weights or a list of weights. Defaults to None. |
None
|
Returns:
| Type | Description |
|---|---|
|
pandas.DataFrame: The persistence diagram as a DataFrame with columns "Birth" and "Death". |
Source code in src/vitrum/persistent_homology.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | |