One Fifth Depleted Lattice

This example computes the linked cluster expansion on a one fifth depleted lattice up to order 3.

Setup

Define the one-fifth-depleted unit cell:

using Lincege

one_fifth_basis = [[0.0, 0.0], [0.0, 1.0], [0.0, 2.0],[1.0,1.0]]
one_fifth_pvecs = [[2.0, 1.0], [-1.0, 2.0]]
one_fifth_bonds = [Bond(1,2,[0,0],1),Bond(1,3,[0,-1],1),Bond(2,4,[0,0],1), Bond(3,4,[0,1],1),Bond(2,3,[0,0],2),Bond(1,4,[-1,0],2)]
one_fifth_uc = UnitCell(one_fifth_basis, one_fifth_pvecs, one_fifth_bonds, [1, 1, 1, 1])
UnitCell([0.0 0.0 0.0 1.0; 0.0 1.0 2.0 1.0], [2.0 -1.0; 1.0 2.0], [1, 1, 1, 1], Bond[Bond(1, 2, [0, 0], 1), Bond(1, 3, [0, -1], 1), Bond(2, 4, [0, 0], 1), Bond(3, 4, [0, 1], 1), Bond(2, 3, [0, 0], 2), Bond(1, 4, [-1, 0], 2)])

Four basis sites and two tilted primitive vectors define the depleted square geometry. Zero-offset bonds connect sites within the cell; the other offsets connect neighboring cells. Bond types 1 and 2 distinguish two interaction families, 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(one_fifth_uc)
Example block output
image_lattice(one_fifth_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, one_fifth_uc)

trans_clusters = TranslationClusterSet(lattice)
clusters_from_lattice!(trans_clusters, lattice)

iso_clusters = IsomorphicClusterSet(lattice)
reduce_clusters!(iso_clusters, trans_clusters)
ClusterSet{IsomorphicHasher} with 5 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, 73, 171], 2.0, UInt64[0x14acd1057b698a40, 0x14acd1057b698a40, 0x40656f98f1e86c11, 0x14acd1057b698a40, 0x6a7f9b876202d912], Dict{UInt64, Float64}(0x68d4087bc8f29d5c => 1.0, 0x14acd1057b698a40 => 1.0, 0x40656f98f1e86c11 => -1.0, 0x6a7f9b876202d912 => -1.0)), 0x757e0ac51ad2d852 => Lincege.ExpansionCluster(Vertices: [25, 74, 116], 1.0, UInt64[0x6a7f9b876202d912, 0x14acd1057b698a40, 0x6a7f9b876202d912, 0x14acd1057b698a40, 0x14acd1057b698a40], Dict{UInt64, Float64}(0x757e0ac51ad2d852 => 1.0, 0x6a7f9b876202d912 => -2.0, 0x14acd1057b698a40 => 1.0)), 0x6a7f9b876202d912 => Lincege.ExpansionCluster(Vertices: [25, 74], 1.0, UInt64[0x14acd1057b698a40, 0x14acd1057b698a40], Dict{UInt64, Float64}(0x6a7f9b876202d912 => 1.0, 0x14acd1057b698a40 => -2.0)), 0x14acd1057b698a40 => Lincege.ExpansionCluster(Vertices: [172], 1.0, UInt64[], Dict{UInt64, Float64}(0x14acd1057b698a40 => 1.0)), 0x40656f98f1e86c11 => Lincege.ExpansionCluster(Vertices: [74, 123], 0.5, UInt64[0x14acd1057b698a40, 0x14acd1057b698a40], Dict{UInt64, Float64}(0x40656f98f1e86c11 => 1.0, 0x14acd1057b698a40 => -2.0))), Vector{UInt64}[[0x14acd1057b698a40], [0x6a7f9b876202d912, 0x40656f98f1e86c11], [0x68d4087bc8f29d5c, 0x757e0ac51ad2d852]], 0)

Writing to JSON

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

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