@@ -4,7 +4,7 @@ using BlockArrays: blocklasts, blocklengths
44using GradedUnitRanges: GradedOneTo, gradedrange
55using LabelledNumbers: label, labelled, unlabel
66using QuantumOperatorDefinitions:
7- QuantumOperatorDefinitions, @SiteType_str , @SymmetryType_str , SiteType, SymmetryType , name
7+ QuantumOperatorDefinitions, @SiteType_str , @GradingType_str , SiteType, GradingType , name
88using SymmetrySectors: × , SectorProduct, U1, Z
99
1010sortedunion (a, b) = sort (union (a, b))
2121QuantumOperatorDefinitions. combine_axes (a:: GradedOneTo , b:: Base.OneTo ) = a
2222QuantumOperatorDefinitions. combine_axes (a:: Base.OneTo , b:: GradedOneTo ) = b
2323
24- function Base. AbstractUnitRange (:: SymmetryType "N" , t:: SiteType )
24+ function Base. AbstractUnitRange (:: GradingType "N" , t:: SiteType )
2525 return gradedrange (map (i -> SectorProduct ((; N= U1 (i - 1 ))) => 1 , 1 : length (t)))
2626end
27- function Base. AbstractUnitRange (:: SymmetryType "Sz" , t:: SiteType )
27+ function Base. AbstractUnitRange (:: GradingType "Sz" , t:: SiteType )
2828 return gradedrange (map (i -> SectorProduct ((; Sz= U1 (i - 1 ))) => 1 , 1 : length (t)))
2929end
30- function Base. AbstractUnitRange (:: SymmetryType "Sz↑" , t:: SiteType )
31- return AbstractUnitRange (SymmetryType " Sz" (), t)
30+ function Base. AbstractUnitRange (:: GradingType "Sz↑" , t:: SiteType )
31+ return AbstractUnitRange (GradingType " Sz" (), t)
3232end
33- function Base. AbstractUnitRange (:: SymmetryType "Sz↓" , t:: SiteType )
33+ function Base. AbstractUnitRange (:: GradingType "Sz↓" , t:: SiteType )
3434 return gradedrange (map (i -> SectorProduct ((; Sz= U1 (- (i - 1 )))) => 1 , 1 : length (t)))
3535end
3636
37- function sector (symmetrytype :: SymmetryType , sec)
38- sectorname = Symbol (get (symmetrytype , :name , name (symmetrytype )))
37+ function sector (gradingtype :: GradingType , sec)
38+ sectorname = Symbol (get (gradingtype , :name , name (gradingtype )))
3939 return SectorProduct (NamedTuple {(sectorname,)} ((sec,)))
4040end
4141
42- function Base. AbstractUnitRange (s:: SymmetryType "Nf" , t:: SiteType"Fermion" )
42+ function Base. AbstractUnitRange (s:: GradingType "Nf" , t:: SiteType"Fermion" )
4343 return gradedrange ([sector (s, U1 (0 )) => 1 , sector (s, U1 (1 )) => 1 ])
4444end
45- # TODO : Write in terms of `SymmetryType "Nf"` definition.
46- function Base. AbstractUnitRange (s:: SymmetryType "NfParity" , t:: SiteType"Fermion" )
45+ # TODO : Write in terms of `GradingType "Nf"` definition.
46+ function Base. AbstractUnitRange (s:: GradingType "NfParity" , t:: SiteType"Fermion" )
4747 return gradedrange ([sector (s, Z {2} (0 )) => 1 , sector (s, Z {2} (1 )) => 1 ])
4848end
49- function Base. AbstractUnitRange (s:: SymmetryType "Sz" , t:: SiteType"Fermion" )
49+ function Base. AbstractUnitRange (s:: GradingType "Sz" , t:: SiteType"Fermion" )
5050 return gradedrange ([sector (s, U1 (0 )) => 1 , sector (s, U1 (1 )) => 1 ])
5151end
52- function Base. AbstractUnitRange (s:: SymmetryType "Sz↑" , t:: SiteType"Fermion" )
52+ function Base. AbstractUnitRange (s:: GradingType "Sz↑" , t:: SiteType"Fermion" )
5353 return gradedrange ([sector (s, U1 (0 )) => 1 , sector (s, U1 (1 )) => 1 ])
5454end
55- function Base. AbstractUnitRange (s:: SymmetryType "Sz↓" , t:: SiteType"Fermion" )
55+ function Base. AbstractUnitRange (s:: GradingType "Sz↓" , t:: SiteType"Fermion" )
5656 return gradedrange ([sector (s, U1 (0 )) => 1 , sector (s, U1 (- 1 )) => 1 ])
5757end
5858
5959# TODO : Write in terms of `SiteType"Fermion"` definitions.
60- function Base. AbstractUnitRange (s:: SymmetryType "Nf" , t:: SiteType"Electron" )
60+ function Base. AbstractUnitRange (s:: GradingType "Nf" , t:: SiteType"Electron" )
6161 return gradedrange ([
6262 sector (s, U1 (0 )) => 1 ,
6363 sector (s, U1 (1 )) => 1 ,
6464 sector (s, U1 (1 )) => 1 ,
6565 sector (s, U1 (2 )) => 1 ,
6666 ])
6767end
68- # TODO : Write in terms of `SymmetryType "Nf"` definition.
69- function Base. AbstractUnitRange (s:: SymmetryType "NfParity" , t:: SiteType"Electron" )
68+ # TODO : Write in terms of `GradingType "Nf"` definition.
69+ function Base. AbstractUnitRange (s:: GradingType "NfParity" , t:: SiteType"Electron" )
7070 return gradedrange ([
7171 sector (s, Z {2} (0 )) => 1 ,
7272 sector (s, Z {2} (1 )) => 1 ,
7373 sector (s, Z {2} (1 )) => 1 ,
7474 sector (s, Z {2} (0 )) => 1 ,
7575 ])
7676end
77- function Base. AbstractUnitRange (s:: SymmetryType "Sz" , t:: SiteType"Electron" )
77+ function Base. AbstractUnitRange (s:: GradingType "Sz" , t:: SiteType"Electron" )
7878 return gradedrange ([
7979 sector (s, U1 (0 )) => 1 ,
8080 sector (s, U1 (1 )) => 1 ,
0 commit comments