API Reference
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.kagome_unit_cell — Constant
kagome_unit_cellKagome-lattice unit cell (site expansion).
Lincege.pyrochlore_expansion_unit_cell — Constant
pyrochlore_expansion_unit_cellPyrochlore unit-cell expansion (ExpansionUnitCell, strong cluster expansion).
Lincege.square_cluster_expansion_unit_cell — Constant
square_cluster_expansion_unit_cellSquare-cluster unit-cell expansion (ExpansionUnitCell, weak cluster expansion).
Lincege.square_unit_cell — Constant
square_unit_cellSquare-lattice unit cell (site expansion).
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)lattice_constant- the cluster's lattice constant
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(cluster_set)- number of stored clustersBase.in(c, cluster_set)- membership testBase.iterate(cluster_set)/Base.iterate(cluster_set, state)- iteration over clustersBase.push!(cluster_set, c)- add a clusterBase.pop!(cluster_set, c)- remove and return a clusterBase.get(cluster_set, ghash, default)- look up a stored cluster by its graph hashghash(cluster_set, c)/ghash(cluster_set, vertices)- 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_hash)- get the cluster corresponding to thecluster_hasheach_order(e, max_order)- vector of clusters at each order up tillmax_order
Lincege.AbstractExpansionCluster — Type
AbstractExpansionClusterAbstract base type for an expansion cluster. Stores the subgraph information for a cluster, along with necessary information to write the cluster to disk.
Subtypes must implement:
subgraphs(cluster)- subgraph hashes of each subgraph within the clustersubtract_subcluster!(cluster, subcluster)- subtract the weight (W_p(c)) of the given subcluster from the corresponding cluster
Lincege.AbstractFiniteClusterExpansionLattice — Type
AbstractFiniteClusterExpansionLattice <: AbstractFiniteLatticeAbstract base type for finite lattices where each expansion vertex represents a cluster of physical sites rather than a single site.
Subtypes must implement all methods of AbstractFiniteLattice, plus:
n_site_colors(lattice)- number of distinct site colors in the latticeconnections(lattice)- mapping from expansion vertices to their constituent lattice vertices
Lincege.AbstractFiniteLattice — Type
AbstractFiniteLattice <: AbstractLatticeAbstract base type for a finite lattice used to enumerate clusters.
Subtypes must implement all methods of AbstractLattice, plus:
n_unique_sites(lattice)- total number of physical sites in the lattice
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, vertices::LatticeVertices)- hash for a Site Expansionsghash(hasher, vertices::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, vertices)- vertex indices adjacent to the vertex setverticesbut not in itget_coordinates(lattice)- Cartesian coordinate matrix (dim x 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.AbstractPhysicsSolver — Type
AbstractPhysicsSolverAbstract base type for calculating the physical observables of a single cluster. This serves as a reference implementation of the NLCE algorithm and a test set to ensure that the clusters are generated correctly.
Subtypes must implement:
eigenvalues()- eigenvalues of the cluster with respect to the modeleigenvectors()- eigenvectors of the cluster with respect to the modelcluster_weights()- NLCE weights of the cluster generated by Lincege.jl
Lincege.AbstractVertices — Type
AbstractVertices{V}Abstract base type for a set of vertices of element type V.
Subtypes must implement:
vertices(vertex_set)- return the underlying iterable of vertex indicesBase.collect(vertex_set)- return a sortedVector{V}Base.sort(vertex_set)- return a sorted copyBase.intersect(vertex_set1, vertex_set2)- set intersectionBase.setdiff(vertex_set1, vertex_set2)- set differenceBase.union(vertex_set1, vertex_set2)- set union (two-argument form)Base.in(v, vertex_set)- membership testBase.eltype(vertex_set)- 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.ConnectedHasher — Type
ConnectedHasher(lattice)Hasher that identifies clusters as equivalent if they are the exact same graphs.
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.ExpansionCluster — Type
ExpansionCluster(cluster, lattice)Cluster from a set of clusters that contains information necessary for summation! and writing to disk.
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.ExpansionVertices — Type
ExpansionVertices{V}A set of expansion-lattice vertices (TaggedVertices tagged :expansion), indexing sites of a cluster-expansion lattice's expansion unit cell.
Lincege.FiniteLattice — Type
FiniteLattice(dims, unit_cell, max_order; periodic=false)
FiniteLattice(dim_specs, unit_cell, max_order; periodic_dims=fill(false, N))
FiniteLattice(uc_positions, unit_cell, max_order; supercell_vecs=nothing)A finite lattice built from unit_cell for a site expansion.
Boundary conditions:
periodic=truegives full periodic boundary conditions based on the primitive lattice vectors- The
dim_specs - The
uc_positionsconstructor builds a lattice from an explicit list of unit-cell positions,supercell_vecsis then needed to be able to determine periodicity along the given axes in primitive lattice coordinates.
Lincege.FiniteStrongClusterExpansionLattice — Type
FiniteStrongClusterExpansionLattice(dims, expansion_unit_cell, max_order; periodic_dims=fill(false, N))A finite lattice for a strong-embedding cluster expansion of size dims unit cells. Each expansion vertex is a cluster (unit cell) of physical sites.
Pass periodic_dims to choose which dimensions use periodic boundary conditions; by default all boundaries are open.
Lincege.FiniteWeakClusterExpansionLattice — Type
FiniteWeakClusterExpansionLattice(dims, expansion_unit_cell, max_order; periodic_dims=fill(false, N))A finite lattice for a weak-embedding cluster expansion of size dims unit cells. Each expansion vertex is a cluster of physical sites.
Pass periodic_dims to choose which dimensions use periodic boundary conditions; by default all boundaries are open.
Lincege.ImportedCluster — Type
ImportedClusterA single cluster deserialized from a JSON file produced by write_to_json. To be used in subsequent physics algorithms
Lincege.IsingSolver — Type
IsingSolver <: AbstractPhysicsSolverConcrete implementation of a physics solver for the Ising model.
Lincege.IsomorphicHasher — Type
IsomorphicHasher(lattice)Hasher that identifies clusters equivalent under graph isomorphism, using Nauty for canonicalization.
Lincege.LatticeVertices — Type
LatticeVertices{V}A set of lattice vertices (TaggedVertices tagged :lattice), indexing physical sites of a lattice.
Lincege.NLCEResult — Type
NLCEResultStores the results of an NLCE computation, can be plotted by accessing temperatures and the corresponding observable.
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.StrongClusterExpansionLattice — Type
StrongClusterExpansionLattice(max_order, expansion_unit_cell)An infinite lattice for the strong-embedding cluster expansion up to max_order.
Lincege.SymmetricHasher — Type
SymmetricHasher(lattice, lattice_symmetries)Hasher that identifies clusters equivalent under the lattice's point-group symmetries.
Lincege.TranslationHasher — Type
TranslationHasher(lattice)Hasher that identifies clusters equivalent under lattice translations.
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.WeakClusterExpansionLattice — Type
WeakClusterExpansionLattice(max_order, expansion_unit_cell)An infinite lattice for the weak-embedding cluster expansion up to max_order.
Lincege.ConnectedClusterSet — Method
ConnectedClusterSet(lattice)ClusterSet constructor that initializes a ClusterSet with a hasher that treats each distinct set of vertices as unique.
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.apply_resummations — Method
apply_resummations(result, resummations)Applies resummations to a given NLCEResult in order of the given resummation vector. The vector is of the form [(:Euler, 3), (:Wynn, 4), ...] which translates to euler summation starting at order 3, and wynn's resummation with 4 cycles of improvement.
Lincege.cluster_weights — Method
cluster_weights(solver::AbstractPhysicsSolver)Return the NLCE weights of the solver's cluster as generated by Lincege.jl.
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.eigenvalues — Method
eigenvalues(solver::AbstractPhysicsSolver)Return the energy eigenvalues of the solver's cluster Hamiltonian.
Lincege.eigenvectors — Method
eigenvectors(solver::AbstractPhysicsSolver)Return the eigenvectors of the solver's cluster Hamiltonian.
Lincege.euler_resummation — Function
euler_resummation(result, sum_start)Performs euler's resummation technique for alternating series to an NLCE result. sumstart is the order index at which the Euler sum begins; the early orders (below sumstart) are left as bare sums.
Lincege.image_lattice — Function
image_lattice(unit_cell; cells=nothing)
image_lattice(expansion_unit_cell; cells=-2:2, show_expansion_bonds=false)Return a Plots object showing a repeated lattice in two or three dimensions. Load Plots and ColorSchemes first. cells supplies the integer translations along each primitive vector; cells=0:1 repeats two cells per direction. Ordinary UnitCell plots default to -6:6 in 2D and -2:2 in 3D. ExpansionUnitCell plots default to -2:2 in both dimensions.
For expansion cells, show_expansion_bonds=true adds dashed connections between element centers. Physical bonds retain their types, shared sites retain their colors, and coincident sites and duplicate physical bonds are drawn once as in image_unit_cell. Outgoing physical bonds include neighboring endpoints. The returned object can be saved with Plots.savefig.
Lincege.image_unit_cell — Function
image_unit_cell(unit_cell)
image_unit_cell(expansion_unit_cell; show_expansion_bonds=false)Return a Plots object showing the sites, physical bonds, and unlabeled primitive cell boundary in two or three dimensions. Load Plots and ColorSchemes first.
For an ExpansionUnitCell, enable show_expansion_bonds to draw dashed connections between expansion-element centers. Coincident sites with the same color and duplicate physical bonds of the same type are drawn once, matching coordinates rounded to ten decimal places. Neighboring physical bond endpoints are also marked as sites in expansion-cell plots.
Lincege.import_from_json — Method
import_from_json(filepath) -> Vector{ImportedCluster}Read a JSON file produced by write_to_json and return a vector of ImportedCluster, one per cluster entry in the file.
Lincege.import_from_json_by_order — Method
import_from_json_by_order(filepath) -> Vector{Vector{ImportedCluster}}Like import_from_json, but returns clusters grouped by order. The returned vector is indexed by order: result[order] holds all clusters of that order.
Lincege.observables — Method
observables(solver::AbstractPhysicsSolver, betas)Compute the thermodynamic observables of the solver's cluster at each inverse temperature in betas, returned as a NamedTuple of vectors (energy, specific_heat, entropy).
Lincege.perform_nlce — Method
perform_nlce(solvers, temperatures) -> NLCEResultCalls the given NLCE solvers and computes their corresponding observables.
Lincege.print_ascii_table — Method
print_ascii_table([io], expansion, cluster_sets, max_order)Prints an ASCII table akin to those found in scientific papers that utilize NLCE.
Lincege.print_html_table — Method
print_html_table([io], expansion, cluster_sets, max_order)Prints an HTML table akin to those found in scientific papers that utilize NLCE.
Lincege.print_latex_table — Method
print_latex_table([io], expansion, cluster_sets, max_order)Prints a LaTeX table akin to those found in scientific papers that utilize NLCE.
Lincege.reduce_clusters! — Method
reduce_clusters!(new_clusters, old_clusters)Populate new_clusters by grouping clusters in old_clusters using the destination hasher and summing the lattice constants of equivalent clusters. Return new_clusters.
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.weights — Method
weights(e::Expansion, order::Int) -> Dict{UInt, Float64}Return the NLCE weights at the given order for all clusters. Call summation! first to populate the underlying weights.
Lincege.write_to_json — Method
write_to_json(expansion, lattice, filepath)Serialize an Expansion and its associated lattice geometry to a JSON file at filepath.
cluster_hash- unique cluster identifier (string representation of UInt64)order- 1-based order index into the expansion'sorder_idsn_sites- number of sites in the clustercoordinates- list of Cartesian coordinate vectors (one per site)site_colors- list of integer site-color labels (one per site)bonds- edge list[i, j, weight]using local 1-based indicesweights- vector of weights per order for the cluster
Lincege.write_to_json — Method
write_to_json(iso_expansion, iso_set, sym_expansion, sym_set, lattice, filepath)Serialize an Expansion and its associated lattice geometry to a JSON file at filepath. The file contains a similar output to the original writetojson function, but with the addition of relating multiple symmetrically distinct clusters to their isomorphic equivalent.
Lincege.write_to_txt_file — Method
write_to_txt_file(expansion, lattice, filepath)Write the same cluster data as write_to_json in a colon-separated text format, with one line per cluster:
n_sites : cluster_hash : bonds : coordinates : site_colors : weights : order
Lincege.write_to_txt_file — Method
write_to_txt_file(iso_expansion, iso_set, sym_expansion, sym_set, lattice, filepath)Write all fields of the joint write_to_json export as colon-separated records:
isomorphic : n_sites : cluster_hash : canonical_bonds : canonical_site_colors : weights : order
symmetric : isomorphic_hash : cluster_hash : permuted_coordinates : weights
Lincege.wynn_resummation — Function
wynn_resummation(result, n_cycles)Performs wynn's resummation technique based on pade approximants to an NLCE result. The number of cycles of improvement should generally be maximized, this is the default.