From 542826179ed4fa8c400744d68680341f8fec70a4 Mon Sep 17 00:00:00 2001 From: Matthew Fishman Date: Sun, 26 Apr 2026 14:03:35 -0400 Subject: [PATCH 1/2] Drop OrdinaryDiffEqTsit5 dependency and ODE-solver helpers The OrdinaryDiffEq stack is heavy and was pulled in only for an example and one TDVP test that compared a Tsit5-based local updater against a Krylov-based one. Removing it speeds up test/example loading and avoids version-resolution friction with the broader OrdinaryDiffEq ecosystem. Source-side cleanup: - Delete `src/solvers/timedependentsum.jl` (`TimeDependentSum`, `ScaledSum`, related helpers). - Delete `src/solvers/ITensorsExtensions.jl` (`to_vec`). - Drop `TimeDependentSum` and `to_vec` from exports and from the exported-names test list. Test/example cleanup: - Delete `test/base/test_solvers/test_tdvp_time_dependent.jl` and the three `examples/solvers/03_*.jl` files (models, ODE updaters, time- dependent TDVP demo). - Rename `examples/solvers/04_tdvp_observers.jl` to `03_tdvp_observers.jl` and update the example list in `test/base/test_solvers/test_examples.jl`. - Drop `OrdinaryDiffEqTsit5` from the test, `test/base/test_solvers`, and `examples/solvers` Project.tomls; drop now-unused `Compat` and `KrylovKit` from `examples/solvers/Project.toml`. Removing the public exports `TimeDependentSum` and `to_vec` is breaking, so bump 0.3.45 -> 0.4.0 and update the package compat pin in `test/`, `docs/`, and `examples/` Project.tomls accordingly. Co-Authored-By: Claude Opus 4.7 (1M context) --- Project.toml | 2 +- docs/Project.toml | 2 +- examples/Project.toml | 2 +- examples/solvers/03_models.jl | 20 -- ...tdvp_observers.jl => 03_tdvp_observers.jl} | 0 examples/solvers/03_tdvp_time_dependent.jl | 177 ------------------ examples/solvers/03_updaters.jl | 23 --- examples/solvers/Project.toml | 3 - src/ITensorMPS.jl | 3 - src/exports.jl | 2 - src/solvers/ITensorsExtensions.jl | 9 - src/solvers/timedependentsum.jl | 68 ------- test/Project.toml | 4 +- test/base/test_solvers/Project.toml | 1 - test/base/test_solvers/test_examples.jl | 5 +- .../test_solvers/test_tdvp_time_dependent.jl | 109 ----------- .../base/utils/TestITensorMPSExportedNames.jl | 2 - 17 files changed, 5 insertions(+), 427 deletions(-) delete mode 100644 examples/solvers/03_models.jl rename examples/solvers/{04_tdvp_observers.jl => 03_tdvp_observers.jl} (100%) delete mode 100644 examples/solvers/03_tdvp_time_dependent.jl delete mode 100644 examples/solvers/03_updaters.jl delete mode 100644 src/solvers/ITensorsExtensions.jl delete mode 100644 src/solvers/timedependentsum.jl delete mode 100644 test/base/test_solvers/test_tdvp_time_dependent.jl diff --git a/Project.toml b/Project.toml index df8ec1f0..7b664694 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "ITensorMPS" uuid = "0d1a4710-d33b-49a5-8f18-73bdf49b47e2" -version = "0.3.46" +version = "0.4.0" authors = ["Matthew Fishman ", "Miles Stoudenmire "] [workspace] diff --git a/docs/Project.toml b/docs/Project.toml index dd6d3034..3955ffcf 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -11,6 +11,6 @@ path = ".." [compat] Documenter = "1.9" ITensorFormatter = "0.2.27" -ITensorMPS = "0.3.9" +ITensorMPS = "0.4" ITensors = "0.8.1, 0.9" Literate = "2.20.1" diff --git a/examples/Project.toml b/examples/Project.toml index f96b296f..579c17cd 100644 --- a/examples/Project.toml +++ b/examples/Project.toml @@ -5,4 +5,4 @@ ITensorMPS = "0d1a4710-d33b-49a5-8f18-73bdf49b47e2" path = ".." [compat] -ITensorMPS = "0.3" +ITensorMPS = "0.4" diff --git a/examples/solvers/03_models.jl b/examples/solvers/03_models.jl deleted file mode 100644 index 0e437381..00000000 --- a/examples/solvers/03_models.jl +++ /dev/null @@ -1,20 +0,0 @@ -using ITensorMPS: OpSum - -function heisenberg(n; J = 1.0, J2 = 0.0) - ℋ = OpSum() - if !iszero(J) - for j in 1:(n - 1) - ℋ += J / 2, "S+", j, "S-", j + 1 - ℋ += J / 2, "S-", j, "S+", j + 1 - ℋ += J, "Sz", j, "Sz", j + 1 - end - end - if !iszero(J2) - for j in 1:(n - 2) - ℋ += J2 / 2, "S+", j, "S-", j + 2 - ℋ += J2 / 2, "S-", j, "S+", j + 2 - ℋ += J2, "Sz", j, "Sz", j + 2 - end - end - return ℋ -end diff --git a/examples/solvers/04_tdvp_observers.jl b/examples/solvers/03_tdvp_observers.jl similarity index 100% rename from examples/solvers/04_tdvp_observers.jl rename to examples/solvers/03_tdvp_observers.jl diff --git a/examples/solvers/03_tdvp_time_dependent.jl b/examples/solvers/03_tdvp_time_dependent.jl deleted file mode 100644 index 2f769625..00000000 --- a/examples/solvers/03_tdvp_time_dependent.jl +++ /dev/null @@ -1,177 +0,0 @@ -using ITensorMPS: MPO, MPS, contract, inner, random_mps, siteinds, tdvp -using ITensors: @disable_warn_order -using LinearAlgebra: norm -using Random: Random - -include("03_models.jl") -include("03_updaters.jl") - -""" -Run the example on CPU: - -```julia -main() -``` - -Run the example on CPU with single precision: - -```julia -main(; eltype = Float32) -``` - -Run the example on GPU: - -```julia -using CUDA: cu -main(; eltype = Float32, device = cu) -``` -""" -function main(; eltype = Float64, device = identity) - Random.seed!(1234) - - # Time dependent Hamiltonian is: - # H(t) = H₁(t) + H₂(t) + … - # = f₁(t) H₁(0) + f₂(t) H₂(0) + … - # = cos(ω₁t) H₁(0) + cos(ω₂t) H₂(0) + … - - # Number of sites - n = 6 - - # How much information to output from TDVP - # Set to 2 to get information about each bond/site - # evolution, and 3 to get information about the - # updater. - outputlevel = 3 - - # Frequency of time dependent terms - ω₁ = one(eltype) / 10 - ω₂ = one(eltype) / 5 - - # Nearest and next-nearest neighbor - # Heisenberg couplings. - J₁ = one(eltype) - J₂ = one(eltype) - - time_step = one(eltype) / 10 - time_stop = one(eltype) - - # nsite-update TDVP - nsite = 2 - - # Starting state bond/link dimension. - # A product state starting state can - # cause issues for TDVP without - # subspace expansion. - start_linkdim = 4 - - # TDVP truncation parameters - maxdim = 100 - cutoff = √(eps(eltype)) - - tol = 10 * eps(eltype) - - @show n - @show ω₁, ω₂ - @show J₁, J₂ - @show maxdim, cutoff, nsite - @show start_linkdim - @show time_step, time_stop - - ω⃗ = (ω₁, ω₂) - f⃗ = map(ω -> (t -> cos(ω * t)), ω⃗) - - # H₀ = H(0) = H₁(0) + H₂(0) + … - ℋ₁₀ = heisenberg(n; J = J₁, J2 = zero(eltype)) - ℋ₂₀ = heisenberg(n; J = zero(eltype), J2 = J₂) - ℋ⃗₀ = (ℋ₁₀, ℋ₂₀) - - s = siteinds("S=1/2", n) - - H⃗₀ = map(ℋ₀ -> device(MPO(eltype, ℋ₀, s)), ℋ⃗₀) - - # Initial state, ψ₀ = ψ(0) - # Initialize as complex since that is what OrdinaryDiffEq.jl/DifferentialEquations.jl - # expects. - ψ₀ = device( - complex.( - random_mps(eltype, s, j -> isodd(j) ? "↑" : "↓"; linkdims = start_linkdim) - ) - ) - - @show norm(ψ₀) - - println() - println("#"^100) - println("Running TDVP with ODE updater") - println("#"^100) - println() - - ψₜ_ode = tdvp( - -im * TimeDependentSum(f⃗, H⃗₀), - time_stop, - ψ₀; - updater = ode_updater, - updater_kwargs = (; reltol = tol, abstol = tol), - time_step, - maxdim, - cutoff, - nsite, - outputlevel - ) - - println() - println("Finished running TDVP with ODE updater") - println() - - println() - println("#"^100) - println("Running TDVP with Krylov updater") - println("#"^100) - println() - - ψₜ_krylov = tdvp( - -im * TimeDependentSum(f⃗, H⃗₀), - time_stop, - ψ₀; - updater = krylov_updater, - updater_kwargs = (; tol, eager = true), - time_step, - cutoff, - nsite, - outputlevel - ) - - println() - println("Finished running TDVP with Krylov updater") - println() - - println() - println("#"^100) - println("Running full state evolution with ODE updater") - println("#"^100) - println() - - @disable_warn_order begin - ψₜ_full, _ = ode_updater( - -im * TimeDependentSum(f⃗, contract.(H⃗₀)), - contract(ψ₀); - internal_kwargs = (; time_step = time_stop, outputlevel), - reltol = tol, - abstol = tol - ) - end - - println() - println("Finished full state evolution with ODE updater") - println() - - @show norm(ψₜ_ode) - @show norm(ψₜ_krylov) - @show norm(ψₜ_full) - - @show 1 - abs(inner(contract(ψₜ_ode), ψₜ_full)) - @show 1 - abs(inner(contract(ψₜ_krylov), ψₜ_full)) - return nothing -end - -main() diff --git a/examples/solvers/03_updaters.jl b/examples/solvers/03_updaters.jl deleted file mode 100644 index 50b9572e..00000000 --- a/examples/solvers/03_updaters.jl +++ /dev/null @@ -1,23 +0,0 @@ -using Compat: @compat -using ITensorMPS: TimeDependentSum, to_vec -using ITensors: ITensor, array, inds, itensor -using KrylovKit: exponentiate -using OrdinaryDiffEqTsit5: ODEProblem, Tsit5, solve - -function ode_updater(operator, init; internal_kwargs, alg = Tsit5(), kwargs...) - @compat (; current_time, time_step) = (; current_time = zero(Bool), internal_kwargs...) - time_span = typeof(time_step).((current_time, current_time + time_step)) - init_vec, to_itensor = to_vec(init) - f(init::ITensor, p, t) = operator(t)(init) - f(init_vec::AbstractArray, p, t) = to_vec(f(to_itensor(init_vec), p, t))[1] - prob = ODEProblem(f, init_vec, time_span) - sol = solve(prob, alg; kwargs...) - state_vec = sol.u[end] - return to_itensor(state_vec), (;) -end - -function krylov_updater(operator, init; internal_kwargs, kwargs...) - @compat (; current_time, time_step) = (; current_time = zero(Bool), internal_kwargs...) - state, info = exponentiate(operator(current_time), time_step, init; kwargs...) - return state, (; info) -end diff --git a/examples/solvers/Project.toml b/examples/solvers/Project.toml index ae4ddddc..1f15d659 100644 --- a/examples/solvers/Project.toml +++ b/examples/solvers/Project.toml @@ -1,8 +1,5 @@ [deps] -Compat = "34da2185-b29b-5c13-b0c7-acf172513d20" ITensorMPS = "0d1a4710-d33b-49a5-8f18-73bdf49b47e2" ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5" -KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77" Observers = "338f10d5-c7f1-4033-a7d1-f9dec39bcaa0" -OrdinaryDiffEqTsit5 = "b1df2697-797e-41e3-8120-5422d3b24e4a" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" diff --git a/src/ITensorMPS.jl b/src/ITensorMPS.jl index 1c42b830..0e091aa1 100644 --- a/src/ITensorMPS.jl +++ b/src/ITensorMPS.jl @@ -24,12 +24,9 @@ include("deprecated.jl") include("defaults.jl") include("update_observer.jl") include("lattices/lattices.jl") -include("solvers/ITensorsExtensions.jl") -using .ITensorsExtensions: to_vec include("solvers/applyexp.jl") include("solvers/defaults.jl") include("solvers/update_observer.jl") -include("solvers/timedependentsum.jl") include("solvers/tdvporder.jl") include("solvers/sweep_update.jl") include("solvers/alternating_update.jl") diff --git a/src/exports.jl b/src/exports.jl index 6694f07c..a24554bf 100644 --- a/src/exports.jl +++ b/src/exports.jl @@ -45,12 +45,10 @@ export triangular_lattice, # solvers - TimeDependentSum, dmrg_x, expand, linsolve, tdvp, - to_vec, # dmrg.jl dmrg, diff --git a/src/solvers/ITensorsExtensions.jl b/src/solvers/ITensorsExtensions.jl deleted file mode 100644 index fc5ee9dd..00000000 --- a/src/solvers/ITensorsExtensions.jl +++ /dev/null @@ -1,9 +0,0 @@ -module ITensorsExtensions -using ITensors: ITensor, array, inds, itensor -function to_vec(x::ITensor) - function to_itensor(x_vec) - return itensor(x_vec, inds(x)) - end - return vec(array(x)), to_itensor -end -end diff --git a/src/solvers/timedependentsum.jl b/src/solvers/timedependentsum.jl deleted file mode 100644 index 9365b57d..00000000 --- a/src/solvers/timedependentsum.jl +++ /dev/null @@ -1,68 +0,0 @@ -using ITensors: ITensor, inds, permute - -# Represents a time-dependent sum of terms: -# -# expr(t) = coefficients(expr)[1](t) * terms(expr)[1] + coefficients(expr)[2](t) * terms(expr)[2] + … -# -struct TimeDependentSum{Coefficients, Terms} - coefficients::Coefficients - terms::Terms -end - -coefficients(expr::TimeDependentSum) = expr.coefficients -terms(expr::TimeDependentSum) = expr.terms -function Base.copy(expr::TimeDependentSum) - return TimeDependentSum(coefficients(expr), copy.(terms(expr))) -end - -function Base.:*(c::Number, expr::TimeDependentSum) - scaled_coefficients = map(coefficient -> (t -> c * coefficient(t)), coefficients(expr)) - return TimeDependentSum(scaled_coefficients, terms(expr)) -end -Base.:*(expr::TimeDependentSum, c::Number) = c * expr - -# Evaluating a `TimeDependentSum` at a certain time -# returns a `ScaledSum` at that time. -function (expr::TimeDependentSum)(t::Number) - coefficients_t = map(coefficient -> coefficient(t), coefficients(expr)) - return ScaledSum(coefficients_t, terms(expr)) -end - -# alternating_update inteface -function reduced_operator(operator::TimeDependentSum) - return TimeDependentSum(coefficients(operator), reduced_operator.(terms(operator))) -end -function ITensorMPS.set_nsite!(operator::TimeDependentSum, nsite) - foreach(t -> set_nsite!(t, nsite), terms(operator)) - return operator -end -function ITensorMPS.position!(operator::TimeDependentSum, state, position) - foreach(t -> position!(t, state, position), terms(operator)) - return operator -end - -# Represents the sum of scaled terms: -# -# H = coefficient[1] * H[1] + coefficient * H[2] + … -# -struct ScaledSum{Coefficients, Terms} - coefficients::Coefficients - terms::Terms -end - -coefficients(expr::ScaledSum) = expr.coefficients -terms(expr::ScaledSum) = expr.terms - -# Apply the scaled sum of terms: -# -# expr(x) = coefficients(expr)[1] * terms(expr)[1](x) + coefficients(expr)[2] * terms(expr)[2](x) + … -# -# onto x. -function scaledsum_apply(expr, x) - return mapreduce(+, zip(coefficients(expr), terms(expr))) do coefficient_and_term - coefficient, term = coefficient_and_term - return coefficient * term(x) - end -end -(expr::ScaledSum)(x) = scaledsum_apply(expr, x) -(expr::ScaledSum)(x::ITensor) = permute(scaledsum_apply(expr, x), inds(x)) diff --git a/test/Project.toml b/test/Project.toml index c38a64be..c291fc0f 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -12,7 +12,6 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" NDTensors = "23ae76d9-e61a-49c4-8f12-3f1a16adf9cf" Observers = "338f10d5-c7f1-4033-a7d1-f9dec39bcaa0" OptimKit = "77e91f04-9b3b-57a6-a776-40b61faaebe0" -OrdinaryDiffEqTsit5 = "b1df2697-797e-41e3-8120-5422d3b24e4a" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3" @@ -29,7 +28,7 @@ ChainRulesCore = "1.25.1" Combinatorics = "1.0.2" Compat = "4.16" HDF5 = "0.17.2" -ITensorMPS = "0.3.8" +ITensorMPS = "0.4" ITensors = "0.8.1, 0.9" JLD2 = "0.5.11, 0.6" KrylovKit = "0.9.5, 0.10" @@ -37,7 +36,6 @@ LinearAlgebra = "1.10" NDTensors = "0.4.4" Observers = "0.2.5" OptimKit = "0.4" -OrdinaryDiffEqTsit5 = "1.1, 2" Random = "1.10" SafeTestsets = "0.1" StableRNGs = "1.0.2" diff --git a/test/base/test_solvers/Project.toml b/test/base/test_solvers/Project.toml index 99a05ad8..eb3f6734 100644 --- a/test/base/test_solvers/Project.toml +++ b/test/base/test_solvers/Project.toml @@ -5,7 +5,6 @@ ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5" KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Observers = "338f10d5-c7f1-4033-a7d1-f9dec39bcaa0" -OrdinaryDiffEqTsit5 = "b1df2697-797e-41e3-8120-5422d3b24e4a" Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3" diff --git a/test/base/test_solvers/test_examples.jl b/test/base/test_solvers/test_examples.jl index a850af20..99e3098a 100644 --- a/test/base/test_solvers/test_examples.jl +++ b/test/base/test_solvers/test_examples.jl @@ -3,10 +3,7 @@ using ITensorMPS: ITensorMPS using Suppressor: @suppress using Test: @testset @testset "Run examples" begin - examples_files = [ - "01_tdvp.jl", "02_dmrg-x.jl", "03_tdvp_time_dependent.jl", - "04_tdvp_observers.jl", - ] + examples_files = ["01_tdvp.jl", "02_dmrg-x.jl", "03_tdvp_observers.jl"] examples_path = joinpath(pkgdir(ITensorMPS), "examples", "solvers") @testset "Running example file $f" for f in examples_files println("Running example file $f") diff --git a/test/base/test_solvers/test_tdvp_time_dependent.jl b/test/base/test_solvers/test_tdvp_time_dependent.jl deleted file mode 100644 index eb57b0dd..00000000 --- a/test/base/test_solvers/test_tdvp_time_dependent.jl +++ /dev/null @@ -1,109 +0,0 @@ -@eval module $(gensym()) -using ITensorMPS: ITensorMPS, MPO, MPS, ProjMPO, ProjMPOSum, TimeDependentSum, position!, - random_mps, siteinds, tdvp -using ITensors: ITensors, Index, QN, contract, scalartype -using LinearAlgebra: norm -using StableRNGs: StableRNG -using Test: @test, @test_skip, @testset -include(joinpath(pkgdir(ITensorMPS), "examples", "solvers", "03_models.jl")) -include(joinpath(pkgdir(ITensorMPS), "examples", "solvers", "03_updaters.jl")) -@testset "TDVP with ODE local updater" begin - @testset "TimeDependentSum (eltype=$elt)" for elt in ( - Float32, Float64, Complex{Float32}, Complex{Float64}, - ), - conserve_qns in [false, true] - - n = 4 - s = siteinds("S=1/2", 4; conserve_qns) - H = MPO(elt, s, "I") - H⃗ = (H, H) - region = 2:3 - rng = StableRNG(1234) - ψ = random_mps(rng, elt, s, j -> isodd(j) ? "↑" : "↓"; linkdims = 2) - H⃗ᵣ = ProjMPO.(H⃗) - map(Hᵣ -> position!(Hᵣ, ψ, first(region)), H⃗ᵣ) - ∑Hᵣ = ProjMPOSum(collect(H⃗)) - position!(∑Hᵣ, ψ, first(region)) - f⃗ₜ = (t -> sin(elt(0.1) * t), t -> cos(elt(0.2) * t)) - α = elt(0.5) - ∑Hₜ = α * TimeDependentSum(f⃗ₜ, ITensors.terms(∑Hᵣ)) - t₀ = elt(0.5) - ∑Hₜ₀ = ∑Hₜ(t₀) - ψᵣ = reduce(*, map(v -> ψ[v], region)) - Hψ = ∑Hₜ₀(ψᵣ) - @test eltype(Hψ) == elt - @test Hψ ≈ sum(i -> α * f⃗ₜ[i](t₀) * H⃗ᵣ[i](ψᵣ), eachindex(H⃗)) - end - @testset "Time dependent Hamiltonian (eltype=$elt, conserve_qns=$conserve_qns)" for elt in - ( - Float32, Float64, Complex{Float32}, Complex{Float64}, - ), - conserve_qns in [false, true] - - n = 4 - J₁ = elt(1) - J₂ = elt(0.1) - ω₁ = real(elt)(0.1) - ω₂ = real(elt)(0.2) - ω⃗ = (ω₁, ω₂) - f⃗ = map(ω -> (t -> cos(ω * t)), ω⃗) - time_step = real(elt)(0.1) - time_stop = real(elt)(1) - nsite = 2 - maxdim = 100 - cutoff = √(eps(real(elt))) - tol = √eps(real(elt)) - s = siteinds("S=1/2", n) - ℋ₁₀ = heisenberg(n; J = J₁, J2 = zero(elt)) - ℋ₂₀ = heisenberg(n; J = zero(elt), J2 = J₂) - ℋ⃗₀ = (ℋ₁₀, ℋ₂₀) - H⃗₀ = map(ℋ₀ -> MPO(elt, ℋ₀, s), ℋ⃗₀) - ψ₀ = complex.(MPS(elt, s, j -> isodd(j) ? "↑" : "↓")) - ψₜ_ode = tdvp( - -im * TimeDependentSum(f⃗, H⃗₀), - time_stop, - ψ₀; - updater = ode_updater, - updater_kwargs = (; reltol = tol, abstol = tol), - time_step, - maxdim, - cutoff, - nsite - ) - ψₜ_krylov = tdvp( - -im * TimeDependentSum(f⃗, H⃗₀), - time_stop, - ψ₀; - updater = krylov_updater, - updater_kwargs = (; tol, eager = true), - time_step, - maxdim, - cutoff, - nsite - ) - ψₜ_full, _ = ode_updater( - -im * TimeDependentSum(f⃗, contract.(H⃗₀)), - contract(ψ₀); - internal_kwargs = (; time_step = time_stop), - reltol = tol, - abstol = tol - ) - - @test scalartype(ψ₀) == complex(elt) - @test scalartype(ψₜ_ode) == complex(elt) - @test scalartype(ψₜ_krylov) == complex(elt) - @test scalartype(ψₜ_full) == complex(elt) - @test norm(ψ₀) ≈ 1 - @test norm(ψₜ_ode) ≈ 1 - @test norm(ψₜ_krylov) ≈ 1 rtol = √(eps(real(elt))) - @test norm(ψₜ_full) ≈ 1 - - ode_err = norm(contract(ψₜ_ode) - ψₜ_full) - krylov_err = norm(contract(ψₜ_krylov) - ψₜ_full) - - @test krylov_err > ode_err - @test ode_err < √(eps(real(elt))) * 10^4 - @test krylov_err < √(eps(real(elt))) * 10^5 - end -end -end diff --git a/test/base/utils/TestITensorMPSExportedNames.jl b/test/base/utils/TestITensorMPSExportedNames.jl index 7acea6ec..8709c93b 100644 --- a/test/base/utils/TestITensorMPSExportedNames.jl +++ b/test/base/utils/TestITensorMPSExportedNames.jl @@ -33,7 +33,6 @@ const ITENSORMPS_EXPORTED_NAMES = [ :Sum, :TagType, :Sweeps, - :TimeDependentSum, :Trotter, :ValName, :add, @@ -153,7 +152,6 @@ const ITENSORMPS_EXPORTED_NAMES = [ :sweepnext, :tdvp, :tensors, - :to_vec, :toMPO, :totalqn, :tr, From 2f91a996de5badb3db0aca93bfbfcfed62265d3c Mon Sep 17 00:00:00 2001 From: Matthew Fishman Date: Sun, 26 Apr 2026 14:31:18 -0400 Subject: [PATCH 2/2] Add v0.4 release notes Co-Authored-By: Claude Opus 4.7 (1M context) --- README.md | 6 ++++++ docs/src/index.md | 6 ++++++ examples/README.jl | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/README.md b/README.md index e9cd96ac..e20b1da7 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,12 @@ ITensorMPS.jl is supported by the Flatiron Institute, a division of the Simons F ## News +### ITensorMPS.jl v0.4 release notes + +#### Breaking changes + +`TimeDependentSum` and `to_vec` have been removed. Most users should not be affected, as these were experimental/internal helpers used together with external ODE solvers. + ### ITensorMPS.jl v0.3 release notes All MPS/MPO code from [ITensors.jl](https://github.com/ITensor/ITensors.jl) and [ITensorTDVP.jl](https://github.com/ITensor/ITensorTDVP.jl) has been moved into this repository and this repository now relies on ITensors.jl v0.7 and above. All of the MPS/MPO functionality that was previously in ITensors.jl and ITensorTDVP.jl will be developed here from now on. For users of this repository, this change should not break any code, though please let us know if you have any issues. diff --git a/docs/src/index.md b/docs/src/index.md index dfacb477..2c373b32 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -15,6 +15,12 @@ Finite MPS and MPO methods based on the Julia version of [ITensor](https://www.i ## News +### ITensorMPS.jl v0.4 release notes + +#### Breaking changes + +`TimeDependentSum` and `to_vec` have been removed. Most users should not be affected, as these were experimental/internal helpers used together with external ODE solvers. + ### ITensorMPS.jl v0.3 release notes All MPS/MPO code from [ITensors.jl](https://github.com/ITensor/ITensors.jl) and [ITensorTDVP.jl](https://github.com/ITensor/ITensorTDVP.jl) has been moved into this repository and this repository now relies on ITensors.jl v0.7 and above. All of the MPS/MPO functionality that was previously in ITensors.jl and ITensorTDVP.jl will be developed here from now on. For users of this repository, this change should not break any code, though please let us know if you have any issues. diff --git a/examples/README.jl b/examples/README.jl index 388120b5..48a93299 100644 --- a/examples/README.jl +++ b/examples/README.jl @@ -17,6 +17,12 @@ # ## News # +# ### ITensorMPS.jl v0.4 release notes +# +# #### Breaking changes +# +# `TimeDependentSum` and `to_vec` have been removed. Most users should not be affected, as these were experimental/internal helpers used together with external ODE solvers. +# # ### ITensorMPS.jl v0.3 release notes # # All MPS/MPO code from [ITensors.jl](https://github.com/ITensor/ITensors.jl) and [ITensorTDVP.jl](https://github.com/ITensor/ITensorTDVP.jl) has been moved into this repository and this repository now relies on ITensors.jl v0.7 and above. All of the MPS/MPO functionality that was previously in ITensors.jl and ITensorTDVP.jl will be developed here from now on. For users of this repository, this change should not break any code, though please let us know if you have any issues.