Skip to content

Commit 0c86e39

Browse files
Add InfinitePEPS to InfiniteWeightPEPS conversion (#172)
* Update InfiniteWeightPEPS Add function to convert an InfinitePEPS to an InfiniteWeightPEPS * add assert !isdual(V) --------- Co-authored-by: Lander Burgelman <39218680+leburgel@users.noreply.github.com>
1 parent 0ab6e4a commit 0c86e39

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/states/infiniteweightpeps.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,21 @@ function InfinitePEPS(peps::InfiniteWeightPEPS)
267267
)
268268
end
269269

270+
"""
271+
InfiniteWeightPEPS(peps::InfinitePEPS)
272+
273+
Create `InfiniteWeightPEPS` from `InfinitePEPS` by initializing the bond weights as identity matrices of element type `Float64`.
274+
"""
275+
function InfiniteWeightPEPS(peps::InfinitePEPS)
276+
Nr, Nc = size(peps)
277+
weights = map(Iterators.product(1:2, 1:Nr, 1:Nc)) do (d, r, c)
278+
V = (d == 1 ? domain(peps[r, c])[2] : domain(peps[r, c])[1])
279+
@assert !isdual(V)
280+
DiagonalTensorMap(ones(reduceddim(V)), V)
281+
end
282+
return InfiniteWeightPEPS(peps.A, SUWeight(weights))
283+
end
284+
270285
"""
271286
mirror_antidiag(peps::InfiniteWeightPEPS)
272287

0 commit comments

Comments
 (0)