You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A common code pattern in ITensors.jl is analogous to the following:
using NamedDimsArrays: nameddims
a =nameddims(randn(2, 2), ("i", "j"))
b =nameddims(randn(2, 2), ("j", "k"))
q, r =qr(b, dimnames(a))
This fails right now because qr(::AbstractNamedDimsArray, codomain_names) is strict about the names that are input as the codomain names in the factorization, and dimnames(a) contains the name "i" which isn't a dimension name of b.
One can do:
q, r =qr(b, intersect(dimnames(b), dimnames(a)))
but that is a bit annoying to write which is why we automated it in ITensors.jl. We could have a keyword argument that toggles between the two:
# errors
q, r =qr(b, intersect(dimnames(b), dimnames(a)); strict=true)
# no error, equaivalent to `qr(b, intersect(dimnames(b), dimnames(a)))`, probably the default
q, r =qr(b, dimnames(a); strict=false)
Additionally, I think passing both the codomain and domain names should be strict, i.e.:
q, r =qr(b, dimnames(a), ("j",)) # errors
q, r =qr(b, ("i",), ("j",)) # works
q, r =qr(b, intersect(dimnames(b), dimnames(a)), setdiff(dimnames(b), dimnames(a))) # works
The text was updated successfully, but these errors were encountered:
Note that qr(::AbstractNamedDimsArray, ...)/svd(::AbstractNamedDimsArray, ...) forward to TensorAlgebra.qr/TensorAlgebra.svd and this discussion is relevant for that package as well.
A common code pattern in
ITensors.jl
is analogous to the following:This fails right now because
qr(::AbstractNamedDimsArray, codomain_names)
is strict about the names that are input as the codomain names in the factorization, anddimnames(a)
contains the name"i"
which isn't a dimension name ofb
.One can do:
but that is a bit annoying to write which is why we automated it in
ITensors.jl
. We could have a keyword argument that toggles between the two:Additionally, I think passing both the codomain and domain names should be strict, i.e.:
The text was updated successfully, but these errors were encountered: