You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/states/finitemps.jl
+18-13Lines changed: 18 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -3,13 +3,18 @@
3
3
4
4
Type that represents a finite Matrix Product State.
5
5
6
-
## Fields
7
-
- `ALs` -- left-gauged MPS tensors
8
-
- `ARs` -- right-gauged MPS tensors
9
-
- `ACs` -- center-gauged MPS tensors
10
-
- `Cs` -- gauge tensors
6
+
## Properties
7
+
- `AL` -- left-gauged MPS tensors
8
+
- `AR` -- right-gauged MPS tensors
9
+
- `AC` -- center-gauged MPS tensors
10
+
- `C` -- gauge tensors
11
+
- `center` -- location of the gauge center
12
+
13
+
The center property returns `center::HalfInt` that indicates the location of the MPS center:
14
+
- `isinteger(center)` → `center` is a whole number and indicates the location of the first `AC` tensor present in the underlying `ψ.ACs` field.
15
+
- `ishalfodd(center)` → `center` is a half-odd-integer, meaning that there are no `AC` tensors, and indicating between which sites the bond tensor lives.
11
16
12
-
Where each is entry can be a tensor or `missing`.
17
+
e.g `mps.center = 7/2` means that the bond tensor is to the right of the 3rd site and can be accessed via `mps.C[3]`.
13
18
14
19
## Notes
15
20
By convention, we have that:
@@ -131,14 +136,14 @@ function Base.getproperty(ψ::FiniteMPS, prop::Symbol)
131
136
elseif prop == :C
132
137
return CView(ψ)
133
138
elseif prop == :center
134
-
returncenter(ψ)
139
+
return_gaugecenter(ψ)
135
140
else
136
141
return getfield(ψ, prop)
137
142
end
138
143
end
139
144
140
145
"""
141
-
center(ψ::FiniteMPS)::HalfInt
146
+
_gaugecenter(ψ::FiniteMPS)::HalfInt
142
147
143
148
Return the location of the MPS center.
144
149
@@ -149,12 +154,12 @@ Return the location of the MPS center.
149
154
## Example
150
155
```julia
151
156
ψ = FiniteMPS(3, ℂ^2, ℂ^16)
152
-
center(ψ) # returns 7/2, bond tensor is to the right of the 3rd site
157
+
ψ.center # returns 7/2, bond tensor is to the right of the 3rd site
153
158
ψ.AC[1] # moves center to first site
154
-
center(ψ) # returns 1
159
+
ψ.center # returns 1
155
160
```
156
161
"""
157
-
functioncenter(ψ::FiniteMPS)::HalfInt
162
+
function_gaugecenter(ψ::FiniteMPS)::HalfInt
158
163
L = length(ψ)
159
164
160
165
center = findfirst(!ismissing, ψ.ACs) # give priority to integer values of center
@@ -352,7 +357,7 @@ function Base.show(io::IOContext, ψ::FiniteMPS)
352
357
end
353
358
354
359
L = length(ψ)
355
-
c = center(ψ)
360
+
c = ψ.center
356
361
357
362
for site in HalfInt.(reverse((1 / 2):(1 / 2):(L + 1 / 2)))
358
363
if site < half_screen_rows || site > L - half_screen_rows
@@ -494,7 +499,7 @@ function TensorKit.dot(ψ₁::FiniteMPS, ψ₂::FiniteMPS)
0 commit comments