Hi,
For a research project of spinful fermions I need to implement TEBD, I wanted to do it with symmetries because my Hamiltonian conserves the total number of particles (not by spin but it respects the total number).
However, I got an error when I try to create the gates for the TEBD. Consider the following code and a very simple gate:
using ITensors
using ITensorMPS
s1,s2,s3,s4 = siteinds("Electron", 4, conserve_qns = true);
Gate = op("Cdagdn * Cup", s1)*op("Cdagdn * Cup", s2)*op("Id", s3)*op("Id", s4)
Gate is a NDTensors.BlockSparse{Float64, Vector{Float64}, 8}. Now, when I try to get the exponential (that I need to create the array of gates for TEBD) using
exp(-0.5im*Gate)
I got the following error:
exp currently supports only block-diagonal matrices
Stacktrace:
[1] error(s::String)
@ Base .\error.jl:35
[2] exp(T::NDTensors.BlockSparseTensor{ComplexF64, 2, Tuple{…}, NDTensors.BlockSparse{…}})
@ NDTensors C:\Users\JOP204\.julia\packages\NDTensors\wnM2t\src\blocksparse\linearalgebra.jl:413
[3] exp(A::ITensor, Linds::NTuple{4, Index{Vector{Pair{…}}}}, Rinds::NTuple{4, Index{Vector{Pair{…}}}}; ishermitian::Bool)
@ ITensors C:\Users\JOP204\.julia\packages\ITensors\SOADD\src\tensor_operations\matrix_algebra.jl:94
[4] exp(A::ITensor, Linds::NTuple{4, Index{Vector{Pair{QN, Int64}}}}, Rinds::NTuple{4, Index{Vector{Pair{QN, Int64}}}})
@ ITensors C:\Users\JOP204\.julia\packages\ITensors\SOADD\src\tensor_operations\matrix_algebra.jl:39
[5] exp(A::ITensor; kwargs::@Kwargs{})
@ ITensors C:\Users\JOP204\.julia\packages\ITensors\SOADD\src\tensor_operations\matrix_algebra.jl:110
[6] exp(A::ITensor)
@ ITensors C:\Users\JOP204\.julia\packages\ITensors\SOADD\src\tensor_operations\matrix_algebra.jl:107
[7] top-level scope
@ In[446]:1
Some type information was truncated. Use `show(err)` to see complete types.
It is not very clear to me what is the problem with this operator.