diff --git a/src/contractions/central.jl b/src/contractions/central.jl index 8797f36..c0e7f01 100644 --- a/src/contractions/central.jl +++ b/src/contractions/central.jl @@ -83,7 +83,7 @@ function batched_mul!( sinter = sb * st * max(sl1 * sl2 * min(sr1, sr2), sr1 * sr2 * min(sl1, sl2)) if sl1 * sl2 * sr1 * sr2 < sinter # @cast E[(l1, l2), (r1, r2)] := - # M.e11[l1, r1] * M.e21[l2, r1] * M.e12[l1, r2] * M.e22[l2, r2] + # M.e11[l1, r1] * M.e21[l2, r1] * M.e12[l1, r2] * M.e22[l2, r2] a11 = reshape(CuArray(M.e11), size(M.e11, 1), :, size(M.e11, 2)) a21 = reshape(CuArray(M.e21), :, size(M.e21, 1), size(M.e21, 2)) a12 = reshape(CuArray(M.e12), size(M.e12, 1), 1, 1, size(M.e12, 2)) diff --git a/src/contractions/dense.jl b/src/contractions/dense.jl index 53bd526..959a73b 100644 --- a/src/contractions/dense.jl +++ b/src/contractions/dense.jl @@ -192,7 +192,7 @@ end function contract_tensors43(B::Tensor{R,4}, A::Tensor{R,3}) where {R<:Real} # @matmul C[(x, y), (b, a), z] := sum(σ) B[y, z, a, σ] * A[x, b, σ] - @tensor C[x, y, b, a, z]:=B[y, z, a, σ] * A[x, b, σ] + @tensor C[x, y, b, a, z] := B[y, z, a, σ] * A[x, b, σ] C = reshape(C, size(C, 1) * size(C, 2), size(C, 3) * size(C, 4), size(C, 5)) return C end diff --git a/src/gauges.jl b/src/gauges.jl index a0c0f9d..d57e7e3 100644 --- a/src/gauges.jl +++ b/src/gauges.jl @@ -30,7 +30,7 @@ function update_qr!(ψ::QMps{T}, AT::AbstractArray{T,3}, i::Site) where {T<:Real QT, RT = qr_fact(ATR) RT ./= maximum(abs.(RT)) # @cast AT[x, σ, y] := QT[(x, σ), y] (σ ∈ 1:size(AT, 2)) - AT = reshape(QT, size(QT, 1) ÷ size(AT, 2), size(AT, 2), size(QT, 2)) + AT = reshape(QT, size(QT, 1) ÷ size(AT, 2), size(AT, 2), size(QT, 2)) ψ[i] = AT RT end diff --git a/src/mps/canonise.jl b/src/mps/canonise.jl index a551237..bba1734 100644 --- a/src/mps/canonise.jl +++ b/src/mps/canonise.jl @@ -97,7 +97,7 @@ function _left_sweep!( R, Q = rq_fact(M, Dcut, tolS; toGPU = ψ.onGPU, kwargs...) R ./= maximum(abs.(R)) # @cast B[x, σ, y] := Q[x, (σ, y)] (σ ∈ 1:size(B, 2)) - B = reshape(Q, size(Q, 1), size(B, 2), size(Q, 2) ÷ size(B, 2)) + B = reshape(Q, size(Q, 1), size(B, 2), size(Q, 2) ÷ size(B, 2)) ψ[i] = permutedims(B, (1, 3, 2)) end diff --git a/src/mps/utils.jl b/src/mps/utils.jl index 83745e9..047172a 100644 --- a/src/mps/utils.jl +++ b/src/mps/utils.jl @@ -42,8 +42,11 @@ end function is_left_normalized(ψ::QMps, ::Val{true}) all( - eye(eltype(ψ), size(A, 2); toGPU = true) ≈ - @tensor(Id[x, y] := A[α, x, σ] * A[α, y, σ]; backend=cuTENSOR, allocator=cuTENSOR) for A ∈ values(ψ.tensors) # TODO: split the line + eye(eltype(ψ), size(A, 2); toGPU = true) ≈ @tensor( + Id[x, y] := A[α, x, σ] * A[α, y, σ]; + backend = cuTENSOR, + allocator = cuTENSOR + ) for A ∈ values(ψ.tensors) # TODO: split the line ) end @@ -59,8 +62,11 @@ end function is_right_normalized(ψ::QMps, ::Val{true}) all( - eye(eltype(ψ), size(B, 1); toGPU = true) ≈ - @tensor(Id[x, y] := B[x, α, σ] * B[y, α, σ]; backend=cuTENSOR, allocator=cuTENSOR) for B ∈ values(ψ.tensors) # TODO: split the line + eye(eltype(ψ), size(B, 1); toGPU = true) ≈ @tensor( + Id[x, y] := B[x, α, σ] * B[y, α, σ]; + backend = cuTENSOR, + allocator = cuTENSOR + ) for B ∈ values(ψ.tensors) # TODO: split the line ) end diff --git a/src/zipper.jl b/src/zipper.jl index ae5c861..1b33a2a 100644 --- a/src/zipper.jl +++ b/src/zipper.jl @@ -110,7 +110,7 @@ function zipper( CCC = reshape(CCC, size(CCC, 1), size(CCC, 2) ÷ s1, s1) C = permutedims(CCC, (2, 1, 3)) # @cast V[x, y, z] := V[x, (y, z)] (z ∈ 1:s2) - V = reshape(V, size(V, 1), size(V, 2) ÷ s2, s2) + V = reshape(V, size(V, 1), size(V, 2) ÷ s2, s2) out[i] = V else L = onGPU ? CUDA.ones(R, 1, 1, 1) : ones(R, 1, 1, 1)