From 2194bf89b2184082b9f0f5cf856e866aefcd6452 Mon Sep 17 00:00:00 2001 From: Karl Pierce Date: Wed, 20 Sep 2023 10:01:35 -0400 Subject: [PATCH] Potentially need to drop zero blocks (specifically for fermion system) --- src/itensor/specialitensors.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/itensor/specialitensors.jl b/src/itensor/specialitensors.jl index 5bacd2da4b..e42fa84c36 100644 --- a/src/itensor/specialitensors.jl +++ b/src/itensor/specialitensors.jl @@ -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