Lincege
Documentation for Lincege, a julia package for computing LINked Cluster Expansions on a GEneral geometry (LINCEGE).
The general pipeline is:
Define a unit cell and lattice geometry.
Generate all unique clusters up to a desired order using a cluster set and hasher.
Build an Expansion from those clusters.
Call summation! to populate the NLCE weights.
Export results with write_to_json.See the online documentation for worked examples on the square lattice, Kagome lattice, and Pyrochlore unit cell.
Lincege.Lincege — Module
A julia package for computing LINked Cluster Expansions on a GEneral geometry (LINCEGE).
The general pipeline is:
- Define a unit cell and lattice geometry.
- Generate all unique clusters up to a desired order using a cluster set and hasher.
- Build an
Expansionfrom those clusters. - Call
summation!to populate the NLCE weights. - Export results with
write_to_json.
See the online documentation for worked examples on the square lattice, Kagome lattice, and Pyrochlore unit cell.
Lincege.AbstractCluster — Type
AbstractClusterAbstract base type for a single cluster — a connected subgraph of the lattice with an associated lattice coefficient used in the NLCE summation.
Subtypes must implement:
Base.length(c)— number of sites (vertices) in the clusterBase.hash(c, h)— the cluster's graph hash (ghash)
Lincege.AbstractClusterExpansionLattice — Type
AbstractClusterExpansionLattice <: AbstractInfiniteLatticeAbstract base type for lattices where each expansion vertex represents a cluster of physical sites (a unit cell), rather than a single site.
Subtypes must implement all methods of AbstractInfiniteLattice, plus:
n_site_colors(lattice)— number of distinct site colors in the latticeconnections(lattice)— mapping from expansion vertices to their constituent lattice vertices
Lincege.AbstractClusterSet — Type
AbstractClusterSet{C<:AbstractCluster, H<:AbstractHasher}Abstract base type for a collection of unique clusters sharing a common hasher. Clusters that are equivalent under the hasher's symmetry are merged
Subtypes must implement:
Base.length(cs)— number of stored clustersBase.in(c, cs)— membership testBase.iterate(cs)/Base.iterate(cs, state)— iteration over clustersBase.push!(cs, c)— add a clusterBase.pop!(cs, c)— remove and return a clusterghash(cs, c)/ghash(cs, vs)— delegate to the hasher
Lincege.AbstractExpansion — Type
AbstractExpansionAbstract base type for an NLCE expansion. Stores the subgraph relationships between clusters and the weight matrix that summation! populates.
Subtypes must implement:
Base.getindex(e, cluster_id, order)— weight for a cluster at a given orderBase.length(e)— total number of clusters (including single-site terms)add_array!(e, order, per_cluster)— accumulate a per-cluster vector into the weights atorderorder_ids(e, order)— indices of all clusters first appearing atorderget_subclusters(e, cluster_id)— indices of all strict subclusters ofcluster_idorder_offset(e)—0for site expansions,1for cluster expansions
Lincege.AbstractHasher — Type
AbstractHasherAbstract base type for cluster hashing. A hasher maps a vertex set to a graph hash, with two vertex sets receiving the same hash if and only if they are equivalent under the symmetry the hasher preserves.
Subtypes must implement:
ghash(hasher, vs::LatticeVertices)— hash for a Site Expansionsghash(hasher, vs::ExpansionVertices)— hash for a Cluster Expansion
Lincege.AbstractInfiniteLattice — Type
AbstractInfiniteLattice <: AbstractLatticeAbstract base type for an infinite lattice used to enumerate clusters.
Subtypes must implement all methods of AbstractLattice, plus:
n_unique_sites(lattice)— number of translationally-inequivalent sites in the lattice
Lincege.AbstractLattice — Type
AbstractLatticeAbstract base type for a lattice geometry.
Subtypes must implement:
centers(lattice)— vertex set(s) used as DFS roots when generating clustersmax_order(lattice)— maximum cluster order (number of sites) to generateneighbors(lattice, vs)— vertex indices adjacent to the vertex setvsbut not in itget_coordinates(lattice)— Cartesian coordinate matrix (dim × n_sites)get_labels(lattice)— translation labels for each siteget_site_colors(lattice)— site colors for each sitebond_matrix(lattice)— integer adjacency matrix encoding bond types
Lincege.AbstractVertices — Type
AbstractVertices{V}Abstract base type for a set of vertices of element type V.
Subtypes must implement:
vertices(vs)— return the underlying iterable of vertex indicesBase.collect(vs)— return a sortedVector{V}Base.sort(vs)— return a sorted copyBase.intersect(vs1, vs2)— set intersectionBase.setdiff(vs1, vs2)— set differenceBase.union(vs1, vs2)— set union (two-argument form)Base.in(v, vs)— membership testBase.eltype(vs)— element typeV
Lincege.Bond — Type
Bond(site1, site2, direction, bond_type)Bond of given type between two sites along the given direction, in primitive lattice vector notation
Lincege.Expansion — Type
Expansion(clusters, lattice, max_order)Arbitrary expansion of clusters in the NLCE sense, contains the weights necessary to perform the NLCE summation.
Lincege.ExpansionBond — Type
ExpansionBond(site1, site2, direction, bond_type)Bond of given type between two sites inside of the expansion basis, indexed [expansion basis, element number] along the given direction, in primitive lattice vector notation
Lincege.ExpansionUnitCell — Type
ExpansionUnitCell(basis, primitive_vectors, site_colors, bonds, expansion_bonds)Unit cell containing the given information, generally to be used for a cluster expansion. The bonds are between sites in the basis, and the expansion bonds are between the unit cells in the expansion. Coordinates are written [x1 x2 x3 ...; y1 y2 y3 ...; z1 z2 z3 ...;].
Lincege.NotImplementedError — Type
NotImplementedError{M}(m)Exception thrown when a method required for a NLCE is not implemented. Taken directly from Graphs.jl.
Lincege.SiteExpansionLattice — Type
SiteExpansionLattice(max_order, unit_cell)An infinite lattice that contains the information necessary to perform the site expansion utilizing the given unit_cell
Lincege.UnitCell — Type
UnitCell(basis, primitive_vectors, bonds, site_colors)Unit cell containing the given information, generally to be used for a site expansion. Coordinates are written [x1 x2 x3 ...; y1 y2 y3 ...; z1 z2 z3 ...;].
Lincege.IsomorphicClusterSet — Method
IsomorphicClusterSet(lattice)ClusterSet constructor that initializes a ClusterSet with a hasher that preserves invariance under graph isomorphisms
Lincege.SymmetricClusterSet — Method
SymmetricClusterSet(lattice, symmetries)ClusterSet constructor that initializes a ClusterSet with a hasher that preserves invariance under the given point group symmetries of the lattice.
Lincege.TranslationClusterSet — Method
TranslationClusterSet(lattice)ClusterSet constructor that initializes a ClusterSet with a hasher that preserves translational invariance
Lincege.clusters_from_clusters! — Method
clusters_from_clusters!(new_clusters, old_clusters)Populates newclusters from the clusters inside oldclusters using the hasher inside the new_clusters ClusterSet
Lincege.clusters_from_lattice! — Method
clusters_from_lattice!(clusters, lattice; spawn_depth=3)Generates all clusters from an infinite lattice up till the given max_order, populates clusters with all the corresponding clusters reduced by the hashing function
Lincege.summation! — Method
summation!(expansion, max_order)Performs the recursive NLCE summation up till the max_order and populates the given expansion with the resultant weights
Lincege.unweighted_iso_hash — Method
Finds the canonical ordering of an edge-unlabeled cluster using Nauty. Returns (nauty_hash, permutation).
Lincege.weighted_iso_hash — Method
Finds the canonical ordering of an edge-labeled cluster using Nauty. Returns (nauty_hash, permutation).
Lincege.write_to_json — Method
write_to_json(expansion, lattice, clusters, filepath)Writes an expansion to a JSON file at the given filepath