From 1e899879d9beb6fe7eafe9dc6230402a230ef9fd Mon Sep 17 00:00:00 2001 From: Yakov Date: Sun, 2 Jul 2023 22:22:21 +0300 Subject: [PATCH 1/4] Lower dependence to `OrdinaryDiffEq` --- Project.toml | 2 +- examples/DeltaModel/classical.jl | 2 +- examples/SineModel/classical.jl | 1 + src/Classical.jl | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Project.toml b/Project.toml index e4b26ea..167a958 100644 --- a/Project.toml +++ b/Project.toml @@ -6,12 +6,12 @@ version = "1.0.0-DEV" [deps] Dierckx = "39dd38d3-220a-591b-8e3c-4c3a8c710a94" DiffEqPhysics = "055956cb-9e8b-5191-98cc-73ae4a59e68a" -DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa" FLoops = "cc61a311-1640-44b5-9fba-1b764f453329" IntervalArithmetic = "d1acc4aa-44c8-5952-acd4-ba5d80a2a253" IntervalRootFinding = "d2bf35a9-74e0-55ec-b149-d360ff49b807" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Optim = "429524aa-4258-5aef-a3af-852621145aeb" +OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca" QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc" Roots = "f2b01f46-fcfa-551c-844a-d8ac1e96c665" diff --git a/examples/DeltaModel/classical.jl b/examples/DeltaModel/classical.jl index 0251c18..4a8aa7b 100644 --- a/examples/DeltaModel/classical.jl +++ b/examples/DeltaModel/classical.jl @@ -67,7 +67,7 @@ xβ‚€ = -1.04l/2 pβ‚€ = 0.0 # calculate `n_T` periods of unperturbed motion to check accuracy -import DifferentialEquations as DiffEq +import OrdinaryDiffEq as DiffEq using DiffEqPhysics: HamiltonianProblem T = l/sqrt(𝐻₀(pβ‚€, xβ‚€, params)) # analytical period diff --git a/examples/SineModel/classical.jl b/examples/SineModel/classical.jl index 88a5a07..a1acedd 100644 --- a/examples/SineModel/classical.jl +++ b/examples/SineModel/classical.jl @@ -32,6 +32,7 @@ s = 2 params = [gβ‚—, l, Vβ‚—, Ξ»β‚›, Ξ»β‚—, Ο‰] H = ClassicalHamiltonian(𝐻₀, 𝐻, params, s, min_pos=(1.5, 2), max_pos=(2, 2.5)) +import Dierckx function plot_actions(H::ClassicalHamiltonian) figs = [plot() for _ in 1:4]; x = range(0, 2Ο€, length=200); diff --git a/src/Classical.jl b/src/Classical.jl index ec8a27c..a6712c2 100644 --- a/src/Classical.jl +++ b/src/Classical.jl @@ -4,8 +4,8 @@ import Roots import Optim import Dierckx using QuadGK: quadgk -import DifferentialEquations as DiffEq -using DiffEqPhysics: HamiltonianProblem, DynamicalODEProblem +import OrdinaryDiffEq as DiffEq +using DiffEqPhysics: HamiltonianProblem "A type representing a classical Hamiltonian." mutable struct ClassicalHamiltonian From a759c1579a59abfd490506272245d40be62d0d96 Mon Sep 17 00:00:00 2001 From: Yakov Date: Thu, 13 Jul 2023 18:53:34 +0300 Subject: [PATCH 2/4] Refine imports --- examples/SineModel/classical_6D.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/SineModel/classical_6D.jl b/examples/SineModel/classical_6D.jl index 259fffb..7c70d81 100644 --- a/examples/SineModel/classical_6D.jl +++ b/examples/SineModel/classical_6D.jl @@ -23,6 +23,7 @@ params = [Vβ‚€, Ξ», Ο‰] # plot(range(0, 2Ο€, length=200), x -> 𝐻₀(0, x, params)) H = ClassicalHamiltonian(𝐻₀, 𝐻, params, s, min_pos=(3.0, 3.2), max_pos=(1.4, 1.6)) +import Dierckx function plot_actions(H::ClassicalHamiltonian) figs = [plot() for _ in 1:4]; x = range(0, 2Ο€, length=50); @@ -52,7 +53,7 @@ pβ‚€ = 0.0; xβ‚€ = 2.0; # 𝑦″ + 4𝑉₀sin(𝑦) = 0 # with the initial condition 𝑦(0) = 2π‘₯β‚€. The period is then # 𝑇 = 4 / √(4𝑉₀) 𝐾(π‘šΒ²), where π‘š = sin(𝑦(0)/2) = sin(π‘₯β‚€) -import DifferentialEquations as DiffEq +import OrdinaryDiffEq as DiffEq using DiffEqPhysics: HamiltonianProblem import Elliptic m = sin(xβ‚€) From 8f2e6871c27f423763a4e2b2843ab839668649a0 Mon Sep 17 00:00:00 2001 From: Yakov Date: Thu, 13 Jul 2023 19:04:33 +0300 Subject: [PATCH 3/4] Change `size` to `axes` --- examples/SineModel/classical.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/SineModel/classical.jl b/examples/SineModel/classical.jl index a1acedd..83b4988 100644 --- a/examples/SineModel/classical.jl +++ b/examples/SineModel/classical.jl @@ -88,7 +88,7 @@ p = Progress(length(Ο†β‚œ), 1) U = @. -Ξ»β‚›*Aβ‚›*cos(4x) + Ξ»β‚—*Aβ‚—*cos(2x - Ο•) + H.𝐸(Iβ‚›) - Ο‰/s*Iβ‚› plot(x, U, label=false, ylims=(-5610, -5575)) scatter!(h.w.pos[:, i], h.w.E[:, i]; marker_z=h.w.E[:, i], c=:coolwarm, label=false, markerstrokewidth=0, clims=(-5610, -5575)) - for j in 1:size(w, 2) + for j in axes(w, 2) plot!(x, 4abs2.(w[:, j, i]) .+ h.w.E[j, i], label=false) end next!(p) @@ -123,7 +123,7 @@ p = Progress(length(Ο†β‚œ), 1) U = @. -Ξ»β‚›*Aβ‚›*cos(4x) + Ξ»β‚—*Aβ‚—*cos(2x - Ο•) + H.𝐸(Iβ‚›) - Ο‰/s*Iβ‚› plot(x, U, label=false, ylims=(-5610, -5575)) scatter!(h.w.pos[:, i], h.w.E[:, i]; marker_z=h.w.E[:, i], c=:coolwarm, label=false, markerstrokewidth=0, clims=(-5610, -5575)) - for j in 1:size(w, 2) + for j in axes(w, 2) plot!(x, 4abs2.(w[:, j, i]) .+ h.w.E[j, i], label=false) end next!(p) From a420344cdc6ce50b74defe2da69670f2e435f516 Mon Sep 17 00:00:00 2001 From: Yakov Date: Wed, 19 Jul 2023 19:51:32 +0300 Subject: [PATCH 4/4] Update references --- Project.toml | 2 +- README.md | 2 +- examples/DeltaModel/article_plotter.jl | 2 +- examples/DeltaModel/classical.jl | 2 +- examples/DeltaModel/floquet.jl | 2 +- examples/DeltaModel/floquet_tb.jl | 2 +- examples/DeltaModel/spatial.jl | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Project.toml b/Project.toml index 167a958..6465f91 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "TTSC" uuid = "f8e47de0-90c4-48ec-a6c2-713e7f641db1" authors = ["Yakov Braver jakovbraver@gmail.com"] -version = "1.0.0-DEV" +version = "1.0.0" [deps] Dierckx = "39dd38d3-220a-591b-8e3c-4c3a8c710a94" diff --git a/README.md b/README.md index 524925b..2550742 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ For usage examples, see the `examples` folder. For further details, please refer to: * [Phys. Rev. B **106**, 144301 (2022)](https://journals.aps.org/prb/abstract/10.1103/PhysRevB.106.144301) or [arXiv:2206.14804](https://arxiv.org/abs/2206.14804) -* [arXiv:2305.07668](https://arxiv.org/abs/2305.07668) +* [Phys. Rev. B **108**, L020303 (2023)](https://journals.aps.org/prb/abstract/10.1103/PhysRevB.108.L020303) or [arXiv:2305.07668](https://arxiv.org/abs/2305.07668) ## Visualisation of Thouless pumping using the Wannier states diff --git a/examples/DeltaModel/article_plotter.jl b/examples/DeltaModel/article_plotter.jl index 813769e..bf12b4a 100644 --- a/examples/DeltaModel/article_plotter.jl +++ b/examples/DeltaModel/article_plotter.jl @@ -1,4 +1,4 @@ -# A script for producing all the figures for https://arxiv.org/abs/2305.07668 +# A script for producing all the figures for https://doi.org/10.1103/physrevb.108.l020303 (https://arxiv.org/abs/2305.07668) import TTSC.DeltaModel as dm using Plots, Measures, LaTeXStrings using LinearAlgebra diff --git a/examples/DeltaModel/classical.jl b/examples/DeltaModel/classical.jl index 4a8aa7b..d0d0b00 100644 --- a/examples/DeltaModel/classical.jl +++ b/examples/DeltaModel/classical.jl @@ -1,4 +1,4 @@ -# A driving script for the classical analysis of Hamiltonian (2) from https://arxiv.org/abs/2305.07668 +# A driving script for the classical analysis of Hamiltonian (1) from https://doi.org/10.1103/physrevb.108.l020303 (https://arxiv.org/abs/2305.07668) using TTSC.Classical using Plots, LaTeXStrings, ProgressMeter diff --git a/examples/DeltaModel/floquet.jl b/examples/DeltaModel/floquet.jl index 63f2862..d84a9f8 100644 --- a/examples/DeltaModel/floquet.jl +++ b/examples/DeltaModel/floquet.jl @@ -1,4 +1,4 @@ -# A driving script for analysing Floquet Hamiltonian (S1) from https://arxiv.org/abs/2305.07668 +# A driving script for analysing Floquet Hamiltonian (S1) from https://doi.org/10.1103/physrevb.108.l020303 (https://arxiv.org/abs/2305.07668) import TTSC.DeltaModel as dm using Plots, LaTeXStrings, ProgressMeter diff --git a/examples/DeltaModel/floquet_tb.jl b/examples/DeltaModel/floquet_tb.jl index 7d4ab7d..1db61a3 100644 --- a/examples/DeltaModel/floquet_tb.jl +++ b/examples/DeltaModel/floquet_tb.jl @@ -1,4 +1,4 @@ -# A driving script for analysing the tight-binding Hamiltonian (4) from https://arxiv.org/abs/2305.07668 +# A driving script for analysing the tight-binding Hamiltonian (4) from https://doi.org/10.1103/physrevb.108.l020303 (https://arxiv.org/abs/2305.07668) import TTSC.DeltaModel as dm using Plots, LaTeXStrings, ProgressMeter using LinearAlgebra: diagind diff --git a/examples/DeltaModel/spatial.jl b/examples/DeltaModel/spatial.jl index 9572f89..80157a7 100644 --- a/examples/DeltaModel/spatial.jl +++ b/examples/DeltaModel/spatial.jl @@ -1,4 +1,4 @@ -# A driving script for analysing Hamiltonian (2) from https://arxiv.org/abs/2305.07668 +# A driving script for analysing Hamiltonian (2) from https://doi.org/10.1103/physrevb.108.l020303 (https://arxiv.org/abs/2305.07668) import TTSC.DeltaModel as dm using Plots, LaTeXStrings, ProgressMeter