Skip to content

Commit 8a2abce

Browse files
authored
[NDTensors] Remove ITensors dependency from tests (#1553)
* [NDTensors] Remove `ITensors` dependency from tests * [NDTensors] Bump to v0.3.47 * [ITensors] Move NDTensorsMappedArraysExt test to ITensors testsuite * [ITensors] Bump to v0.6.23
1 parent 5fb4696 commit 8a2abce

File tree

15 files changed

+40
-124
lines changed

15 files changed

+40
-124
lines changed

NDTensors/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "NDTensors"
22
uuid = "23ae76d9-e61a-49c4-8f12-3f1a16adf9cf"
33
authors = ["Matthew Fishman <[email protected]>"]
4-
version = "0.3.46"
4+
version = "0.3.47"
55

66
[deps]
77
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"

NDTensors/test/ITensors/Project.toml

Lines changed: 0 additions & 4 deletions
This file was deleted.

NDTensors/test/ITensors/TestITensorDMRG/Project.toml

Lines changed: 0 additions & 6 deletions
This file was deleted.

NDTensors/test/ITensors/TestITensorDMRG/TestITensorDMRG.jl

Lines changed: 0 additions & 20 deletions
This file was deleted.

NDTensors/test/ITensors/TestITensorDMRG/dmrg.jl

Lines changed: 0 additions & 35 deletions
This file was deleted.

NDTensors/test/ITensors/runtests.jl

Lines changed: 0 additions & 37 deletions
This file was deleted.

NDTensors/test/Project.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Dictionaries = "85a47980-9c8c-11e8-2b9f-f7ca1fa99fb4"
77
EllipsisNotation = "da5c29d0-fa7d-589e-88eb-ea29b0a81949"
88
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
99
GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527"
10-
ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5"
1110
JLArrays = "27aeb0d3-9eb9-45fb-866b-73c2ecf80fcb"
1211
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1312
MappedArrays = "dbb5928d-eab1-5f90-85c2-b9b0edb7c900"
@@ -23,12 +22,12 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2322
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
2423

2524
[compat]
26-
cuTENSOR = "2.0"
2725
Metal = "1.1.0"
26+
cuTENSOR = "2.0"
2827

2928
[extras]
3029
AMDGPU = "21141c5a-9bdb-4563-92ae-f87d6854732e"
3130
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
32-
cuTENSOR = "011b41b2-24ef-40a8-b3eb-fa098493e9e1"
3331
Metal = "dde4c033-4e86-420c-a63e-0dd931031962"
3432
TBLIS = "48530278-0828-4a49-9772-0f3830dfa1e9"
33+
cuTENSOR = "011b41b2-24ef-40a8-b3eb-fa098493e9e1"

NDTensors/test/ext/runtests.jl

Lines changed: 0 additions & 12 deletions
This file was deleted.

NDTensors/test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ using SafeTestsets: @safetestset
77
filenames = filter(readdir(@__DIR__)) do f
88
startswith("test_")(f) && endswith(".jl")(f)
99
end
10-
for dir in ["lib", "ext", "ITensors"]
10+
for dir in ["lib"]
1111
push!(filenames, joinpath(dir, "runtests.jl"))
1212
end
1313
@testset "Test $(@__DIR__)/$filename" for filename in filenames

NDTensors/test/test_combiner.jl

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,40 @@
11
@eval module $(gensym())
2-
using NDTensors
3-
using Test: @testset, @test, @test_throws
42
using GPUArraysCore: @allowscalar
3+
using NDTensors:
4+
NDTensors,
5+
Block,
6+
BlockOffsets,
7+
BlockSparse,
8+
BlockSparseTensor,
9+
Combiner,
10+
Dense,
11+
DenseTensor,
12+
contract,
13+
dim,
14+
dims,
15+
tensor
516
include("NDTensorsTestUtils/NDTensorsTestUtils.jl")
617
using .NDTensorsTestUtils: devices_list, is_supported_eltype
18+
using Test: @testset, @test, @test_throws
719

820
# Testing generic block indices
9-
using ITensors: QN, Index
21+
struct Index{Space}
22+
space::Space
23+
end
24+
NDTensors.dim(i::Index) = sum(b -> last(b), i.space)
25+
NDTensors.nblocks(i::Index) = length(i.space)
26+
NDTensors.blockdim(i::Index, block::Integer) = last(i.space[block])
27+
function NDTensors.outer(i1::Index, i2::Index)
28+
return Index(vec(
29+
map(Iterators.product(i1.space, i2.space)) do (b1, b2)
30+
return first(b1) + first(b2) => last(b1) * last(b2)
31+
end,
32+
))
33+
end
34+
NDTensors.permuteblocks(i::Index, perm::Vector{Int}) = Index(i.space[perm])
35+
36+
struct QN end
37+
Base.:+(q1::QN, q2::QN) = QN()
1038

1139
@testset "CombinerTensor basic functionality" begin
1240
@testset "test device: $dev, eltype: $elt" for dev in devices_list(copy(ARGS)),

0 commit comments

Comments
 (0)