Skip to content

Commit 8fe5b03

Browse files
committed
add mpre tests
1 parent 6f6ae82 commit 8fe5b03

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

NDTensors/src/lib/SymmetrySectors/test/test_fusion_rules.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@ end
278278
@test space_isequal((@inferred fusion_product(SU2(1//2), g3)), g4)
279279

280280
# test different simple sectors cannot be fused
281+
@test_throws MethodError Z{2}(0) U1(1)
282+
@test_throws MethodError SU2(1) U1(1)
281283
@test_throws MethodError fusion_product(g1, SU2(1))
282284
@test_throws MethodError fusion_product(U1(1), g3)
283285
end

NDTensors/src/lib/SymmetrySectors/test/test_sector_product.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,17 @@ end
541541
end
542542
end
543543

544+
@testset "Mixing implementations" begin
545+
s1 = SectorProduct(U1(1))
546+
sA = SectorProduct(; A=U1(1))
547+
548+
@test sA != s1
549+
@test_throws ArgumentError sA < s1
550+
@test_throws ArgumentError s1 < sA
551+
@test_throws MethodError s1 sA
552+
@test_throws MethodError sA s1
553+
end
554+
544555
@testset "Empty SymmetrySector" begin
545556
for s in (SectorProduct(()), SectorProduct((;)))
546557
@test s == TrivialSector()
@@ -589,6 +600,7 @@ end
589600

590601
@test !(s < s)
591602
@test s < SectorProduct(U1(1))
603+
@test SectorProduct(U1(-1)) < s
592604
@test s < SectorProduct(; A=U1(1))
593605
@test s > SectorProduct(; A=U1(-1))
594606
@test !(s < SectorProduct(; A=U1(0)))

0 commit comments

Comments
 (0)