11# additional interface to deal with IsingBimodule Sector
22# ------------------------------------------------------------------------------
33
4- const IsingBimod = IsingBimodule # TODO : do the rename after compat fix
5-
6- function dim (V:: Vect [IsingBimod])
4+ function dim (V:: Vect [IsingBimodule])
75 T = Base. promote_op (* , Int, real (sectorscalartype (sectortype (V))))
86 return reduce (+ , dim (V, c) * dim (c) for c in sectors (V);
97 init= zero (T))
108end
119
12- function scalar (t:: AbstractTensorMap{T,Vect[IsingBimod ],0,0} ) where {T}
10+ function scalar (t:: AbstractTensorMap{T,Vect[IsingBimodule ],0,0} ) where {T}
1311 Bs = collect (blocks (t))
1412 inds = findall (! iszero ∘ last, Bs)
1513 isempty (inds) && return zero (scalartype (t))
1816
1917# no custom fuse: we choose to return empty graded space when fusion is forbidden
2018
21- function Base. oneunit (S:: Vect [IsingBimod ])
19+ function Base. oneunit (S:: Vect [IsingBimodule ])
2220 ! isempty (sectors (S)) || throw (ArgumentError (" Cannot determine type of empty space" ))
2321 allequal (a. row for a in sectors (S)) && allequal (a. col for a in sectors (S)) ||
2422 throw (ArgumentError (" sectors of $S are not all equal" ))
@@ -28,18 +26,18 @@ function Base.oneunit(S::Vect[IsingBimod])
2826 return spacetype (S)(sector => 1 )
2927end
3028
31- Base. zero (S:: Type{Vect[IsingBimod ]} ) = Vect[IsingBimod ]()
29+ Base. zero (S:: Type{Vect[IsingBimodule ]} ) = Vect[IsingBimodule ]()
3230
33- function blocksectors (W:: TensorMapSpace{Vect[IsingBimod ],N₁,N₂} ) where {N₁,N₂}
31+ function blocksectors (W:: TensorMapSpace{Vect[IsingBimodule ],N₁,N₂} ) where {N₁,N₂}
3432 codom = codomain (W)
3533 dom = domain (W)
3634 if N₁ == 0 && N₂ == 0
37- return [IsingBimod (1 , 1 , 0 ), IsingBimod (2 , 2 , 0 )]
35+ return [IsingBimodule (1 , 1 , 0 ), IsingBimodule (2 , 2 , 0 )]
3836 elseif N₁ == 0
39- @assert N₂ != 0 " one of Type IsingBimod doesn't exist"
37+ @assert N₂ != 0 " one of Type IsingBimodule doesn't exist"
4038 return filter! (isone, collect (blocksectors (dom))) # is this what we want? doesn't allow M/Mop to end at empty space
4139 elseif N₂ == 0
42- @assert N₁ != 0 " one of Type IsingBimod doesn't exist"
40+ @assert N₁ != 0 " one of Type IsingBimodule doesn't exist"
4341 return filter! (isone, collect (blocksectors (codom)))
4442 elseif N₂ <= N₁ # keep intersection
4543 return filter! (c -> hasblock (codom, c), collect (blocksectors (dom)))
@@ -48,7 +46,7 @@ function blocksectors(W::TensorMapSpace{Vect[IsingBimod],N₁,N₂}) where {N₁
4846 end
4947end
5048
51- function rightoneunit (S:: Vect [IsingBimod ])
49+ function rightoneunit (S:: Vect [IsingBimodule ])
5250 ! isempty (sectors (S)) || throw (ArgumentError (" Cannot determine type of empty space" ))
5351 allequal (a. col for a in sectors (S)) ||
5452 throw (ArgumentError (" sectors of $S do not have the same rightone" ))
@@ -57,7 +55,7 @@ function rightoneunit(S::Vect[IsingBimod])
5755 return spacetype (S)(sector => 1 )
5856end
5957
60- function leftoneunit (S:: Vect [IsingBimod ])
58+ function leftoneunit (S:: Vect [IsingBimodule ])
6159 ! isempty (sectors (S)) || throw (ArgumentError (" Cannot determine type of empty space" ))
6260 allequal (a. row for a in sectors (S)) ||
6361 throw (ArgumentError (" sectors of $S do not have the same leftone" ))
@@ -66,7 +64,7 @@ function leftoneunit(S::Vect[IsingBimod])
6664 return spacetype (S)(sector => 1 )
6765end
6866
69- function insertrightunit (P:: ProductSpace{Vect[IsingBimod ],N} , :: Val{i} ;
67+ function insertrightunit (P:: ProductSpace{Vect[IsingBimodule ],N} , :: Val{i} ;
7068 conj:: Bool = false ,
7169 dual:: Bool = false ) where {i,N}
7270 i > N && error (" cannot insert a sensible right unit onto $P at index $(i+ 1 ) " )
@@ -82,7 +80,7 @@ function insertrightunit(P::ProductSpace{Vect[IsingBimod],N}, ::Val{i};
8280end
8381
8482# TODO ?: overwrite defaults at level of HomSpace and TensorMap?
85- function insertleftunit (P:: ProductSpace{Vect[IsingBimod ],N} , :: Val{i} ; # want no defaults?
83+ function insertleftunit (P:: ProductSpace{Vect[IsingBimodule ],N} , :: Val{i} ; # want no defaults?
8684 conj:: Bool = false ,
8785 dual:: Bool = false ) where {i,N}
8886 i > N && error (" cannot insert a sensible left unit onto $P at index $i " ) # do we want this to error in the diagonal case?
@@ -96,9 +94,9 @@ function insertleftunit(P::ProductSpace{Vect[IsingBimod],N}, ::Val{i}; # want no
9694 return ProductSpace (TupleTools. insertafter (P. spaces, i - 1 , (u,)))
9795end
9896
99- # is this even necessary? can let it error at fusiontrees.jl:93 from the one(IsingBimod ) call
97+ # is this even necessary? can let it error at fusiontrees.jl:93 from the one(IsingBimodule ) call
10098# but these errors are maybe more informative
101- function FusionTree (uncoupled:: Tuple{IsingBimod ,Vararg{IsingBimod }} )
99+ function FusionTree (uncoupled:: Tuple{IsingBimodule ,Vararg{IsingBimodule }} )
102100 coupled = collect (⊗ (uncoupled... ))
103101 if length (coupled) == 0 # illegal fusion somewhere
104102 throw (ArgumentError (" Forbidden fusion with uncoupled sectors $uncoupled " ))
@@ -108,6 +106,6 @@ function FusionTree(uncoupled::Tuple{IsingBimod,Vararg{IsingBimod}})
108106end
109107
110108# this one might also be overkill, since `FusionTreeIterator`s don't check whether the fusion is allowed
111- function fusiontrees (uncoupled:: Tuple{IsingBimod ,Vararg{IsingBimod }} )
112- return throw (ArgumentError (" coupled sector must be provided for IsingBimod fusion" ))
109+ function fusiontrees (uncoupled:: Tuple{IsingBimodule ,Vararg{IsingBimodule }} )
110+ return throw (ArgumentError (" coupled sector must be provided for IsingBimodule fusion" ))
113111end
0 commit comments