@@ -15,48 +15,56 @@ 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+ M = TensorKit. promote_storagetype (T, eltype (mpo), eltype (bra), eltype (ket))
19+ S = TensorKit. check_spacetype (bra, mpo, ket)
1820 V = left_virtualspace (bra, i) ⊗ left_virtualspace (mpo, i)' ←
1921 left_virtualspace (ket, i)
2022 if V isa BlockTensorKit. TensorMapSumSpace
21- TT = blocktensormaptype (spacetype (bra) , numout (V), numin (V), T )
23+ TT = blocktensormaptype (S , numout (V), numin (V), M )
2224 else
23- TT = TensorMap{T}
25+ TT = tensormaptype (S, numout (V), numin (V), M)
2426 end
2527 return TT (undef, V)
2628end
2729
2830function allocate_GR (bra:: AbstractMPS , mpo:: AbstractMPO , ket:: AbstractMPS , i:: Int )
2931 T = Base. promote_type (scalartype (bra), scalartype (mpo), scalartype (ket))
32+ M = TensorKit. promote_storagetype (T, eltype (mpo), eltype (bra), eltype (ket))
33+ S = TensorKit. check_spacetype (bra, mpo, ket)
3034 V = right_virtualspace (ket, i) ⊗ right_virtualspace (mpo, i) ←
3135 right_virtualspace (bra, i)
3236 if V isa BlockTensorKit. TensorMapSumSpace
33- TT = blocktensormaptype (spacetype (bra) , numout (V), numin (V), T )
37+ TT = blocktensormaptype (S , numout (V), numin (V), M )
3438 else
35- TT = TensorMap{T}
39+ TT = tensormaptype (S, numout (V), numin (V), M)
3640 end
3741 return TT (undef, V)
3842end
3943
4044function allocate_GBL (bra:: QP , mpo:: AbstractMPO , ket:: QP , i:: Int )
4145 T = Base. promote_type (scalartype (bra), scalartype (mpo), scalartype (ket))
46+ M = TensorKit. promote_storagetype (T, eltype (mpo), eltype (bra), eltype (ket))
47+ S = TensorKit. check_spacetype (bra, mpo, ket)
4248 V = left_virtualspace (bra. left_gs, i) ⊗ left_virtualspace (mpo, i)' ←
4349 auxiliaryspace (ket)' ⊗ left_virtualspace (ket. right_gs, i)
4450 if V isa BlockTensorKit. TensorMapSumSpace
45- TT = blocktensormaptype (spacetype (bra) , numout (V), numin (V), T )
51+ TT = blocktensormaptype (S , numout (V), numin (V), M )
4652 else
47- TT = TensorMap{T}
53+ TT = tensormaptype (S, numout (V), numin (V), M)
4854 end
4955 return TT (undef, V)
5056end
5157
5258function allocate_GBR (bra:: QP , mpo:: AbstractMPO , ket:: QP , i:: Int )
5359 T = Base. promote_type (scalartype (bra), scalartype (mpo), scalartype (ket))
60+ M = TensorKit. promote_storagetype (T, eltype (mpo), eltype (bra), eltype (ket))
61+ S = TensorKit. check_spacetype (bra, mpo, ket)
5462 V = right_virtualspace (ket. left_gs, i) ⊗ right_virtualspace (mpo, i) ←
5563 auxiliaryspace (ket)' ⊗ right_virtualspace (bra. right_gs, i)
5664 if V isa BlockTensorKit. TensorMapSumSpace
57- TT = blocktensormaptype (spacetype (bra) , numout (V), numin (V), T )
65+ TT = blocktensormaptype (S , numout (V), numin (V), M )
5866 else
59- TT = TensorMap{T}
67+ TT = tensormaptype (S, numout (V), numin (V), M)
6068 end
6169 return TT (undef, V)
6270end
0 commit comments