Skip to content

Commit ead253e

Browse files
committed
Add mapping from InfinitePEPO to InfinitePEPS or InfinitePartitionFunction
1 parent 85b9aa7 commit ead253e

2 files changed

Lines changed: 37 additions & 0 deletions

File tree

src/networks/tensors.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,23 @@ function physicalspace(t::PEPOTensor)
123123
return codomain_physicalspace(t)
124124
end
125125
virtualspace(t::PEPOTensor, dir) = space(t, dir + 2)
126+
127+
"""
128+
$(SIGNATURES)
129+
130+
Fuse the physical indices of a PEPO tensor, obtaining a PEPS tensor.
131+
"""
132+
function fuse_physicalspaces(O::PEPOTensor)
133+
F = isomorphism(Int, fuse(codomain(O)), codomain(O))
134+
return F * O, F
135+
end
136+
137+
"""
138+
$(SIGNATURES)
139+
140+
Trace out the physical indices of a PEPO tensor, obtaining a partition function tensor.
141+
"""
142+
function contract_physicalspaces(O::PEPOTensor)
143+
@plansor t[W S; N E] := O[p p; N E S W]
144+
return t
145+
end

src/operators/infinitepepo.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,23 @@ function InfiniteSquareNetwork(top::InfinitePEPS, mid::InfinitePEPO, bot::Infini
173173
)
174174
end
175175

176+
## Conversion to states
177+
178+
function InfinitePartitionFunction::InfinitePEPO)
179+
size(ρ, 3) == 1 || throw(DimensionMismatch("Only single-layer density matrices can be converted to partition functions"))
180+
return InfinitePartitionFunction(
181+
contract_physicalspaces.(reshape(unitcell(ρ), size(ρ, 1), size(ρ, 2)))
182+
)
183+
end
184+
185+
function InfinitePEPS::InfinitePEPO)
186+
size(ρ, 3) == 1 || throw(DimensionMismatch("Only single-layer density matrices can be converted to partition functions"))
187+
return InfinitePEPS(
188+
first.(fuse_physicalspaces.(reshape(unitcell(ρ), size(ρ, 1), size(ρ, 2))))
189+
)
190+
end
191+
192+
176193
## Vector interface
177194

178195
VI.scalartype(::Type{NT}) where {NT <: InfinitePEPO} = scalartype(eltype(NT))

0 commit comments

Comments
 (0)