|
| 1 | +using Test |
| 2 | +using TensorKit |
| 3 | +using PEPSKit |
| 4 | +using PEPSKit: PEPSTensor, PFTensor, PEPSSandwich, PEPOSandwich |
| 5 | + |
| 6 | +T = ComplexF64 |
| 7 | +Ss = [Trivial, U1Irrep] |
| 8 | +Ps = [ComplexSpace(2), U1Space(0 => 1, 1 => 1)] |
| 9 | +Vs = [ComplexSpace(3), U1Space(0 => 2, -1 => 1, 1 => 1)] |
| 10 | + |
| 11 | +sizes = [(1, 1), (3, 3)] |
| 12 | + |
| 13 | +@testset "$(sz) InfiniteSquareNetwork with $(Ss[i]) symmetry" for (i, sz) in |
| 14 | + Iterators.product(eachindex(Ss), sizes) |
| 15 | + |
| 16 | + S = Ss[i] |
| 17 | + P = Ps[i] |
| 18 | + V = Vs[i] |
| 19 | + |
| 20 | + peps_tensor = PEPSTensor(randn, T, P, V) |
| 21 | + pf_tensor = PFTensor(randn, T, V) |
| 22 | + pepo_tensor = randn(T, P ⊗ P' ← V ⊗ V ⊗ V' ⊗ V') |
| 23 | + |
| 24 | + peps = InfinitePEPS(peps_tensor; unitcell = sz) |
| 25 | + pf = InfinitePartitionFunction(pf_tensor; unitcell = sz) |
| 26 | + pepo = InfinitePEPO(pepo_tensor; unitcell = (sz..., 2)) |
| 27 | + |
| 28 | + peps_n = InfiniteSquareNetwork(peps) |
| 29 | + pf_n = InfiniteSquareNetwork(pf) |
| 30 | + pepo_n = InfiniteSquareNetwork(peps, pepo) |
| 31 | + |
| 32 | + @test scalartype(peps_n) == T |
| 33 | + @test eltype(peps_n) == PEPSSandwich{typeof(peps_tensor)} |
| 34 | + @test spacetype(peps_n) == typeof(P) |
| 35 | + @test sectortype(peps_n) == S |
| 36 | + |
| 37 | + @test scalartype(pf_n) == T |
| 38 | + @test eltype(pf_n) == typeof(pf_tensor) |
| 39 | + @test spacetype(pf_n) == typeof(V) |
| 40 | + @test sectortype(pf_n) == S |
| 41 | + |
| 42 | + @test scalartype(pepo_n) == T |
| 43 | + @test eltype(pepo_n) == PEPOSandwich{2, typeof(peps_tensor), typeof(pepo_tensor)} |
| 44 | + @test spacetype(pepo_n) == typeof(P) |
| 45 | + @test sectortype(pepo_n) == S |
| 46 | + |
| 47 | + @test peps_n + peps_n ≈ 2 * peps_n |
| 48 | + @test repeat(InfiniteSquareNetwork(InfinitePEPS(peps_tensor)), sz...) == peps_n |
| 49 | + @test (rotl90 ∘ rotl90)(peps_n) ≈ rot180(peps_n) |
| 50 | + |
| 51 | + @test pf_n + pf_n ≈ 2 * pf_n |
| 52 | + @test (rotr90 ∘ rotr90)(pf_n) ≈ rot180(pf_n) |
| 53 | + |
| 54 | + @test length(peps_n) == prod(sz) |
| 55 | +end |
0 commit comments