Skip to content

Commit 188a366

Browse files
committed
More missing definitions
1 parent 08603d3 commit 188a366

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ MapBroadcast = "ebd9b9da-f48d-417c-9660-449667d60261"
1212
NamedDimsArrays = "60cbd0c0-df58-4cb7-918c-6f5607b73fde"
1313
UnallocatedArrays = "43c9e47c-e622-40fb-bf18-a09fc8c466b6"
1414
UnspecifiedTypes = "42b3faec-625b-4613-8ddc-352bf9672b8d"
15+
VectorInterface = "409d34a3-91d5-4945-b6ec-7529ddf182d8"
1516

1617
[compat]
1718
Accessors = "0.1.39"
@@ -22,4 +23,5 @@ MapBroadcast = "0.1.5"
2223
NamedDimsArrays = "0.3.0"
2324
UnallocatedArrays = "0.1.1"
2425
UnspecifiedTypes = "0.1.1"
26+
VectorInterface = "0.5.0"
2527
julia = "1.10"

src/ITensorBase.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,9 @@ end
257257
prime(a::AbstractITensor) = setinds(a, prime.(inds(a)))
258258
noprime(a::AbstractITensor) = setinds(a, noprime.(inds(a)))
259259

260+
using VectorInterface: VectorInterface, scalartype
261+
VectorInterface.scalartype(a::AbstractITensor) = scalartype(unallocatable(a))
262+
260263
include("quirks.jl")
261264

262265
end

src/quirks.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
# TODO: Define this properly.
22
dag(i::Index) = i
3+
# TODO: Define this properly.
34
dag(a::ITensor) = a
45
# TODO: Deprecate.
56
dim(i::Index) = dename(length(i))
7+
# TODO: Deprecate.
68
dim(a::AbstractITensor) = unname(length(a))
79
# TODO: Define this properly.
810
hasqns(i::Index) = false
11+
# TODO: Define this properly.
12+
hasqns(i::AbstractITensor) = false
913
# TODO: Deprecate.
1014
itensor(parent::AbstractArray, nameddimsindices) = ITensor(parent, nameddimsindices)
1115
function itensor(parent::AbstractArray, i1::Index, i_rest::Index...)
@@ -29,9 +33,8 @@ end
2933

3034
using LinearAlgebra: qr, svd
3135
# TODO: Define this in `MatrixAlgebra.jl`/`TensorAlgebra.jl`.
32-
function factorize(a::AbstractITensor, args...; tags=TagSet(), maxdim=nothing)
33-
if isnothing(maxdim)
34-
# `tags` are ignored right now.
36+
function factorize(a::AbstractITensor, args...; maxdim=nothing, cutoff=nothing, kwargs...)
37+
if isnothing(maxdim) && isnothing(cutoff)
3538
Q, R = qr(a, args...)
3639
return Q, R
3740
else

0 commit comments

Comments
 (0)