Skip to content

Commit

Permalink
Potentially need to drop zero blocks
Browse files Browse the repository at this point in the history
(specifically for fermion system)
  • Loading branch information
kmp5VT committed Sep 20, 2023
1 parent db9b06c commit 2194bf8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/itensor/specialitensors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ B = onehot(i=>1,j=>3)
function onehot(datatype::Type{<:AbstractArray}, ivs::Pair{<:Index}...)
A = ITensor(eltype(datatype), ind.(ivs)...)
A[val.(ivs)...] = one(eltype(datatype))
A = hasqns(A) ? dropzeros(A) : A
return Adapt.adapt(datatype, A)
end

Expand Down

0 comments on commit 2194bf8

Please sign in to comment.