22"""
33 const PEPSWeight
44
5- Default type for PEPS bond weights with 2 virtual indices, conventionally ordered as: ``wt : WS ← EN``.
5+ Default type for PEPS bond weights with 2 virtual indices, conventionally ordered as: ``wt : WS ← EN``.
66`WS`, `EN` denote the west/south, east/north spaces for x/y-weights on the square lattice, respectively.
77"""
88const PEPSWeight{T,S} = AbstractTensorMap{T,S,1 ,1 }
99
1010"""
1111 struct SUWeight{E<:PEPSWeight}
1212
13- Schmidt bond weights used in simple/cluster update.
13+ Schmidt bond weights used in simple/cluster update.
1414Weight elements are always real and non-negative.
15- The domain and codomain of each weight matrix
15+ The domain and codomain of each weight matrix
1616must be an un-dualed `ElementarySapce`.
1717
1818## Fields
@@ -65,6 +65,12 @@ Base.setindex!(W::SUWeight, args...) = (Base.setindex!(W.data, args...); W)
6565Base. axes (W:: SUWeight , args... ) = axes (W. data, args... )
6666Base. iterate (W:: SUWeight , args... ) = iterate (W. data, args... )
6767
68+ # # spaces
69+ TensorKit. spacetype (w:: SUWeight ) = spacetype (typeof (w))
70+ TensorKit. spacetype (:: Type{T} ) where {E,T<: SUWeight{E} } = spacetype (E)
71+ TensorKit. sectortype (w:: SUWeight ) = sectortype (typeof (w))
72+ TensorKit. sectortype (:: Type{<:SUWeight{T}} ) where {T} = sectortype (spacetype (T))
73+
6874# # (Approximate) equality
6975function Base.:(== )(wts1:: SUWeight , wts2:: SUWeight )
7076 return wts1. data == wts2. data
97103
98104Represents an infinite projected entangled-pair state on a 2D square lattice
99105consisting of vertex tensors and bond weights.
100- The vertex tensor, x-weight and y-weight at row `i`, column `j`
106+ The vertex tensor, x-weight and y-weight at row `i`, column `j`
101107are defined as (the numbers show the axis order)
102108```
103109 2
166172Create an InfiniteWeightPEPS by specifying the physical, north virtual and east virtual spaces
167173of the PEPS vertex tensor at each site in the unit cell as a matrix.
168174Each individual space can be specified as either an `Int` or an `ElementarySpace`.
169- Bond weights are initialized as identity matrices of element type `Float64`.
175+ Bond weights are initialized as identity matrices of element type `Float64`.
170176"""
171177function InfiniteWeightPEPS (
172178 Pspaces:: M , Nspaces:: M , Espaces:: M
192198 InfiniteWeightPEPS([f=randn, T=ComplexF64,] Pspace::S, Nspace::S, Espace::S=Nspace; unitcell::Tuple{Int,Int}=(1, 1)) where {S<:ElementarySpace}
193199
194200Create an InfiniteWeightPEPS by specifying its physical, north and east spaces (as `ElementarySpace`s) and unit cell size.
195- Use `T` to specify the element type of the vertex tensors.
196- Bond weights are initialized as identity matrices of element type `Float64`.
201+ Use `T` to specify the element type of the vertex tensors.
202+ Bond weights are initialized as identity matrices of element type `Float64`.
197203"""
198204function InfiniteWeightPEPS (Pspaces:: S , Nspaces:: S , Espaces:: S ) where {S<: ElementarySpace }
199205 return InfiniteWeightPEPS (randn, ComplexF64, Pspaces, Nspaces, Espaces)
@@ -210,6 +216,11 @@ function Base.size(peps::InfiniteWeightPEPS)
210216 return size (peps. vertices)
211217end
212218
219+ TensorKit. spacetype (peps:: InfiniteWeightPEPS ) = spacetype (typeof (peps))
220+ TensorKit. spacetype (:: Type{T} ) where {E,T<: InfiniteWeightPEPS{E} } = spacetype (E)
221+ TensorKit. sectortype (peps:: InfiniteWeightPEPS ) = sectortype (typeof (peps))
222+ TensorKit. sectortype (:: Type{<:InfiniteWeightPEPS{T}} ) where {T} = sectortype (spacetype (T))
223+
213224function _absorb_weights (
214225 t:: PEPSTensor ,
215226 weights:: SUWeight ,
@@ -271,13 +282,13 @@ position (`row`, `col`) in the unit cell. Weights around the tensor at `(row, co
271282
272283## Arguments
273284
274- - `t::T` : The vertex tensor to which the weight will be absorbed. The first axis of `t` should be the physical axis.
285+ - `t::T` : The vertex tensor to which the weight will be absorbed. The first axis of `t` should be the physical axis.
275286- `row::Int` : The row index specifying the position in the tensor network.
276287- `col::Int` : The column index specifying the position in the tensor network.
277288- `ax::Int` : The axis into which the weight is absorbed, taking values from 1 to 4, standing for north, east, south, west respectively.
278289- `weights::SUWeight` : The weight object to absorb into the tensor.
279290
280- ## Keyword arguments
291+ ## Keyword arguments
281292
282293- `sqrtwt::Bool=false` : If `true`, the square root of the weight is absorbed.
283294- `invwt::Bool=false` : If `true`, the inverse of the weight is absorbed.
373384 : : :
374385 ```
375386
376- - After `mirror_antidiag`, x/y-weights are exchanged.
387+ - After `mirror_antidiag`, x/y-weights are exchanged.
377388 ```
378389 | | |
379390 x₃₃ x₂₃ x₁₃
391402 x₃₃ x₂₃ x₁₃
392403 : : :
393404 ```
394- No further operations are needed.
405+ No further operations are needed.
395406
396- - After `rotl90`, x/y-weights are exchanged.
407+ - After `rotl90`, x/y-weights are exchanged.
397408 ```
398409 | | |
399410 x₁₃ x₂₃ x₃₃
414425 We need to further:
415426 - Move 1st column of x-weights to the last column.
416427 - Permute axes of x-weights.
417- - Flip x-arrows from → to ←.
428+ - Flip x-arrows from → to ←.
418429
419- - After `rotr90`, x/y-weights are exchanged.
430+ - After `rotr90`, x/y-weights are exchanged.
420431 ```
421432 : : :
422433 x₃₃ x₂₃ x₁₃
@@ -435,11 +446,11 @@ end
435446 | | |
436447 ```
437448 We need to further:
438- - Move last row of y-weights to the 1st row.
439- - Permute axes of y-weights.
440- - Flip y-arrows from ↑ to ↓.
449+ - Move last row of y-weights to the 1st row.
450+ - Permute axes of y-weights.
451+ - Flip y-arrows from ↑ to ↓.
441452
442- After `rot180`, x/y-weights are not exchanged.
453+ After `rot180`, x/y-weights are not exchanged.
443454 ```
444455 : : :
445456 y₁₃ y₁₂ y₁₁
@@ -460,8 +471,8 @@ After `rot180`, x/y-weights are not exchanged.
460471 We need to further:
461472 - Move 1st column of x-weights to the last column.
462473 - Move last row of y-weights to the 1st row.
463- - Permute axes of all weights and twist their axis 1.
464- - Flip x-arrows from → to ←, and y-arrows from ↑ to ↓.
474+ - Permute axes of all weights and twist their axis 1.
475+ - Flip x-arrows from → to ←, and y-arrows from ↑ to ↓.
465476=#
466477
467478"""
0 commit comments