Updated documentation to include Space.jl module

This commit is contained in:
Alberto Ramos 2023-02-01 14:59:17 +01:00
parent b4dadba051
commit 5b9e5c72b1
5 changed files with 74 additions and 6 deletions

View file

@ -5,4 +5,9 @@ Pkg.activate("../")
using LatticeGPU using LatticeGPU
makedocs(sitename="LatticeGPU", modules=[LatticeGPU], doctest=true, makedocs(sitename="LatticeGPU", modules=[LatticeGPU], doctest=true,
pages = [
"LatticeGPU.jl" => "index.md",
"Space-time" => "space.md",
"Groups and algebras" => "groups.md"
],
repo = "https://igit.ific.uv.es/alramos/latticegpu.jl") repo = "https://igit.ific.uv.es/alramos/latticegpu.jl")

BIN
docs/src/blocks.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

28
docs/src/space.md Normal file
View file

@ -0,0 +1,28 @@
# Lattice structure
D-dimensional lattice points are labeled by two ordered integer
numbers: the point-in-block index ($$b$$ in the figure below) and the
block index ($$r$$ in the fire below). the routines [`up`](@ref) and
[`dw`](@ref) allow you to displace to the neighboring points of the
lattice.
![blocks](blocks.png "D dimensional lattice points are labeled by its
index (a `Tuple` of integers). Given a point (by its index), there are
routines to jump to neighboring points.")
Directions are numbered fro 1 to D, and then Euclidean time is always
assumed to be the last coordinate. Planes are also numbered from 1 to
$$N(N-1)/2$$. The structure [`SpaceParm`](@ref)
contains the information of the
lattice structure and has to be passed as argument to most routines.
```@docs
SpaceParm
up
dw
updw
point_coord
point_time
point_index
point_color
```

View file

@ -23,7 +23,7 @@ include("Space/Space.jl")
using .Space using .Space
export SpaceParm export SpaceParm
export up, dw, updw, point_coord, point_index, point_time export up, dw, updw, point_coord, point_index, point_time, point_color
export BC_PERIODIC, BC_OPEN, BC_SF_AFWB, BC_SF_ORBI export BC_PERIODIC, BC_OPEN, BC_SF_AFWB, BC_SF_ORBI
include("Fields/Fields.jl") include("Fields/Fields.jl")

View file

@ -19,6 +19,27 @@ const BC_SF_ORBI = 1
const BC_SF_AFWB = 2 const BC_SF_AFWB = 2
const BC_OPEN = 3 const BC_OPEN = 3
"""
struct SpaceParm{N,M,B,D}
This structure contains information about the lattice being simulated. The parameters that define the structure are
- `N`: The number of dimensions
- `M`: The number of planes (i.e. \`\` N(N-1)/2 \`\`)
- `B`: The boundary conditions in Euclidean time. Acceptable values are
- `BC_PERIODIC`: Periodic boundary conditions
- `BC_SF_AFWB`: Schrödinger Funtional Aoki-Frezzoptti-Weisz Choice B.
- `BC_SF_ORBI`: Schrödinger Funtional orbifold constructions.
- `BC_OPEN`: Open boundary conditions.
The structure conatins the following components:
- `iL`: Tuple containing the lattice length in each dimension.
- `plidx`: The directions of each plane
- `blk`: The block size in each each dimension
- `rbk`: The number of blocks in each dimension
- `bsz`: The number of points in each block
- `rsz`: The number of blocks in the lattice
- `ntw`: The twist tensor in each plane
"""
struct SpaceParm{N,M,B,D} struct SpaceParm{N,M,B,D}
ndim::Int64 ndim::Int64
iL::NTuple{N,Int64} iL::NTuple{N,Int64}
@ -148,7 +169,7 @@ function Base.show(io::IO, lp::SpaceParm{N,M,B,D}) where {N,M,B,D}
end end
""" """
function up(p::NTuple{2,Int64}, id::Int64, lp::SpaceParm) up(p::NTuple{2,Int64}, id::Int64, lp::SpaceParm)
Given a point `x` with index `p`, this routine returns the index of the point Given a point `x` with index `p`, this routine returns the index of the point
`x + a id`. `x + a id`.
@ -175,7 +196,7 @@ Given a point `x` with index `p`, this routine returns the index of the point
end end
""" """
function dw(p::NTuple{2,Int64}, id::Int64, lp::SpaceParm) dw(p::NTuple{2,Int64}, id::Int64, lp::SpaceParm)
Given a point `x` with index `p`, this routine returns the index of the point Given a point `x` with index `p`, this routine returns the index of the point
`x - a id`. `x - a id`.
@ -201,7 +222,7 @@ Given a point `x` with index `p`, this routine returns the index of the point
end end
""" """
function updw(p::NTuple{2,Int64}, id::Int64, lp::SpaceParm) updw(p::NTuple{2,Int64}, id::Int64, lp::SpaceParm)
Given a point `x` with index `p`, this routine returns the index of the points Given a point `x` with index `p`, this routine returns the index of the points
`x + a id` and `x - a id`. `x + a id` and `x - a id`.
@ -246,6 +267,11 @@ end
@inline cntr(nr, id::Int64, lp::SpaceParm) = mod(div(nr-1,lp.rbkS[id]),lp.rbk[id]) @inline cntr(nr, id::Int64, lp::SpaceParm) = mod(div(nr-1,lp.rbkS[id]),lp.rbk[id])
@inline cnt(nb, nr, id::Int64, lp::SpaceParm) = 1 + cntb(nb,id,lp) + cntr(nr,id,lp)*lp.blk[id] @inline cnt(nb, nr, id::Int64, lp::SpaceParm) = 1 + cntb(nb,id,lp) + cntr(nr,id,lp)*lp.blk[id]
"""
point_coord(p::NTuple{2,Int64}, lp::SpaceParm{N,M,B,D}) where {N,M,B,D}
Returns the cartesian coordinates of point index `p`
"""
@inline function point_coord(p::NTuple{2,Int64}, lp::SpaceParm{2,M,D}) where {M,D} @inline function point_coord(p::NTuple{2,Int64}, lp::SpaceParm{2,M,D}) where {M,D}
i1 = cnt(p[1], p[2], 1, lp) i1 = cnt(p[1], p[2], 1, lp)
@ -301,11 +327,20 @@ end
return CartesianIndex{6}(i1,i2,i3,i4,i5,i6) return CartesianIndex{6}(i1,i2,i3,i4,i5,i6)
end end
"""
point_time(p::NTuple{2,Int64}, lp::SpaceParm{N,M,B,D}) where {N,M,B,D}
Returns the Euclidean time coordinate of point index `p`
"""
@inline function point_time(p::NTuple{2,Int64}, lp::SpaceParm{N,M,B,D}) where {N,M,B,D} @inline function point_time(p::NTuple{2,Int64}, lp::SpaceParm{N,M,B,D}) where {N,M,B,D}
return cnt(p[1], p[2], N, lp) return cnt(p[1], p[2], N, lp)
end end
"""
point_index(pt::CartesianIndex, lp::SpaceParm)
Given the cartesian coordinates of a point, returns the point index
"""
@inline function point_index(pt::CartesianIndex, lp::SpaceParm) @inline function point_index(pt::CartesianIndex, lp::SpaceParm)
b = 1 b = 1
@ -319,7 +354,7 @@ end
end end
""" """
function point_color(p::NTuple{2,Int64}, lp::SpaceParm) point_color(p::NTuple{2,Int64}, lp::SpaceParm)
Returns the sum of the cartesian coordinates of the point p=(b,r). Returns the sum of the cartesian coordinates of the point p=(b,r).
""" """
@ -334,7 +369,7 @@ Returns the sum of the cartesian coordinates of the point p=(b,r).
end end
export up, dw, updw, point_index, point_coord, point_time export SpaceParm, up, dw, updw, point_index, point_coord, point_time, point_color
export BC_PERIODIC, BC_OPEN, BC_SF_AFWB, BC_SF_ORBI export BC_PERIODIC, BC_OPEN, BC_SF_AFWB, BC_SF_ORBI
end end