11using BlockArrays: AbstractBlockArray, blocklengths
22using BlockSparseArrays: BlockSparseArray
3- using GradedArrays: SectorProduct, U1, Z, dual, isdual, sectors
3+ using GradedArrays: U1, Z, dual, isdual, sectorproduct , sectors
44using ITensorBase: ITensor, Index, gettag, prime, settag
55using NamedDimsArrays: dename
66using QuantumOperatorDefinitions: OpName, SiteType, StateName, op, state
@@ -10,47 +10,47 @@ using Test: @test, @testset
1010 t = SiteType (" S=1/2" ; gradings = (" Sz" ,))
1111 r = AbstractUnitRange (t)
1212 @test r == 1 : 2
13- @test sectors (r) == [SectorProduct ((; Sz = U1 (0 ))), SectorProduct ((; Sz = U1 (1 )))]
13+ @test sectors (r) == [sectorproduct ((; Sz = U1 (0 ))), sectorproduct ((; Sz = U1 (1 )))]
1414 @test blocklengths (r) == [1 , 1 ]
1515
1616 t = SiteType (" Electron" ; gradings = (" Nf" , " Sz" ))
1717 r = AbstractUnitRange (t)
1818 @test r == 1 : 4
1919 @test sectors (r) == [
20- SectorProduct ((; Nf = U1 (0 ), Sz = U1 (0 ))),
21- SectorProduct ((; Nf = U1 (1 ), Sz = U1 (1 ))),
22- SectorProduct ((; Nf = U1 (1 ), Sz = U1 (- 1 ))),
23- SectorProduct ((; Nf = U1 (2 ), Sz = U1 (0 ))),
20+ sectorproduct ((; Nf = U1 (0 ), Sz = U1 (0 ))),
21+ sectorproduct ((; Nf = U1 (1 ), Sz = U1 (1 ))),
22+ sectorproduct ((; Nf = U1 (1 ), Sz = U1 (- 1 ))),
23+ sectorproduct ((; Nf = U1 (2 ), Sz = U1 (0 ))),
2424 ]
2525 @test blocklengths (r) == [1 , 1 , 1 , 1 ]
2626
2727 t = SiteType (" Electron" ; gradings = (" Nf" => " NfA" , " Sz" => " SzA" ))
2828 r = AbstractUnitRange (t)
2929 @test r == 1 : 4
3030 @test sectors (r) == [
31- SectorProduct ((; NfA = U1 (0 ), SzA = U1 (0 ))),
32- SectorProduct ((; NfA = U1 (1 ), SzA = U1 (1 ))),
33- SectorProduct ((; NfA = U1 (1 ), SzA = U1 (- 1 ))),
34- SectorProduct ((; NfA = U1 (2 ), SzA = U1 (0 ))),
31+ sectorproduct ((; NfA = U1 (0 ), SzA = U1 (0 ))),
32+ sectorproduct ((; NfA = U1 (1 ), SzA = U1 (1 ))),
33+ sectorproduct ((; NfA = U1 (1 ), SzA = U1 (- 1 ))),
34+ sectorproduct ((; NfA = U1 (2 ), SzA = U1 (0 ))),
3535 ]
3636 @test blocklengths (r) == [1 , 1 , 1 , 1 ]
3737
3838 t = SiteType (" Electron" ; gradings = (" NfParity" , " Sz" ))
3939 r = AbstractUnitRange (t)
4040 @test r == 1 : 4
4141 @test sectors (r) == [
42- SectorProduct ((; NfParity = Z {2} (0 ), Sz = U1 (0 ))),
43- SectorProduct ((; NfParity = Z {2} (1 ), Sz = U1 (1 ))),
44- SectorProduct ((; NfParity = Z {2} (1 ), Sz = U1 (- 1 ))),
45- SectorProduct ((; NfParity = Z {2} (0 ), Sz = U1 (0 ))),
42+ sectorproduct ((; NfParity = Z {2} (0 ), Sz = U1 (0 ))),
43+ sectorproduct ((; NfParity = Z {2} (1 ), Sz = U1 (1 ))),
44+ sectorproduct ((; NfParity = Z {2} (1 ), Sz = U1 (- 1 ))),
45+ sectorproduct ((; NfParity = Z {2} (0 ), Sz = U1 (0 ))),
4646 ]
4747 @test blocklengths (r) == [1 , 1 , 1 , 1 ]
4848
4949 t = SiteType (" S=1/2" ; gradings = (" Sz" ,))
5050 (r1, r2) = axes (OpName (" σ⁺" ), (t,))
51- @test sectors (r1) == [SectorProduct ((; Sz = U1 (0 ))), SectorProduct ((; Sz = U1 (1 )))]
51+ @test sectors (r1) == [sectorproduct ((; Sz = U1 (0 ))), sectorproduct ((; Sz = U1 (1 )))]
5252 @test blocklengths (r1) == [1 , 1 ]
53- @test sectors (r2) == [SectorProduct ((; Sz = U1 (0 ))), SectorProduct ((; Sz = U1 (1 )))]
53+ @test sectors (r2) == [sectorproduct ((; Sz = U1 (0 ))), sectorproduct ((; Sz = U1 (1 )))]
5454 @test blocklengths (r2) == [1 , 1 ]
5555
5656 t = SiteType (" S=1/2" ; gradings = (" Sz" ,))
@@ -63,17 +63,17 @@ using Test: @test, @testset
6363 @test a == [2 , 0 ]
6464 @test a isa BlockSparseArray
6565 (r1,) = axes (a)
66- @test sectors (r1) == [SectorProduct ((; Sz = U1 (0 ))), SectorProduct ((; Sz = U1 (1 )))]
66+ @test sectors (r1) == [sectorproduct ((; Sz = U1 (0 ))), sectorproduct ((; Sz = U1 (1 )))]
6767 @test blocklengths (r1) == [1 , 1 ]
6868
6969 t = SiteType (" S=1/2" ; gradings = (" Sz" ,))
7070 a = op (" σ⁺" , t)
7171 @test a == [0 2 ; 0 0 ]
7272 @test a isa BlockSparseArray
7373 (r1, r2) = axes (a)
74- @test sectors (r1) == [SectorProduct ((; Sz = U1 (0 ))), SectorProduct ((; Sz = U1 (1 )))]
74+ @test sectors (r1) == [sectorproduct ((; Sz = U1 (0 ))), sectorproduct ((; Sz = U1 (1 )))]
7575 @test blocklengths (r1) == [1 , 1 ]
76- @test sectors (r2) == [SectorProduct ((; Sz = U1 (0 ))), SectorProduct ((; Sz = U1 (1 )))]
76+ @test sectors (r2) == [sectorproduct ((; Sz = U1 (0 ))), sectorproduct ((; Sz = U1 (1 )))]
7777 @test blocklengths (r2) == [1 , 1 ]
7878end
7979
8282 @test gettag (i, " sitetype" ) == " S=1/2"
8383 # TODO : Test without denaming.
8484 @test dename (i) == 1 : 2
85- @test sectors (dename (i)) == [SectorProduct ((; Sz = U1 (0 ))), SectorProduct ((; Sz = U1 (1 )))]
85+ @test sectors (dename (i)) == [sectorproduct ((; Sz = U1 (0 ))), sectorproduct ((; Sz = U1 (1 )))]
8686 @test blocklengths (dename (i)) == [1 , 1 ]
8787
8888 i′ = prime (i)
9393 @test a′ isa BlockSparseArray
9494 # TODO : Test these without denaming `a`.
9595 (r1, r2) = axes (a′)
96- @test sectors (r1) == [SectorProduct ((; Sz = U1 (0 ))), SectorProduct ((; Sz = U1 (1 )))]
96+ @test sectors (r1) == [sectorproduct ((; Sz = U1 (0 ))), sectorproduct ((; Sz = U1 (1 )))]
9797 @test blocklengths (r1) == [1 , 1 ]
98- @test sectors (r2) == [SectorProduct ((; Sz = U1 (0 ))), SectorProduct ((; Sz = U1 (1 )))]
98+ @test sectors (r2) == [sectorproduct ((; Sz = U1 (0 ))), sectorproduct ((; Sz = U1 (1 )))]
9999 @test blocklengths (r2) == [1 , 1 ]
100100end
0 commit comments