|
1 | | -using DiagonalArrays: δ, delta, diagview |
2 | 1 | using ITensorBase: ITensorBase, ITensor, Index, IndexName, gettag, hastag, plev, prime, |
3 | 2 | setplev, settag, tags, unsettag |
4 | 3 | using NamedDimsArrays: dename, inds, mapinds, name, named |
5 | | -using SparseArraysBase: oneelement |
6 | 4 | using LinearAlgebra: factorize |
7 | 5 | using Test: @test, @test_broken, @test_throws, @testset |
8 | 6 |
|
@@ -117,45 +115,6 @@ const elts = (Float32, Float64, Complex{Float32}, Complex{Float64}) |
117 | 115 | i = Index(2; id, tags = ["X" => "Y"]) |
118 | 116 | @test sprint(show, "text/plain", i) == "Index(length=2|id=$(id % 1000)|\"X\"=>\"Y\")" |
119 | 117 | end |
120 | | - @testset "delta" begin |
121 | | - i, j = Index.((2, 2)) |
122 | | - for a in ( |
123 | | - delta(i, j), |
124 | | - delta(Bool, i, j), |
125 | | - delta((i, j)), |
126 | | - delta(Bool, (i, j)), |
127 | | - δ(i, j), |
128 | | - δ(Bool, i, j), |
129 | | - δ((i, j)), |
130 | | - δ(Bool, (i, j)), |
131 | | - ) |
132 | | - @test eltype(a) === Bool |
133 | | - # TODO: Fix this. |
134 | | - @test_broken diagview(a) |
135 | | - @test diagview(dename(a)) == ones(2) |
136 | | - end |
137 | | - end |
138 | | - @testset "oneelement" begin |
139 | | - i = Index(3) |
140 | | - a = oneelement(i => 2) |
141 | | - @test a isa ITensor |
142 | | - @test ndims(a) == 1 |
143 | | - @test issetequal(inds(a), (i,)) |
144 | | - @test eltype(a) === Bool |
145 | | - @test a[1] == 0 |
146 | | - @test a[2] == 1 |
147 | | - @test a[3] == 0 |
148 | | - |
149 | | - i = Index(3) |
150 | | - a = oneelement(Float32, i => 2) |
151 | | - @test a isa ITensor |
152 | | - @test ndims(a) == 1 |
153 | | - @test issetequal(inds(a), (i,)) |
154 | | - @test eltype(a) === Float32 |
155 | | - @test a[1] == 0 |
156 | | - @test a[2] == 1 |
157 | | - @test a[3] == 0 |
158 | | - end |
159 | 118 | @testset "factorize" for elt in elts |
160 | 119 | i = Index(2) |
161 | 120 | j = Index(2) |
|
0 commit comments