diff --git a/src/algorithms/ctmrg/c4v.jl b/src/algorithms/ctmrg/c4v.jl index 3cd201d89..e986e8967 100644 --- a/src/algorithms/ctmrg/c4v.jl +++ b/src/algorithms/ctmrg/c4v.jl @@ -118,15 +118,19 @@ function check_input( west_virtualspace(O) == _elementwise_dual(north_virtualspace(O)) || throw(ArgumentError("C4v CTMRG requires south and west virtual space to be the dual of north and east virtual space.")) # check rotation invariance of the local tensors, with the exact spaceflips we assume - _isapprox_localsandwich(O, flip_virtualspace(_rotl90_localsandwich(O), [EAST, WEST]); atol = atol) || - throw(ArgumentError("C4v CTMRG requires the local tensors to be invariant under 90° rotation.")) + is_rotation_invariant = try + _isapprox_localsandwich(O, flip_virtualspace(_rotl90_localsandwich(O), [EAST, WEST]); atol) + catch + false # _isapprox_localsandwich errors if the symmetry action changes the spaces (e.g. in case of non self-dual irreps) + end + is_rotation_invariant || @warn("The local tensors are not invariant under 90° rotation. In general, C4v CTMRG is not expected to work in this case.") # check the hermitian reflection invariance of the local tensors, with the exact spaceflips we assume - _isapprox_localsandwich( - O, - flip_physicalspace(flip_virtualspace(herm_depth(O), [EAST, WEST])); - atol = atol - ) || - throw(ArgumentError("C4v CTMRG requires the local tensors to be invariant under hermitian reflection.")) + is_herm_reflection_invariant = try + _isapprox_localsandwich(O, flip_physicalspace(flip_virtualspace(herm_depth(O), [EAST, WEST])); atol) + catch + false + end + is_herm_reflection_invariant || @warn("The local tensors are not invariant under hermitian reflection. In general, C4v CTMRG is not expected to work in this case.") # TODO: check compatibility of network and environment spaces in general? return nothing end diff --git a/src/algorithms/optimization/fixed_point_differentiation.jl b/src/algorithms/optimization/fixed_point_differentiation.jl index 9b28a0f96..e3c67b4bb 100644 --- a/src/algorithms/optimization/fixed_point_differentiation.jl +++ b/src/algorithms/optimization/fixed_point_differentiation.jl @@ -218,9 +218,9 @@ function _check_algorithm_combination(::SequentialCTMRG, ::GradMode{:fixed}) end function _check_algorithm_combination(::C4vCTMRG, symm::Union{Nothing, <:SymmetrizationStyle}) if !(symm isa RotateReflect) - msg = "C4vCTMRG optimization is compatible only with RotateReflect symmetrization. \ - Make sure to set `symmetrization = RotateReflect()`." - throw(ArgumentError(msg)) + msg = "C4vCTMRG optimization is compatible only with combined Hermitian reflection and rotation symmetrization. \ + Make sure to set `symmetrization = RotateReflect()` or implement an equivalent custom symmetrization scheme." + @warn msg end return nothing end