Lieb Lattice

This example computes the linked cluster expansion on a Lieb lattice up to order 3.

Setup

Define the three-site Lieb unit cell:

using Lincege

lieb_basis = [[0.0, 0.0], [0.0, 1.0], [1, 0]]
lieb_pvecs = [[2.0, 0.0], [0.0, 2.0]]
lieb_bonds = [Bond(1,3,[1,0],1), Bond(1,2,[0,1],2)]
lieb_uc = UnitCell(lieb_basis, lieb_pvecs, lieb_bonds, [1, 1, 1])
UnitCell([0.0 0.0 1.0; 0.0 1.0 0.0], [2.0 0.0; 0.0 2.0], [1, 1, 1], Bond[Bond(1, 3, [1, 0], 1), Bond(1, 2, [0, 1], 2)])

The three-site basis contains a corner site and two edge sites. The offsets [1, 0] and [0, 1] connect to sites in neighboring cells. Bond types 1 and 2 distinguish the horizontal and vertical interactions, while equal site colors treat all sites as the same species.

Imaging the unit cell and lattice

Load Plots and ColorSchemes to activate Lincege.jl's plotting capabilities.

using Plots, ColorSchemes
image_unit_cell(lieb_uc)
Example block output
image_lattice(lieb_uc)
Example block output

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, lieb_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 clusters

Computing the expansion

The final NLCE expansion weights are computed recursively.

expansion = Expansion(iso_clusters, lattice)
summation!(expansion, m_order)
Expansion(Dict{UInt64, Lincege.ExpansionCluster}(0x68d4087bc8f29d5c => Lincege.ExpansionCluster(Vertices: [25, 81, 124], 0.3333333333333333, UInt64[0x14acd1057b698a40, 0x40656f98f1e86c11, 0x14acd1057b698a40, 0x6a7f9b876202d912, 0x14acd1057b698a40], Dict{UInt64, Float64}(0x68d4087bc8f29d5c => 1.0, 0x14acd1057b698a40 => 1.0, 0x40656f98f1e86c11 => -1.0, 0x6a7f9b876202d912 => -1.0)), 0x14acd1057b698a40 => Lincege.ExpansionCluster(Vertices: [123], 1.0, UInt64[], Dict{UInt64, Float64}(0x14acd1057b698a40 => 1.0)), 0x6a7f9b876202d912 => Lincege.ExpansionCluster(Vertices: [25, 124], 0.3333333333333333, UInt64[0x14acd1057b698a40, 0x14acd1057b698a40], Dict{UInt64, Float64}(0x6a7f9b876202d912 => 1.0, 0x14acd1057b698a40 => -2.0)), 0x40656f98f1e86c11 => Lincege.ExpansionCluster(Vertices: [25, 81], 0.3333333333333333, UInt64[0x14acd1057b698a40, 0x14acd1057b698a40], Dict{UInt64, Float64}(0x40656f98f1e86c11 => 1.0, 0x14acd1057b698a40 => -2.0))), Vector{UInt64}[[0x14acd1057b698a40], [0x6a7f9b876202d912, 0x40656f98f1e86c11], [0x68d4087bc8f29d5c]], 0)

Writing to JSON

Lastly, write the results to a JSON file for future computations.

write_to_json(expansion, lattice, joinpath(output_dir, "lieb_lattice_site_expansion.json"))