@@ -14,19 +14,19 @@ For PEPOTensor,
1414```
1515 gate_ax = 1 gate_ax = 2
1616
17- 1 2 2 2
18- ↘ | | ↘
17+ 1 2 2 2
18+ ↘ | | ↘
1919 5 - X ← 3 1 ← a - 3 5 - X ← 3 1 ← a - 3
20- | ↘ | ↘
21- 4 2 4 1
20+ | ↘ | ↘
21+ 4 2 4 1
2222```
2323"""
2424function bond_tensor_first (A:: PEPSTensor ; gate_ax:: Integer = 1 , kwargs... )
2525 @assert gate_ax == 1
2626 X, a = left_orth! (permute (A, ((2 , 4 , 5 ), (1 , 3 )); copy = true ); kwargs... )
2727 X = permute (X, (1 , 4 , 2 , 3 ))
2828 a = permute (a, ((1 , 2 ), (3 ,)))
29- return X, a
29+ return a, X
3030end
3131function bond_tensor_first (A:: PEPOTensor ; gate_ax:: Integer = 1 , kwargs... )
3232 @assert 1 <= gate_ax <= 2
@@ -37,17 +37,17 @@ function bond_tensor_first(A::PEPOTensor; gate_ax::Integer = 1, kwargs...)
3737 end
3838 X = permute (X, (1 , 2 , 5 , 3 , 4 ))
3939 a = permute (a, ((1 , 2 ), (3 ,)))
40- return X, a
40+ return a, X
4141end
4242
4343"""
4444Undo the decomposition in `bond_tensor_first`.
4545"""
46- function undo_bond_tensor_first (X :: PEPSOrth , a :: MPSTensor ; gate_ax:: Integer = 1 )
46+ function undo_bond_tensor_first (a :: MPSTensor , X :: PEPSOrth ; gate_ax:: Integer = 1 )
4747 @assert gate_ax == 1
4848 return @tensor A[- 1 ; - 2 - 3 - 4 - 5 ] := X[- 2 1 - 4 - 5 ] * a[1 - 1 - 3 ]
4949end
50- function undo_bond_tensor_first (X :: PEPOOrth , a :: MPSTensor ; gate_ax:: Integer = 1 )
50+ function undo_bond_tensor_first (a :: MPSTensor , X :: PEPOOrth ; gate_ax:: Integer = 1 )
5151 @assert 1 <= gate_ax <= 2
5252 if gate_ax == 1
5353 return @tensor A[- 1 - 2 ; - 3 - 4 - 5 - 6 ] := X[- 2 - 3 1 - 5 - 6 ] * a[1 - 1 - 4 ]
@@ -84,7 +84,7 @@ function bond_tensor_last(A::PEPSTensor; gate_ax::Integer = 1, kwargs...)
8484 Y, b = left_orth! (permute (A, ((2 , 3 , 4 ), (1 , 5 )); copy = true ); kwargs... )
8585 Y = permute (Y, (1 , 2 , 3 , 4 ))
8686 b = permute (b, ((3 , 2 ), (1 ,)))
87- return Y, b
87+ return b, Y
8888end
8989function bond_tensor_last (A:: PEPOTensor ; gate_ax:: Integer = 1 , kwargs... )
9090 @assert 1 <= gate_ax <= 2
@@ -95,17 +95,17 @@ function bond_tensor_last(A::PEPOTensor; gate_ax::Integer = 1, kwargs...)
9595 end
9696 Y = permute (Y, (1 , 2 , 3 , 4 , 5 ))
9797 b = permute (b, ((3 , 2 ), (1 ,)))
98- return Y, b
98+ return b, Y
9999end
100100
101101"""
102102Undo the decomposition in `bond_tensor_last`.
103103"""
104- function undo_bond_tensor_last (Y :: PEPSOrth , b :: MPSTensor ; gate_ax:: Integer = 1 )
104+ function undo_bond_tensor_last (b :: MPSTensor , Y :: PEPSOrth ; gate_ax:: Integer = 1 )
105105 @assert gate_ax == 1
106106 return @tensor A[- 1 ; - 2 - 3 - 4 - 5 ] := b[- 5 - 1 1 ] * Y[- 2 - 3 - 4 1 ]
107107end
108- function undo_bond_tensor_last (Y :: PEPOOrth , b :: MPSTensor ; gate_ax:: Integer = 1 )
108+ function undo_bond_tensor_last (b :: MPSTensor , Y :: PEPOOrth ; gate_ax:: Integer = 1 )
109109 @assert 1 <= gate_ax <= 2
110110 if gate_ax == 1
111111 return @tensor A[- 1 - 2 ; - 3 - 4 - 5 - 6 ] := b[- 6 - 1 1 ] * Y[- 2 - 3 - 4 - 5 1 ]
0 commit comments