From 7d8ed7311a061e24edab57a3b0e28d058bec5762 Mon Sep 17 00:00:00 2001 From: Paul Brehmer Date: Wed, 3 Apr 2024 17:09:33 +0200 Subject: [PATCH] Cleaned up hacky rotate_north method that is not needed anymore --- examples/test_gauge_fixing.jl | 2 +- src/utility/rotations.jl | 19 ------------------- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/examples/test_gauge_fixing.jl b/examples/test_gauge_fixing.jl index f5122884..e88c0258 100644 --- a/examples/test_gauge_fixing.jl +++ b/examples/test_gauge_fixing.jl @@ -36,7 +36,7 @@ test_gauge_fixing(randn, ComplexF64, P, V, E; χenv, unitcell=(1, 1)) test_gauge_fixing(randn, ComplexF64, P, V, E; χenv, unitcell=(2, 2)) test_gauge_fixing(randn, ComplexF64, P, V, E; χenv, unitcell=(3, 4)) # check gauge-fixing for unit cells > (2, 2) -# Convergence of real CTMRG seems to be more sensitive to initial guesse +# Convergence of real CTMRG seems to be more sensitive to initial guess test_gauge_fixing(randn, Float64, P, V, E; χenv, unitcell=(1, 1)) test_gauge_fixing(randn, Float64, P, V, E; χenv, unitcell=(2, 2)) test_gauge_fixing(randn, Float64, P, V, E; χenv, unitcell=(3, 4)) diff --git a/src/utility/rotations.jl b/src/utility/rotations.jl index 5b202bf9..983a8292 100644 --- a/src/utility/rotations.jl +++ b/src/utility/rotations.jl @@ -10,22 +10,3 @@ const SOUTHWEST = 4 # Rotate tensor to any direction by successive application of Base.rotl90 rotate_north(t, dir) = mod1(dir, 4) == NORTH ? t : rotate_north(rotl90(t), dir - 1) - -# Hacked version for AbstractArray{T,3} which doesn't need to overload rotl90 to avoid type piracy -function rotate_north(A::AbstractArray{T,3}, dir) where {T} - for _ in 1:(mod1(dir, size(A, 1)) - 1) - # Initialize copy with rotated sizes - A′ = Zygote.Buffer(Array{T,3}(undef, size(A, 1), size(A, 3), size(A, 2))) - for dir in 1:size(A, 1) - # A′[_prev(dir, size(A, 1)), :, :] = rotl90(A[dir, :, :]) - # throws setindex! error for non-symmetric unit cells - rA = rotl90(A[dir, :, :]) - for r in 1:size(A, 3), c in 1:size(A, 2) - A′[_prev(dir, size(A, 1)), r, c] = rA[r, c] - end - end - A = A′ - end - - return copy(A) -end