You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I simulated a Hamiltonian with $U(1) \times U(1) \times U(1) \times U(1)$ symmetry. To utilize such a symmetry, I constructed site indices with four different QNs. But I encountered an error Cannot add QNVal, QN already contains maximum number of QNVals from the qn.jl. The error occurred when I constructed the Hamiltonian MPO. After I increased the constant maxQNs from 4 to 5 (or a larger number), I did not reencounter the same error.
Minimal code demonstrating the bug or unexpected behavior
using ITensors
using ITensorInfiniteMPS
function ITensorInfiniteMPS.unit_cell_terms(::Model"H";
L =nothing, N::Int=4,
J::Real=1, Delta::Real=1, Jc::Real)
""" We consider four open Heisenberg (XXZ) spin 1/2 chains coupled by nearest-neighbor spin current interaction. In the vertical direction, the system is periodic. The Hamiltonian commutes with the total magnetization on each chain. Therefore, each eigenstate can be labeled by four quantum numbers."""ipp(i) =mod1(i+1, N) # It gives the next chain index.
opsum =OpSum()
for i in1:N
# XXZ
opsum += J/2, "S+", i, "S-", i+N
opsum += J/2, "S-", i, "S+", i+N
opsum += Delta, "Sz", i, "Sz", i+N
# Spin current interaction, J_spin = i/2*(S+ S- - S- S+)
opsum +=-Jc/4, "S+", i+N, "S-", i, "S+", ipp(i)+N, "S-", ipp(i)
opsum +=-Jc/4, "S-", i+N, "S+", i, "S-", ipp(i)+N, "S+", ipp(i)
opsum += Jc/4, "S-", i+N, "S+", i, "S+", ipp(i)+N, "S-", ipp(i)
opsum += Jc/4, "S+", i+N, "S-", i, "S-", ipp(i)+N, "S+", ipp(i)
endreturn opsum
end
N =4# Number of chain
L =16# Length of each chain
s = [siteind("S=1/2"; conserve_qns=true, qnname_sz ="Sz$(mod1(j,N))") for j in1:N*L]
h =MPO(Model("H"), s; Jc =rand())
Expected output or behavior
In the end, I should get a matrix product operator.
Description of bug
I simulated a Hamiltonian with$U(1) \times U(1) \times U(1) \times U(1)$ symmetry. To utilize such a symmetry, I constructed site indices with four different QNs. But I encountered an error
Cannot add QNVal, QN already contains maximum number of QNVals
from theqn.jl
. The error occurred when I constructed the Hamiltonian MPO. After I increased the constantmaxQNs
from 4 to 5 (or a larger number), I did not reencounter the same error.Minimal code demonstrating the bug or unexpected behavior
Expected output or behavior
In the end, I should get a matrix product operator.
Actual output or behavior
Version information
versioninfo()
:using Pkg; Pkg.status("ITensors")
:The text was updated successfully, but these errors were encountered: