Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions src/algorithms/ctmrg/c4v.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/algorithms/optimization/fixed_point_differentiation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading