Skip to content

Instantly share code, notes, and snippets.

@yomichi
Created February 2, 2020 02:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yomichi/7b7e26af061ea1ffd0171164940a4721 to your computer and use it in GitHub Desktop.
Save yomichi/7b7e26af061ea1ffd0171164940a4721 to your computer and use it in GitHub Desktop.
SUN bond-hamiltonian generator for DSQSS/DLA
[[sites]]
type = 0
N = 3
values = [1.0, -0.5, -0.5, ]
elements = []
[[sites.sources]]
istate = [0,]
fstate = [1,]
value = 0.5
[[sites.sources]]
istate = [0,]
fstate = [2,]
value = 0.5
[[sites.sources]]
istate = [1,]
fstate = [0,]
value = 0.5
[[sites.sources]]
istate = [1,]
fstate = [2,]
value = 0.5
[[sites.sources]]
istate = [2,]
fstate = [0,]
value = 0.5
[[sites.sources]]
istate = [2,]
fstate = [1,]
value = 0.5
[[interactions]]
type = 0
nbody = 2
N = [3, 3]
[[interactions.elements]]
istate = [0, 0]
fstate = [0, 0]
value = -0.3333333333333333
[[interactions.elements]]
istate = [0, 0]
fstate = [1, 1]
value = -0.3333333333333333
[[interactions.elements]]
istate = [0, 0]
fstate = [2, 2]
value = -0.3333333333333333
[[interactions.elements]]
istate = [1, 1]
fstate = [0, 0]
value = -0.3333333333333333
[[interactions.elements]]
istate = [1, 1]
fstate = [1, 1]
value = -0.3333333333333333
[[interactions.elements]]
istate = [1, 1]
fstate = [2, 2]
value = -0.3333333333333333
[[interactions.elements]]
istate = [2, 2]
fstate = [0, 0]
value = -0.3333333333333333
[[interactions.elements]]
istate = [2, 2]
fstate = [1, 1]
value = -0.3333333333333333
[[interactions.elements]]
istate = [2, 2]
fstate = [2, 2]
value = -0.3333333333333333
function write_SUN(N)
println("[[sites]]")
println("type = 0")
println("N = $N")
print("values = [1.0, ")
for i in 2:N
print("$(-1.0/(N-1)), ")
end
println("]")
println("elements = []")
println()
for i in 0:N-1
for j in 0:N-1
if i==j
continue
end
println("[[sites.sources]]")
println("istate = [$i,]")
println("fstate = [$j,]")
println("value = 0.5")
println()
end
end
println("[[interactions]]")
println("type = 0")
println("nbody = 2")
println("N = [$N, $N]")
for i in 0:N-1
for j in 0:N-1
println("[[interactions.elements]]")
println("istate = [$i, $i]")
println("fstate = [$j, $j]")
println("value = $(-1.0/N)")
end
end
end
if abspath(PROGRAM_FILE) == @__FILE__
const N = length(ARGS)>0 ? parse(Int, ARGS[1]) : 3
write_SUN(N)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment