Open HamidArianZad opened 6 months ago
Hi Hamid,
Thank you for your message. I have created a Jupyter Notebook demonstrating the steps, and you can find it in the example folder. I hope you find it helpful.
I would like to share a few comments:
trans_inv_operator
is recommended for translational invariant Hamiltonians, as it simplifies the process. Additionally, leveraging translational symmetry can further reduce the dimension of the many-body Hamiltonian. In your example, specifying the momentum sector looks crucial, otherwise, the dimension of the matrix seems too large.If you encounter any issues or notice mistakes in the provided example, please don't hesitate to bring them to my attention. As the package is not extensively documented and is primarily used within my group, I am pleased to assist others who find it useful.
Best regards, Jie
Hi Jie,
Thank you very much for your efficient code. I made some modifications and executed the results. Upon comparison, I noticed a discrepancy between the exact diagonalization (ED) results obtained from QuSpin and those from EDKit for a small system with L=2 (total number of spins N=6). In QuSpin, I did not consider any symmetry, thus obtaining the full ED results. Please see below figure for reference:
Blue broken line is EDKit results and black solid like is QuSpin results.
Below is the EDKit code I used:
using EDKit, LinearAlgebra
using DelimitedFiles
# Hamiltonian parameters:
J1 = 1.0
J2 = J1
J3 = 2.7
J4 = J1
J5 = J1
L = 2
k = 0
N = 3L
sz_min = 0
sz_max = N
B_min = 0
B_max = 8
uB = 0.1
# -------------------------------------------------------
all_energies = []
for (m_B, Bz) in enumerate(B_min:uB:B_max)
# current_energies = []
for i in sz_min:sz_max
# ---------------------------------
ha = Bz
hb = ha
hc = ha
# onsite Hamiltonian matrix
O1 = spin((J1, "xx1"), (J1, "yy1"), (J1, "zz1"), D=3)
O2 = spin((J2, "x1x"), (J2, "y1y"), (J2, "z1z"), D=3)
O3 = spin((J3, "1xx"), (J3, "1yy"), (J3, "1zz"), D=3)
hz = spin((ha, "z11"), (hb, "1z1"), (hc, "11z"), D=3)
h1 = O1 + O2 + O3 + hz
C1 = spin((J4, "1x1x11"), (J4, "1y1y11"), (J4, "1y1y11"), D=3)
C2 = spin((J5, "11xx11"), (J5, "11yy11"), (J5, "11yy11"), D=3)
h2 = C1 + C2
Nj = diag( spin((1,"z11"), (1,"1z1"), (1,"11z"), D=3) + 3*I )
# since Julia vector start from 1, hence the `sj+1`
total_z(s) = sum(Nj[sj+1] for sj in s)
basis = TranslationalBasis(L=L, f = s -> total_z(s) == i, k=k, base=3^3)
H = trans_inv_operator(h1, 1:1, basis) + trans_inv_operator(h2, 1:2, basis)
energy = eigvals(Hermitian(H))
for sublist in energy
for element in sublist
push!(all_energies, element)
end
end
end
# push!(all_energies, current_energies)
# ----------------------------------------------------------------------
println("*************************************************************")
println("-------------- Finished job: B = ", Bz, "-------------------")
println("*************************************************************")
end
open("Energies_DiamondS1_cSzT_EDKit_J$(J3)_L$(L)_Bmin$(B_min)_Bmax$(B_max).txt", "w") do io
for energies in all_energies
for En in energies
writedlm(io, En, '\n')
end
end
end
In above code I tried to keep fix total_z(s)
in each step of magnetic field such that all possible fixed values of magnetization are taken into account.
I really like your package, especially for its concise code structure. I'm optimistic that it will assist me in achieving my objectives effectively.
Your insights and comments on this matter would be greatly appreciated.
Hi Hamid,
One thing I noticed in your code: if you are interested in obtaining the whole spectrum, you should do a for loop over k = 0,1,...,L; also, for the spin-1 system, the maximal magnon filling is 2N (sz_max = 2N).
If it still does not solve the discrepancy, could you provide the complete code that generates the results, both in EDKit and QuSpin so that I can check it myself?
Dear Jie,
I found the problem. Please edit the code that you have added to examples. Namely, the part
C1 = spin((J4, "1x1x11"), (J4, "1y1y11"), (J4, "1y1y11"), D=3)
C2 = spin((J5, "11xx11"), (J5, "11yy11"), (J5, "11yy11"), D=3)
should be
C1 = spin((J4, "1x1x11"), (J4, "1y1y11"), (J4, "1z1z11"), D=3)
C2 = spin((J5, "11xx11"), (J5, "11yy11"), (J5, "11zz11"), D=3)
Thanks!
Now the code works well. For the case k=0
, I can obtain the results that I want.
Hi Hamid,
Thanks for finding out the mistake I made. I am happy that it works for you.
Dear Jie,
I still see mistake in the line: C1 = spin((J4, "1x1x11"), (J4, "1y1y11"), (J4, "1y1y11"), D=3)
. It should be like:
C1 = spin((J4, "1x1x11"), (J4, "1y1y11"), (J4, "1z1z11"), D=3)
. Namely, (J4, "1z1z11")
is correct for correlation along z-axis.
Hi Hamid,
Thanks, I think I fixed it this time.
Dear EDKit developer(s),
I am writing to seek assistance regarding the computation of eigenvalues for a spin-1 diamond-like chain featuring two distinct exchange couplings in the presence of an external magnetic field along the z-axis, as depicted in the figure below.
I tried following code:
In my calculations, I have considered the conservation of
SzT (N=L)
. However, I have encountered several challenges in proceeding with the calculations. Despite consulting the examples provided in your documentation, I have been unable to resolve these issues. I would greatly appreciate it if you could address the following concerns:(1, "z")
and[spin("Z") for i=1:L]
, but encountered errors.J_1
andJ_2
into the model?0<=B_z<=8
(specifically, forB_z=0:0.1:8
). Could you please provide guidance on modifying the code to achieve this?Your assistance in resolving these issues would be greatly appreciated.