From 0170af173231ff8d7e6858267182f91b0720c311 Mon Sep 17 00:00:00 2001 From: leburgel Date: Wed, 5 Nov 2025 16:37:12 +0100 Subject: [PATCH 1/2] Disallow dual physical spaces for symmetries with non-trivial braiding --- src/operators/infinitepepo.jl | 3 +++ src/states/infinitepeps.jl | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/operators/infinitepepo.jl b/src/operators/infinitepepo.jl index 92e28ae71..b44ab8265 100644 --- a/src/operators/infinitepepo.jl +++ b/src/operators/infinitepepo.jl @@ -12,7 +12,10 @@ struct InfinitePEPO{T <: PEPOTensor} InfinitePEPO{T}(A::Array{T, 3}) where {T} = new{T}(A) function InfinitePEPO(A::Array{T, 3}) where {T <: PEPOTensor} # space checks + bosonic_braiding = BraidingStyle(sectortype(T)) === Bosonic() for (d, w, h) in Tuple.(CartesianIndices(A)) + (bosonic_braiding || (!isdual(domain_physicalspace(A[d, w, h])) && !isdual(codomain_physicalspace(A[d, w, h])))) || + throw(ArgumentError("Dual physical spaces are not allowed (for now).")) codomain_physicalspace(A[d, w, h]) == domain_physicalspace(A[d, w, _next(h, end)]) || throw(SpaceMismatch("Physical space at site $((d, w, h)) does not match.")) north_virtualspace(A[d, w, h]) == south_virtualspace(A[_prev(d, end), w, h])' || diff --git a/src/states/infinitepeps.jl b/src/states/infinitepeps.jl index 4da54d0e0..28d373c16 100644 --- a/src/states/infinitepeps.jl +++ b/src/states/infinitepeps.jl @@ -11,7 +11,10 @@ struct InfinitePEPS{T <: PEPSTensor} A::Matrix{T} InfinitePEPS{T}(A::Matrix{T}) where {T <: PEPSTensor} = new{T}(A) function InfinitePEPS(A::Array{T, 2}) where {T <: PEPSTensor} + bosonic_braiding = BraidingStyle(sectortype(T)) === Bosonic() for (d, w) in Tuple.(CartesianIndices(A)) + (bosonic_braiding || !isdual(physicalspace(A[d, w]))) || + throw(ArgumentError("Dual physical spaces for symmetry sectors with non-trivial twists are not allowed (for now).")) north_virtualspace(A[d, w]) == south_virtualspace(A[_prev(d, end), w])' || throw( SpaceMismatch("North virtual space at site $((d, w)) does not match.") From d3848f8581c34e3a60fa4038094c9da90117c47f Mon Sep 17 00:00:00 2001 From: Yue Zhengyuan Date: Thu, 6 Nov 2025 09:53:18 +0800 Subject: [PATCH 2/2] Update error message for iPEPO --- src/operators/infinitepepo.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/operators/infinitepepo.jl b/src/operators/infinitepepo.jl index b44ab8265..e16b4cfca 100644 --- a/src/operators/infinitepepo.jl +++ b/src/operators/infinitepepo.jl @@ -15,7 +15,7 @@ struct InfinitePEPO{T <: PEPOTensor} bosonic_braiding = BraidingStyle(sectortype(T)) === Bosonic() for (d, w, h) in Tuple.(CartesianIndices(A)) (bosonic_braiding || (!isdual(domain_physicalspace(A[d, w, h])) && !isdual(codomain_physicalspace(A[d, w, h])))) || - throw(ArgumentError("Dual physical spaces are not allowed (for now).")) + throw(ArgumentError("Dual physical spaces for symmetry sectors with non-trivial twists are not allowed (for now).")) codomain_physicalspace(A[d, w, h]) == domain_physicalspace(A[d, w, _next(h, end)]) || throw(SpaceMismatch("Physical space at site $((d, w, h)) does not match.")) north_virtualspace(A[d, w, h]) == south_virtualspace(A[_prev(d, end), w, h])' ||