Skip to content

Commit 13e108e

Browse files
committed
fix errors uncovered by JET
1 parent 3b858e6 commit 13e108e

5 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎src/planar/macros.jl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function planarparser(planarexpr, kwargs...)
5151
if name == :order
5252
isexpr(val, :tuple) ||
5353
throw(ArgumentError("Invalid use of `order`, should be `order=(...,)`"))
54-
indexorder = map(normalizeindex, val.args)
54+
indexorder = map(TO.normalizeindex, val.args)
5555
parser.contractiontreebuilder = network -> TO.indexordertree(
5656
network, indexorder
5757
)

‎src/planar/preprocessors.jl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ function _extract_contraction_pairs(rhs, lhs, pre, temporaries)
591591
newarg = _extract_contraction_pairs(rhs.args[3], lhs, pre, temporaries)
592592
return Expr(:call, :\, rhs.args[2], newarg)
593593
else
594-
throw(ArgumentError("unknown tensor expression $ex"))
594+
throw(ArgumentError("unknown tensor expression $rhs"))
595595
end
596596
end
597597

‎src/tensors/abstracttensor.jl‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,8 @@ $_doc_subblock
496496
As a result, modifying the view will modify the data in the tensor.
497497
498498
See also [`subblock`](@ref), [`subblocks`](@ref) and [`fusiontrees`](@ref).
499-
""" Base.getindex(::AbstractTensorMap, ::Tuple{I, Vararg{I}}) where {I <: Sector},
500-
Base.getindex(::AbstractTensorMap, ::FusionTree, ::FusionTree)
499+
""" Base.getindex(t::AbstractTensorMap, sectors::Tuple{I, Vararg{I}}) where {I <: Sector},
500+
Base.getindex(t::AbstractTensorMap, f₁::FusionTree, f₂::FusionTree)
501501

502502
@inline Base.getindex(t::AbstractTensorMap, sectors::Tuple{I, Vararg{I}}) where {I <: Sector} =
503503
subblock(t, sectors)
@@ -514,8 +514,8 @@ Copies `v` into the data slice of `t` corresponding to the splitting - fusion tr
514514
By default, `v` can be any object that can be copied into the view associated with `t[f₁, f₂]`.
515515
516516
See also [`subblock`](@ref), [`subblocks`](@ref) and [`fusiontrees`](@ref).
517-
""" Base.setindex!(::AbstractTensorMap, ::Any, ::Tuple{I, Vararg{I}}) where {I <: Sector},
518-
Base.setindex!(::AbstractTensorMap, ::Any, ::FusionTree, ::FusionTree)
517+
""" Base.setindex!(t::AbstractTensorMap, v, sectors::Tuple{I, Vararg{I}}) where {I <: Sector},
518+
Base.setindex!(t::AbstractTensorMap, v, f₁::FusionTree, f₂::FusionTree)
519519

520520
@inline Base.setindex!(t::AbstractTensorMap, v, sectors::Tuple{I, Vararg{I}}) where {I <: Sector} =
521521
copy!(subblock(t, sectors), v)

‎src/tensors/linalg.jl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ tdst[sub_axes...] .= tsrc[sub_axes...]
575575
absorb(tdst::AbstractTensorMap, tsrc::AbstractTensorMap) = absorb!(copy(tdst), tsrc)
576576
function absorb!(tdst::AbstractTensorMap, tsrc::AbstractTensorMap)
577577
numin(tdst) == numin(tsrc) && numout(tdst) == numout(tsrc) ||
578-
throw(DimensionError("Incompatible number of indices for source and destination"))
578+
throw(IndexError("Incompatible number of indices for source and destination"))
579579
S = check_spacetype(tdst, tsrc)
580580
dom = mapreduce(infimum, ⊗, domain(tdst), domain(tsrc); init = one(S))
581581
cod = mapreduce(infimum, ⊗, codomain(tdst), codomain(tsrc); init = one(S))

‎src/tensors/tensor.jl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ for randf in (:rand, :randn, :randexp, :randisometry)
393393
function $randfun(
394394
rng::Random.AbstractRNG, ::Type{TorA}, codomain::TensorSpace
395395
) where {TorA}
396-
return $randfun(rng, TorA, codomain ← one(domain))
396+
return $randfun(rng, TorA, codomain ← one(codomain))
397397
end
398398

399399
# filling in default eltype

0 commit comments

Comments
 (0)