From a93b008fb33cb485f893a3752aa438b271c54935 Mon Sep 17 00:00:00 2001 From: kmp5VT Date: Fri, 15 Sep 2023 12:21:56 -0400 Subject: [PATCH] Experimental QN itensor constructor, having issues with this --- src/itensor/qnitensor.jl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/itensor/qnitensor.jl b/src/itensor/qnitensor.jl index 1bcb0f7904..6d7df9d3e9 100644 --- a/src/itensor/qnitensor.jl +++ b/src/itensor/qnitensor.jl @@ -261,6 +261,15 @@ ITensor(x::RealOrComplex{Int}, flux::QN, is...) = ITensor(float(x), flux, is...) ITensor(eltype::Type{<:Number}, x::Number, is::QNIndices) = ITensor(eltype, x, QN(), is) +function ITensor( + as::AliasStyle, A::AbstractArray{ElT}, is::QNIndices; kwargs... +) where {ElT<:Number} + @show is + tol = haskey(kwargs, :tol) ? kwargs[:tol] : 0.0 + checkflux = haskey(kwargs, :checkflux) ? kwargs[:checkflux] : true + return ITensor(as, ElT, A, is) +end + """ ITensor([ElT::Type, ]::AbstractArray, inds; tol=0.0, checkflux=true)