diff --git a/src/operators/infinitepepo.jl b/src/operators/infinitepepo.jl index 92e28ae71..e16b4cfca 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 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])' || 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.")