From f1ff4313338a7ed7a602740d2cfe8d367828eb63 Mon Sep 17 00:00:00 2001 From: kmp5VT Date: Fri, 15 Sep 2023 16:16:40 -0400 Subject: [PATCH] format --- src/itensor/qnitensor.jl | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/itensor/qnitensor.jl b/src/itensor/qnitensor.jl index 8bb3293845..23bab47e2d 100644 --- a/src/itensor/qnitensor.jl +++ b/src/itensor/qnitensor.jl @@ -13,7 +13,7 @@ if setting_flux && NDTensors.is_unallocated_zeros(T) T = tensor(ITensor(eltype(T), flux(T, I...), inds(T))) T = setindex!!(T, x, I...) - T = NDTensors.dropzeros(T; tol = zero(eltype(T))) + T = NDTensors.dropzeros(T; tol=zero(eltype(T))) return T end return setindex!!(T, x, I...) @@ -267,7 +267,12 @@ 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, elt::Type{<:Number}, A::AbstractArray{<:Number}, is::QNIndex, i...; kwargs... + as::AliasStyle, + elt::Type{<:Number}, + A::AbstractArray{<:Number}, + is::QNIndex, + i...; + kwargs..., ) tol = haskey(kwargs, :tol) ? kwargs[:tol] : 0.0 checkflux = haskey(kwargs, :checkflux) ? kwargs[:checkflux] : true @@ -337,15 +342,16 @@ function QNITensor( return itensor(T) end -ITensor( +function ITensor( as::AliasStyle, elt::Type{<:Number}, A::AbstractArray{<:Number}, inds::Indices{<:QNIndex}; tol=0.0, checkflux=true, -) = ITensors.QNITensor(as, elt, A, inds; tol = tol, checkflux = checkflux) - +) + return ITensors.QNITensor(as, elt, A, inds; tol=tol, checkflux=checkflux) +end function _copyto_dropzeros!(T::Tensor, A::AbstractArray; tol) for i in eachindex(T) @@ -382,7 +388,6 @@ function dropzeros(T::ITensor; tol=0) return T̃ end - function δ_split(i1::Index, i2::Index) d = emptyITensor(i1, i2) for n in 1:min(dim(i1), dim(i2))