sp2graph.graph
¶
This module contains functions for dealing with the graph representation of carbon sp2 geometries.
-
sp2graph.graph.
adjacencyG
(V, L=None, radius=1.6)[source]¶ Returns the adjacency matrix (which indicates if there is an edge, 1, or not, 0, between two vertex) from the first neighbours analysis from the vertices in V. Case the lattice vectors are provided in the matrix L, analyses the neighbors from periodic cells.
-
sp2graph.graph.
adjacencySelfIntG
(V)[source]¶ Returns the adjacency matrix (which indicates if there is an edge, 1, or not, 0, between two vertex) from the first neighbours analysis from the vertices in V and include “self-interaction” diagonal term (on elements with only two neighbours)
-
sp2graph.graph.
checkPeriodic
(v1, v2, L, radius=1.6)[source]¶ Recieve two vertices v1 and v2 and check whether they are connected via periodic cells. If so, returns v2 displaced by the corresponding lattice vectors. To be used when plotting bonds across periodic cells.
-
sp2graph.graph.
periodicDirections
(V, L, radius=1.6)[source]¶ Check the periodicity and return an n by 2 array like pdir that indicates the n periodic directions. Note that we assume inversion symmetry, so if the system is periodic in L[0] then we do not need to include/check -L[0].
Returns: If the system is periodic, for each periodic direction stack
[1, 0, 0] for periodicity in L[0], [0, 1, 0] for periodicity in L[1], [1, 1, 0] for periodicity in L[0]+L[1], [1, -1, 0] for periodicity in L[0]-L[1]
(note that inversion symmetry is assumed).
If the system is NOT periodic returns None.
-
sp2graph.graph.
revCMK
(G, V)[source]¶ Reverse Cuthill-McKee algorithm implementation. Returns an array with the labell order.
-
sp2graph.graph.
allKekules
(G, iniV, C=None, rad=None)[source]¶ Interface for calling recursive function returning all Kekule structures
-
sp2graph.graph.
basisCyclesGibbs
(G, iniV=0)[source]¶ Returns a set of fundamental cycles from the graph G. The root of the spanning tree to be created can be provided as iniV.
Based on N. Gibbs, Commun. ACM 18(5), 275-276 (1975).