Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
kmp5VT committed Sep 15, 2023
1 parent 3931c3a commit f1ff431
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/itensor/qnitensor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -382,7 +388,6 @@ function dropzeros(T::ITensor; tol=0)
return
end


function δ_split(i1::Index, i2::Index)
d = emptyITensor(i1, i2)
for n in 1:min(dim(i1), dim(i2))
Expand Down

0 comments on commit f1ff431

Please sign in to comment.