@@ -15,48 +15,52 @@ Base.unlock(envs::AbstractMPSEnvironments) = unlock(envs.lock);
1515# ------------------
1616function allocate_GL (bra:: AbstractMPS , mpo:: AbstractMPO , ket:: AbstractMPS , i:: Int )
1717 T = Base. promote_type (scalartype (bra), scalartype (mpo), scalartype (ket))
18+ TA = similarstoragetype (storagetype (mpo), T)
1819 V = left_virtualspace (bra, i) ⊗ left_virtualspace (mpo, i)' ←
1920 left_virtualspace (ket, i)
2021 if V isa BlockTensorKit. TensorMapSumSpace
21- TT = blocktensormaptype (spacetype (bra), numout (V), numin (V), T )
22+ TT = blocktensormaptype (spacetype (bra), numout (V), numin (V), TA )
2223 else
23- TT = TensorMap{T }
24+ TT = TensorKit . TensorMapWithStorage{T, TA }
2425 end
2526 return TT (undef, V)
2627end
2728
2829function allocate_GR (bra:: AbstractMPS , mpo:: AbstractMPO , ket:: AbstractMPS , i:: Int )
2930 T = Base. promote_type (scalartype (bra), scalartype (mpo), scalartype (ket))
31+ TA = similarstoragetype (storagetype (mpo), T)
3032 V = right_virtualspace (ket, i) ⊗ right_virtualspace (mpo, i) ←
3133 right_virtualspace (bra, i)
3234 if V isa BlockTensorKit. TensorMapSumSpace
33- TT = blocktensormaptype (spacetype (bra), numout (V), numin (V), T )
35+ TT = blocktensormaptype (spacetype (bra), numout (V), numin (V), TA )
3436 else
35- TT = TensorMap{T }
37+ TT = TensorKit . TensorMapWithStorage{T, TA }
3638 end
3739 return TT (undef, V)
3840end
3941
4042function allocate_GBL (bra:: QP , mpo:: AbstractMPO , ket:: QP , i:: Int )
4143 T = Base. promote_type (scalartype (bra), scalartype (mpo), scalartype (ket))
44+ TA = similarstoragetype (storagetype (mpo), T)
4245 V = left_virtualspace (bra. left_gs, i) ⊗ left_virtualspace (mpo, i)' ←
4346 auxiliaryspace (ket)' ⊗ left_virtualspace (ket. right_gs, i)
4447 if V isa BlockTensorKit. TensorMapSumSpace
45- TT = blocktensormaptype (spacetype (bra), numout (V), numin (V), T )
48+ TT = blocktensormaptype (spacetype (bra), numout (V), numin (V), TA )
4649 else
47- TT = TensorMap{T }
50+ TT = TensorKit . TensorMapWithStorage{T, TA }
4851 end
4952 return TT (undef, V)
5053end
5154
5255function allocate_GBR (bra:: QP , mpo:: AbstractMPO , ket:: QP , i:: Int )
5356 T = Base. promote_type (scalartype (bra), scalartype (mpo), scalartype (ket))
57+ TA = similarstoragetype (storagetype (mpo), T)
5458 V = right_virtualspace (ket. left_gs, i) ⊗ right_virtualspace (mpo, i) ←
5559 auxiliaryspace (ket)' ⊗ right_virtualspace (bra. right_gs, i)
5660 if V isa BlockTensorKit. TensorMapSumSpace
57- TT = blocktensormaptype (spacetype (bra), numout (V), numin (V), T )
61+ TT = blocktensormaptype (spacetype (bra), numout (V), numin (V), TA )
5862 else
59- TT = TensorMap{T }
63+ TT = TensorKit . TensorMapWithStorage{T, TA }
6064 end
6165 return TT (undef, V)
6266end
0 commit comments