Download - LQCD, MG, and Qlua - BU Blogs
![Page 2: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/2.jpg)
OUTLINE
Iterative solvers and multigrid
Application domain: lattice QCD
Algorithm design with Qlua
References
Monday, November 4, 13
![Page 3: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/3.jpg)
ITERATIVE SOLVERS AND MULTIGRID
Monday, November 4, 13
![Page 4: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/4.jpg)
ITERATIVE SOLVERS AND MULTIGRID
Ax=b
Monday, November 4, 13
![Page 5: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/5.jpg)
ITERATIVE SOLVERS AND MULTIGRID
Hilbert spaces
Vector space operations
Homomorphisms
Linear operators
Monday, November 4, 13
![Page 6: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/6.jpg)
LATTICE QCD
Monday, November 4, 13
![Page 7: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/7.jpg)
LATTICE QCD
Tori in n-dim
Monday, November 4, 13
![Page 8: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/8.jpg)
LATTICE QCD
Tori in n-dim
Simple (constant) stencil structures
Monday, November 4, 13
![Page 9: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/9.jpg)
LATTICE QCD
Tori in n-dim
Simple (constant) stencil structures
Physics encoded in parallel transport coefficients
Monday, November 4, 13
![Page 10: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/10.jpg)
LATTICE QCD
Tori in n-dim
Simple (constant) stencil structures
Physics encoded in parallel transport coefficients
Non-hermitian operators
Monday, November 4, 13
![Page 11: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/11.jpg)
LATTICE QCD
Tori in n-dim
Simple (constant) stencil structures
Physics encoded in parallel transport coefficients
Non-hermitian operators
Large condition numbers
Monday, November 4, 13
![Page 12: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/12.jpg)
QLUA
Monday, November 4, 13
![Page 13: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/13.jpg)
QLUA
Scripting language Lua with domain-specific extensions
$
Monday, November 4, 13
![Page 14: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/14.jpg)
QLUA
Scripting language Lua with domain-specific extensions
$ cat sines.qluarequire "stdlib"for i = 1, 5 do printf("sin(%d deg) = %7.5f\n", i, math.sin(i*math.pi/180));end$
Monday, November 4, 13
![Page 15: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/15.jpg)
QLUA
Scripting language Lua with domain-specific extensions
$ cat sines.qluarequire "stdlib"for i = 1, 5 do printf("sin(%d deg) = %7.5f\n", i, math.sin(i*math.pi/180));end$ qlua sines.qluasin(1 deg) = 0.01745sin(2 deg) = 0.03490sin(3 deg) = 0.05234sin(4 deg) = 0.06976sin(5 deg) = 0.08716$
Monday, November 4, 13
![Page 16: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/16.jpg)
QLUA
Extensions implement algebraic structuresLattices - Tori and Stencils
Monday, November 4, 13
![Page 17: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/17.jpg)
QLUA
Extensions implement algebraic structuresLattices - Tori and Stencils
require "stdlib"lx = qcd.lattice {4, 2}
Monday, November 4, 13
![Page 18: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/18.jpg)
QLUA
Extensions implement algebraic structuresLattices - Tori and Stencils
require "stdlib"lx = qcd.lattice {4, 2}A = lx:Real(lx:pcoord(1) + 10 * lx:pcoord(0))
Monday, November 4, 13
![Page 19: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/19.jpg)
QLUA
Extensions implement algebraic structuresLattices - Tori and Stencils
require "stdlib"lx = qcd.lattice {4, 2}A = lx:Real(lx:pcoord(1) + 10 * lx:pcoord(0))B = A:shift(0, "from_backward")
Monday, November 4, 13
![Page 20: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/20.jpg)
QLUA
Extensions implement algebraic structuresLattices - Tori and Stencils
require "stdlib"lx = qcd.lattice {4, 2}A = lx:Real(lx:pcoord(1) + 10 * lx:pcoord(0))B = A:shift(0, "from_backward")for i = 0, lx[0] -‐ 1 do for j = 0, lx[1] -‐ 1 do printf("[%d %d]: %3d %3d\n", i, j, A[{i,j}], B[{i,j}]) endend
Monday, November 4, 13
![Page 21: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/21.jpg)
QLUA
Extensions implement algebraic structuresLattices - Tori and Stencils
require "stdlib"lx = qcd.lattice {4, 2}A = lx:Real(lx:pcoord(1) + 10 * lx:pcoord(0))B = A:shift(0, "from_backward")for i = 0, lx[0] -‐ 1 do for j = 0, lx[1] -‐ 1 do printf("[%d %d]: %3d %3d\n", i, j, A[{i,j}], B[{i,j}]) endend$ qlua ts.qlua[0 0]: 0 30[0 1]: 1 31[1 0]: 10 0[1 1]: 11 1[2 0]: 20 10[2 1]: 21 11[3 0]: 30 20[3 1]: 31 21
Monday, November 4, 13
![Page 22: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/22.jpg)
QLUA
Extensions implement algebraic structuresLQCD-specific data types
Monday, November 4, 13
![Page 23: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/23.jpg)
QLUA
Extensions implement algebraic structuresLQCD-specific data types - Vectors
Monday, November 4, 13
![Page 24: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/24.jpg)
QLUA
Extensions implement algebraic structuresLQCD-specific data types - Vectors
lx = qcd.lattice{24,48}
Monday, November 4, 13
![Page 25: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/25.jpg)
QLUA
Extensions implement algebraic structuresLQCD-specific data types - Vectors
lx = qcd.lattice{24,48}rnd = lx:RandomState(35, lx:pcoord(0) + 24 * lx:pcoord(1))
Monday, November 4, 13
![Page 26: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/26.jpg)
QLUA
Extensions implement algebraic structuresLQCD-specific data types - Vectors
lx = qcd.lattice{24,48}rnd = lx:RandomState(35, lx:pcoord(0) + 24 * lx:pcoord(1))phi = rnd:gaussian_DiracFermion()
Monday, November 4, 13
![Page 27: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/27.jpg)
QLUA
Extensions implement algebraic structuresLQCD-specific data types - Vectors
lx = qcd.lattice{24,48}rnd = lx:RandomState(35, lx:pcoord(0) + 24 * lx:pcoord(1))phi = rnd:gaussian_DiracFermion()g = rnd:gaussian_ColorMatrix()r = lx:Real(lx:pcoord(0)) + 0.5 * rnd:gaussian_Real()
Monday, November 4, 13
![Page 28: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/28.jpg)
QLUA
Extensions implement algebraic structuresLQCD operations
Monday, November 4, 13
![Page 29: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/29.jpg)
QLUA
Extensions implement algebraic structuresLQCD operations - Vector spaces
Monday, November 4, 13
![Page 30: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/30.jpg)
QLUA
Extensions implement algebraic structuresLQCD operations - Vector spaces
lx = qcd.lattice{24,48}rnd = lx:RandomState(35, lx:pcoord(0) + 24 * lx:pcoord(1))phi = rnd:gaussian_DiracFermion()g = rnd:gaussian_ColorMatrix()r = lx:Real(lx:pcoord(0)) + 0.5 * rnd:gaussian_Real()
rho = lx:DiracFermion()psi = g * phi + 6.5 * rho
Monday, November 4, 13
![Page 31: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/31.jpg)
QLUA
Extensions implement algebraic structuresFull set of arithmetic operations on lattice data objects
Monday, November 4, 13
![Page 32: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/32.jpg)
QLUA
Extensions implement algebraic structuresFull set of arithmetic operations on lattice data objects
lx = qcd.lattice{24,48}rnd = lx:RandomState(35, lx:pcoord(0) + 24 * lx:pcoord(1))phi = rnd:gaussian_DiracFermion()g = rnd:gaussian_ColorMatrix()r = lx:Real(lx:pcoord(0)) + 0.5 * rnd:gaussian_Real()
rho = lx:DiracFermion()
function LinOp(x) return g * x + r * xend
Monday, November 4, 13
![Page 33: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/33.jpg)
QLUA
Extensions implement algebraic structuresCollectives - Linear maps
Monday, November 4, 13
![Page 34: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/34.jpg)
QLUA
Extensions implement algebraic structuresCollectives - Linear maps
srcL = qcd.lattice{7,6}dstL = qcd.lattice{4,2}I0 = srcL:Int(...)I1 = srcL:Int(...)V = srcL:Int(...)
Monday, November 4, 13
![Page 35: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/35.jpg)
QLUA
Extensions implement algebraic structuresCollectives - Linear maps
srcL = qcd.lattice{7,6}dstL = qcd.lattice{4,2}I0 = srcL:Int(...)I1 = srcL:Int(...)V = srcL:Int(...)
Monday, November 4, 13
![Page 36: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/36.jpg)
QLUA
Extensions implement algebraic structuresCollectives - Linear maps
srcL = qcd.lattice{7,6}dstL = qcd.lattice{4,2}I0 = srcL:Int(...)I1 = srcL:Int(...)V = srcL:Int(...)
gx = qcd.gather(dstL, srcL, {I0, I1})
Monday, November 4, 13
![Page 37: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/37.jpg)
QLUA
Extensions implement algebraic structuresCollectives - Linear maps
srcL = qcd.lattice{7,6}dstL = qcd.lattice{4,2}I0 = srcL:Int(...)I1 = srcL:Int(...)V = srcL:Int(...)
gx = qcd.gather(dstL, srcL, {I0, I1})Wadd = gx:add(V)Wmax = gx:max(V)Wxor = gx:xor(V)
Monday, November 4, 13
![Page 38: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/38.jpg)
QLUA
Extensions implement algebraic structuresCollectives - Linear maps
srcL = qcd.lattice{7,6}dstL = qcd.lattice{4,2}I0 = srcL:Int(...)I1 = srcL:Int(...)V = srcL:Int(...)
gx = qcd.gather(dstL, srcL, {I0, I1})Wadd = gx:add(V)Wmax = gx:max(V)Wxor = gx:xor(V)
Monday, November 4, 13
![Page 39: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/39.jpg)
QLUA
Scripting language Lua with domain-specific extensionsExtensions implement algebraic structures
Lattices - Tori and StencilsLQCD-specific data types - VectorsLQCD operations - Vector spaces, OperatorsCollectives - Linear mapsAccess to QIO files - real data
Monday, November 4, 13
![Page 40: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/40.jpg)
QLUA
More tutorials at https://usqcd.lns.mit.edu/w/index.php/QLUA_tutorials
Monday, November 4, 13
![Page 41: LQCD, MG, and Qlua - BU Blogs](https://reader030.vdocuments.mx/reader030/viewer/2022011815/61d4e0e7076e467528178255/html5/thumbnails/41.jpg)
REFERENCES
http://www.usqcd.org/http://www.lua.org/https://usqcd.lns.mit.edu/qluahttps://usqcd.lns.mit.edu/w/index.php/QLUA_tutorials
Monday, November 4, 13