Skip to content

Commit c9c0a1e

Browse files
committed
test: introduce tests for SquareSymmetric unit cell
fix: missing files fix: adjust load order
1 parent 0b92b70 commit c9c0a1e

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

src/InfiniteTensorContractions.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ using KrylovKit
66
using LinearAlgebra
77
using TensorKit
88
using DocStringExtensions
9+
using Observers
10+
using DataFrames
911

1012
export ITC
1113

@@ -48,6 +50,7 @@ include("convergenceinfo.jl")
4850
include("utils.jl")
4951
include("callback.jl")
5052

53+
include("compositetensor.jl")
5154
include("abstractunitcell.jl")
5255
include("abstractproblem.jl")
5356
include("networks.jl")

test/networks.jl

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,38 @@
2323
@test virtualspace(ct, 2) == s * s'
2424
@test virtualspace(ct, 3) == w' * w
2525
@test virtualspace(ct, 4) == n' * n
26+
27+
@testset "SquareSymmetric" verbose = true begin
28+
data = [
29+
1 2 3
30+
2 3 1
31+
3 1 2
32+
]
33+
34+
ucsym = UnitCell{SquareSymmetric}([1, 2, 3])
35+
36+
@test UnitCell{Square}(data) == ucsym
37+
38+
@test ucsym == UnitCell{SquareSymmetric}([1 2 3])
39+
@test ucsym == UnitCell{SquareSymmetric}([1; 2; 3;;])
40+
41+
for i in 1:3
42+
@test ucsym[i, :] == data[i, :]
43+
@test ucsym[:, i] == data[:, i]
44+
end
45+
46+
@test identity.(ucsym) == ucsym
47+
@test exp2.(ucsym) == UnitCell{SquareSymmetric}([2, 4, 8])
48+
@test ucsym .+ ucsym == 2 * ucsym
49+
@test ucsym + ucsym == 2 * ucsym
50+
51+
let rv1 = ucsym + data, rv2 = ucsym .+ data
52+
for rv in (rv1, rv2)
53+
@test rv == 2 * data
54+
@test isa(rv, UnitCell{Square})
55+
end
56+
end
57+
58+
@test ucsym == ucsym'
59+
end
2660
end

0 commit comments

Comments
 (0)