Triangular Lattice
This example computes the linked cluster expansion on a triangular lattice up to order 3.
Setup
Define the triangular unit cell:
using Lincege
triangular_basis = [[0.0, 0.0]]
triangular_pvecs = [[1.0, 0.0], [1.0/2, sqrt(3)/2]]
triangular_bonds = [Bond(1,1,[1,0],1),Bond(1,1,[0,1],1),Bond(1,1,[-1,1],1)]
triangular_uc = UnitCell(triangular_basis, triangular_pvecs, triangular_bonds, [1])UnitCell([0.0; 0.0;;], [1.0 0.5; 0.0 0.8660254037844386], [1], Bond[Bond(1, 1, [1, 0], 1), Bond(1, 1, [0, 1], 1), Bond(1, 1, [-1, 1], 1)])One site and two primitive vectors at 60 degrees generate the triangular lattice. The offsets [1, 0], [0, 1], and [-1, 1] select three bond directions; their reverses complete the six neighbors. Equal site colors and bond types treat these sites and interactions as equivalent.
Imaging the unit cell and lattice
Load Plots and ColorSchemes to activate Lincege.jl's plotting capabilities.
using Plots, ColorSchemes
image_unit_cell(triangular_uc)image_lattice(triangular_uc)Building the lattice and clusters
The following code generates clusters up to order 3, starting with translational clusters and reducing to isomorphic clusters.
m_order = 3
lattice = SiteExpansionLattice(m_order, triangular_uc)
trans_clusters = TranslationClusterSet(lattice)
clusters_from_lattice!(trans_clusters, lattice)
iso_clusters = IsomorphicClusterSet(lattice)
reduce_clusters!(iso_clusters, trans_clusters)ClusterSet{IsomorphicHasher} with 4 clustersComputing the expansion
The final NLCE expansion weights are computed recursively.
expansion = Expansion(iso_clusters, lattice)
summation!(expansion, m_order)Expansion(Dict{UInt64, Lincege.ExpansionCluster}(0x757e0ac51ad2d852 => Lincege.ExpansionCluster(Vertices: [13, 19, 25], 9.0, UInt64[0x6a7f9b876202d912, 0x14acd1057b698a40, 0x14acd1057b698a40, 0x6a7f9b876202d912, 0x14acd1057b698a40], Dict{UInt64, Float64}(0x757e0ac51ad2d852 => 1.0, 0x6a7f9b876202d912 => -2.0, 0x14acd1057b698a40 => 1.0)), 0xae4199ce7ea02294 => Lincege.ExpansionCluster(Vertices: [18, 24, 25], 2.0, UInt64[0x6a7f9b876202d912, 0x14acd1057b698a40, 0x14acd1057b698a40, 0x6a7f9b876202d912, 0x6a7f9b876202d912, 0x14acd1057b698a40], Dict{UInt64, Float64}(0xae4199ce7ea02294 => 1.0, 0x6a7f9b876202d912 => -3.0, 0x14acd1057b698a40 => 3.0)), 0x14acd1057b698a40 => Lincege.ExpansionCluster(Vertices: [25], 1.0, UInt64[], Dict{UInt64, Float64}(0x14acd1057b698a40 => 1.0)), 0x6a7f9b876202d912 => Lincege.ExpansionCluster(Vertices: [19, 25], 3.0, UInt64[0x14acd1057b698a40, 0x14acd1057b698a40], Dict{UInt64, Float64}(0x6a7f9b876202d912 => 1.0, 0x14acd1057b698a40 => -2.0))), Vector{UInt64}[[0x14acd1057b698a40], [0x6a7f9b876202d912], [0x757e0ac51ad2d852, 0xae4199ce7ea02294]], 0)Writing to JSON
Lastly, write the results to a JSON file for future computations.
write_to_json(expansion, lattice, joinpath(output_dir, "triangular_lattice_site_expansion.json"))