Skip to content

Lattices

🚧 Under construction 🚧

How to build a lattice?

via Lattices.build

The most straightforward way to build a common lattice structure, such as a hypercube, is to utilize Lattices.build. This function depending on arguments and keywords creates an instance of Lattices.Lattice of the given lattice.

For instance, to build a simple chain lattice of length 7 with the edge length 2.0 and periodic boundary conditions, run

julia
Lattices.build(
    :Hypercube, [7,], 2.0;
    periodic=[true,]
)
NeuralQuantumStates.Lattices.Lattice{Int64, Float64, 1, 1}
  metagraph: MetaGraphsNext.MetaGraph{Int64, Graphs.SimpleGraphs.SimpleGraph{Int64}, Tuple{Int64}, StaticArraysCore.SVector{1, Float64}, Int64, Nothing, MetaGraphsNext.var"#11#13", Float64}
  shape: StaticArraysCore.SVector{1, Int64}
  basis: NeuralQuantumStates.Lattices.LatticeBasis{Float64, 1, 1}
  periodic: StaticArraysCore.SVector{1, Bool}

For a cuboid lattice of shape [3,4,5] with the edge length 2.0 and periodic boundary conditions in the second dimension, run

julia
Lattices.build(
    :Hypercube, [3, 4, 5], 2.0;
    periodic=[false, true, false]
)
NeuralQuantumStates.Lattices.Lattice{Int64, Float64, 3, 1}
  metagraph: MetaGraphsNext.MetaGraph{Int64, Graphs.SimpleGraphs.SimpleGraph{Int64}, Tuple{Int64, Int64, Int64}, StaticArraysCore.SVector{3, Float64}, Int64, Nothing, MetaGraphsNext.var"#11#13", Float64}
  shape: StaticArraysCore.SVector{3, Int64}
  basis: NeuralQuantumStates.Lattices.LatticeBasis{Float64, 3, 1}
  periodic: StaticArraysCore.SVector{3, Bool}

via Lattices.LatticeBasis and Lattices.Lattice

If your lattice has a special structure or not already defined in this package, first, define your Lattices.LatticeBasis instance with the chosen basis vectors and lattice site offsets:

julia
basis_vectors = [
    1.0 0.25;
    0.1 0.4
];
site_offsets = [
    0.0 0.0;
    0.15 0.20
];
lat_basis = Lattices.LatticeBasis(basis_vectors, site_offsets)
NeuralQuantumStates.Lattices.LatticeBasis{Float64, 2, 2}
  vectors: StaticArraysCore.SMatrix{2, 2, Float64, 4}
  site_offsets: StaticArraysCore.SMatrix{2, 2, Float64, 4}

for edges from the k-th nearest neighbors

If you want to consider a lattice of shape [4,3] for the nearest neighbors, run

julia
Lattices.Lattice(
    [4, 3], lat_basis;
    max_order=1
)
NeuralQuantumStates.Lattices.Lattice{Int64, Float64, 2, 2}
  metagraph: MetaGraphsNext.MetaGraph{Int64, Graphs.SimpleGraphs.SimpleGraph{Int64}, Tuple{Symbol, Int64, Int64}, StaticArraysCore.SVector{2, Float64}, Int64, Nothing, MetaGraphsNext.var"#11#13", Float64}
  shape: StaticArraysCore.SVector{2, Int64}
  basis: NeuralQuantumStates.Lattices.LatticeBasis{Float64, 2, 2}
  periodic: StaticArraysCore.SVector{2, Bool}

for custom edges

If you want to define the custom edges for the lattice, first, define the custom edges

julia
custom_edges = [((:A, 1, 1), (:B, 3, 3)),], [1,];
julia
Lattices.Lattice(
    [4, 3], lat_basis, custom_edges
)
NeuralQuantumStates.Lattices.Lattice{Int64, Float64, 2, 2}
  metagraph: MetaGraphsNext.MetaGraph{Int64, Graphs.SimpleGraphs.SimpleGraph{Int64}, Tuple{Symbol, Int64, Int64}, StaticArraysCore.SVector{2, Float64}, Int64, Nothing, MetaGraphsNext.var"#11#13", Float64}
  shape: StaticArraysCore.SVector{2, Int64}
  basis: NeuralQuantumStates.Lattices.LatticeBasis{Float64, 2, 2}
  periodic: StaticArraysCore.SVector{2, Bool}