Skip to content

Commit

Permalink
silente @cast warnings (#109)
Browse files Browse the repository at this point in the history
* silente @cast warnings

* require TensorCast@v0.4

---------

Co-authored-by: stecrotti <sky_96@live.it>
  • Loading branch information
abraunst and stecrotti authored Dec 15, 2023
1 parent cfa0cd4 commit 86d8ea8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Reexport = "1"
SparseArrays = "1.8"
Statistics = "1"
StatsBase = "0.34"
TensorCast = "0.3 - 0.4"
TensorCast = "0.4"
TensorTrains = "0.7, 0.8"
Tullio = "0.3"
UnPack = "1"
Expand Down
8 changes: 4 additions & 4 deletions src/mpems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ function mpem2(B::MPEM3{F}) where {F}
for t in Iterators.take(eachindex(B), length(B)-1)
U, λ, V = svd(M)
m = length(λ)
@cast Cᵗ[m, k, xᵢᵗ, xⱼᵗ] := U[(xᵢᵗ, xⱼᵗ, m), k] k:m, xᵢᵗ:qᵢᵗ, xⱼᵗ:qⱼᵗ
@cast Cᵗ[m, k, xᵢᵗ, xⱼᵗ] := U[(xᵢᵗ, xⱼᵗ, m), k] k1:m, xᵢᵗ1:qᵢᵗ, xⱼᵗ1:qⱼᵗ
C[t] = Cᵗ
@cast Vt[m, n, xᵢᵗ⁺¹] := V'[m, (n, xᵢᵗ⁺¹)] xᵢᵗ⁺¹:qᵢᵗ⁺¹
@cast Vt[m, n, xᵢᵗ⁺¹] := V'[m, (n, xᵢᵗ⁺¹)] xᵢᵗ⁺¹1:qᵢᵗ⁺¹
Bᵗ⁺¹ = B[t+1]
@tullio Bᵗ⁺¹_new[m, n, xᵢᵗ⁺¹, xⱼᵗ⁺¹, xᵢᵗ⁺²] := λ[m] *
Vt[m, l, xᵢᵗ⁺¹] * Bᵗ⁺¹[l, n, xᵢᵗ⁺¹, xⱼᵗ⁺¹, xᵢᵗ⁺²]
Expand Down Expand Up @@ -119,9 +119,9 @@ function mpem2(B::PeriodicMPEM3{F}) where {F}
for t in eachindex(B)
U, λ, V = svd(M)
m = length(λ)
@cast Cᵗ[m, k, xᵢᵗ, xⱼᵗ] := U[(xᵢᵗ, xⱼᵗ, m), k] k:m, xᵢᵗ:qᵢᵗ, xⱼᵗ:qⱼᵗ
@cast Cᵗ[m, k, xᵢᵗ, xⱼᵗ] := U[(xᵢᵗ, xⱼᵗ, m), k] k1:m, xᵢᵗ1:qᵢᵗ, xⱼᵗ1:qⱼᵗ
C[t] = Cᵗ
@cast Vt[m, n, xᵢᵗ⁺¹] := V'[m, (n, xᵢᵗ⁺¹)] xᵢᵗ⁺¹:qᵢᵗ⁺¹
@cast Vt[m, n, xᵢᵗ⁺¹] := V'[m, (n, xᵢᵗ⁺¹)] xᵢᵗ⁺¹1:qᵢᵗ⁺¹
if t < length(B)
Bᵗ⁺¹ = B[t+1]
@tullio Bᵗ⁺¹_new[m, n, xᵢᵗ⁺¹, xⱼᵗ⁺¹, xᵢᵗ⁺²] := λ[m] *
Expand Down

0 comments on commit 86d8ea8

Please sign in to comment.