Skip to content

Commit

Permalink
added J1-J2 model and transition calculation attempt, not really succ…
Browse files Browse the repository at this point in the history
…essful
  • Loading branch information
abhirup-m committed Dec 4, 2024
1 parent fb70e9d commit 534806b
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
16 changes: 16 additions & 0 deletions examples/J1J2Model.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using fermions, Serialization
include("../src/modelHamiltonians.jl")

totalSites = 33
@assert totalSites % 3 == 0
partitions = collect(3:3:totalSites)
J1byJ2Values = 0:0.1:2
gapValues = zeros(length(J1byJ2Values))
@time for (i, J1byJ2) in enumerate(J1byJ2Values)
hamiltonian = J1J2Model(J1byJ2, totalSites)
hamiltonianFlow = MinceHamiltonian(hamiltonian, partitions)
savePaths, results = IterDiag(hamiltonianFlow, 2000)
eigVals = deserialize(savePaths[end-1])["eigVals"]
gapValues[i] = eigVals[2] - eigVals[1]
end
display(gapValues)
30 changes: 30 additions & 0 deletions src/modelHamiltonians.jl
Original file line number Diff line number Diff line change
Expand Up @@ -379,3 +379,33 @@ function Dispersion(
return dispersion
end
export Dispersion


function J1J2Model(
J1byJ2::Float64,
numSites::Int64
)
J2 = 1.
J1 = J2 * J1byJ2
hamiltonian = Tuple{String, Vector{Int64}, Float64}[]
for site in 1:numSites-1
# J1 terms
push!(hamiltonian, ("nn", [site, site+1], J1))
push!(hamiltonian, ("n", [site], -J1/2))
push!(hamiltonian, ("n", [site+1], -J1/2))
push!(hamiltonian, ("+-", [site, site+1], J1/2))
push!(hamiltonian, ("+-", [site+1, site], J1/2))

if site == numSites-1
continue
end

# J2 terms
push!(hamiltonian, ("nn", [site, site+2], J2))
push!(hamiltonian, ("n", [site], -J2/2))
push!(hamiltonian, ("n", [site+2], -J2/2))
push!(hamiltonian, ("+-", [site, site+2], J2/2))
push!(hamiltonian, ("+-", [site+2, site], J2/2))
end
return hamiltonian
end

0 comments on commit 534806b

Please sign in to comment.