From ee08458d7feb8442699172456173cc4c2532fcbf Mon Sep 17 00:00:00 2001 From: "pierre-francois.duc" Date: Tue, 23 Jul 2024 01:25:28 +0200 Subject: [PATCH] Update basic.jl to julia 1.10 - info replaced by @info https://github.com/JuliaLang/julia/pull/24490 -linspace has been deprecated in favor of range with stop and length keyword arguments (#25896). https://github.com/JuliaLang/julia/pull/25896 --- examples/aimd_full/linear_xcf.jl | 26 ++++++++--------- examples/aimd_full/third_order_xcf.jl | 28 +++++++++---------- examples/aimd_static/third_order_xc.jl | 26 ++++++++--------- examples/basic/basic.jl | 26 ++++++++--------- examples/cohmap_electronic/diamond.jl | 8 +++--- examples/cohmap_vibrational/vibrational_ia.jl | 2 +- examples/electronic/ecoh.jl | 22 +++++++-------- examples/esa/basic_ia.jl | 22 +++++++-------- examples/qd_ema/ema_BX.jl | 24 ++++++++-------- examples/vibrational/vibrational.jl | 22 +++++++-------- 10 files changed, 103 insertions(+), 103 deletions(-) diff --git a/examples/aimd_full/linear_xcf.jl b/examples/aimd_full/linear_xcf.jl index 3717f41..60ae56b 100644 --- a/examples/aimd_full/linear_xcf.jl +++ b/examples/aimd_full/linear_xcf.jl @@ -16,7 +16,7 @@ end function run(args) t0 = now() cfgf = args[1] -info("Loading parameters from $(cfgf)") +@info("Loading parameters from $(cfgf)") cfg = open(YAML.load, cfgf) states_fn = cfg["states_fn"] cf_fn = cfg["cf_fn"] @@ -26,17 +26,17 @@ t2 = convert.(Float64, cfg["t2"]) t3 = convert.(Float64, cfg["t3"]) σ = cfg["sigma"] -info("Loading energies from $states_fn") +@info("Loading energies from $states_fn") states = readdlm(states_fn) energies = states[:,1] tdm = states[:,2] -info("States count: $(size(states)[1])") -info("Loading CF from $cf_fn") +@info("States count: $(size(states)[1])") +@info("Loading CF from $cf_fn") cfs = parse_cf(cf_fn) -info("CF count: $(length(cfs))") +@info("CF count: $(length(cfs))") # build system -info("Building system...") +@info("Building system...") t0_sys = now() s = System("G") #energy!(s, "G", 0) @@ -57,9 +57,9 @@ for (i, j) in keys(cfs) lut = LineshapeLUT(t->(GriddedCF(cfs[i,j], dt)(t)+g_inhomo(t, ev2angphz(σ))), lut_grid) lineshape!(s, ti, tj, lut) end -info(" Took $(now()-t0_sys)") -info("Number of order 1 Hilbert Paths: $(length(collect(hilbert_paths(s, 1))))") -info("Number of order 3 Hilbert Paths: $(length(collect(hilbert_paths(s, 3))))") +@info(" Took $(now()-t0_sys)") +@info("Number of order 1 Hilbert Paths: $(length(collect(hilbert_paths(s, 1))))") +@info("Number of order 3 Hilbert Paths: $(length(collect(hilbert_paths(s, 3))))") grd_lin = TimeGrid(t1) @@ -73,17 +73,17 @@ for p in hilbert_paths(s, 1) #writedlm(out_root*"_lin_$(p.p[2]).txt", [grid(grd_lin)[1] real(rlin) imag(rlin)]) totlin += rlin end -info("Saving to $(out_root)_rlin.txt") +@info("Saving to $(out_root)_rlin.txt") writedlm("$(out_root)_rlin.txt", [grid(grd_lin)[1] real(totlin) imag(totlin)]) totlin[1] *= 0.5 s_lin = fftshift(ifft(totlin)) f_lin = fftshift(fftfreq(size(grd_lin)[1], 1/(grd_lin.times[1][2]-grd_lin.times[1][1]))) -info("Saving linear spectrum to $(out_root)_slin.txt") +@info("Saving linear spectrum to $(out_root)_slin.txt") writedlm("$(out_root)_slin.txt", [f_lin real(s_lin) imag(s_lin)]) -info(" Took $(now()-t0_calc)") -info("Total runtime: $(now()-t0)") +@info(" Took $(now()-t0_calc)") +@info("Total runtime: $(now()-t0)") end # run run(ARGS) \ No newline at end of file diff --git a/examples/aimd_full/third_order_xcf.jl b/examples/aimd_full/third_order_xcf.jl index 99754a4..aaf52c6 100644 --- a/examples/aimd_full/third_order_xcf.jl +++ b/examples/aimd_full/third_order_xcf.jl @@ -15,7 +15,7 @@ end function run(args) t0 = now() cfgf = args[1] -info("Loading parameters from $(cfgf)") +@info("Loading parameters from $(cfgf)") cfg = open(YAML.load, cfgf) root = cfg["rootname"] states_fn = cfg["states_fn"] @@ -26,17 +26,17 @@ t2 = convert.(Float64, cfg["t2"]) t3 = convert.(Float64, cfg["t3"]) σ = cfg["sigma"] -info("Loading energies from $states_fn") +@info("Loading energies from $states_fn") states = readdlm(states_fn) energies = states[:,1] tdm = states[:,2] -info("States count: $(size(states)[1])") -info("Loading CF from $cf_fn") +@info("States count: $(size(states)[1])") +@info("Loading CF from $cf_fn") cfs = parse_cf(cf_fn) -info("CF count: $(length(cfs))") +@info("CF count: $(length(cfs))") # build system -info("Building system...") +@info("Building system...") t0_sys = now() s = System("G") frame = ev2angphz(cfg["e_frame"]) @@ -53,24 +53,24 @@ for (i, j) in keys(cfs) lut = LineshapeLUT(t->(GriddedCF(cfs[i,j], 1.0)(t)+g_inhomo(t, ev2angphz(σ))), lut_grid) lineshape!(s, ti, tj, lut) end -info(" Took $(now()-t0_sys)") -info("Number of order 1 Hilbert Paths: $(length(collect(hilbert_paths(s, 1))))") -info("Number of order 3 Hilbert Paths: $(length(collect(hilbert_paths(s, 3))))") +@info(" Took $(now()-t0_sys)") +@info("Number of order 1 Hilbert Paths: $(length(collect(hilbert_paths(s, 1))))") +@info("Number of order 3 Hilbert Paths: $(length(collect(hilbert_paths(s, 3))))") -info("Preparing calculation of third order response") +@info("Preparing calculation of third order response") grd_trd = TimeGrid(t1, t2, t3) -info("Grid size: $(size(grd_trd))") +@info("Grid size: $(size(grd_trd))") rr_fn = root*"_rr.bin" rn_fn = root*"_rn.bin" -info("Saving rephasing to: $rr_fn") -info("Saving nonrephasing to: $rr_fn") +@info("Saving rephasing to: $rr_fn") +@info("Saving nonrephasing to: $rr_fn") rr_out = open(rr_fn, "w+") rn_out = open(rn_fn, "w+") rr = Mmap.mmap(rr_out, Array{Complex128, 3}, size(grd_trd)) rn = Mmap.mmap(rn_out, Array{Complex128, 3}, size(grd_trd)) pm = Progress(4*length(collect(hilbert_paths(s, 3)))) -info("Computing third order response") +@info("Computing third order response") t0_third = now() rr .+= R2(grd_trd, s, pm) rr .+= R3(grd_trd, s, pm) diff --git a/examples/aimd_static/third_order_xc.jl b/examples/aimd_static/third_order_xc.jl index 8deb680..10c99e7 100644 --- a/examples/aimd_static/third_order_xc.jl +++ b/examples/aimd_static/third_order_xc.jl @@ -10,7 +10,7 @@ end function run(args) t0 = now() cfgf = args[1] -info("Loading parameters from $(cfgf)") +@info("Loading parameters from $(cfgf)") cfg = open(YAML.load, cfgf) states_fn = cfg["states_fn"] cf_fn = cfg["xcorr_fn"] @@ -20,17 +20,17 @@ t2 = convert.(Float64, cfg["t2"]) t3 = convert.(Float64, cfg["t3"]) sigma = cfg["sigma"] -info("Loading energies from $states_fn") +@info("Loading energies from $states_fn") states = readdlm(states_fn) energies = states[:,1] tdm = states[:,2] -info("States count: $(size(states)[1])") -info("Loading correlation matrix from $cf_fn") +@info("States count: $(size(states)[1])") +@info("Loading correlation matrix from $cf_fn") corrm = parse_corr(cf_fn) -info("Correlation count: $(length(corrm))") +@info("Correlation count: $(length(corrm))") # build system -info("Building system...") +@info("Building system...") t0_sys = now() s = System("G") frame = ev2angphz(cfg["e_frame"]) @@ -54,13 +54,13 @@ for i=1:size(corrm)[1], j=1:size(corrm)[2] #end lineshape!(s, ti, tj, lut) end -info(" Took $(now()-t0_sys)") -info("Number of order 1 Hilbert Paths: $(length(collect(hilbert_paths(s, 1))))") -info("Number of order 3 Hilbert Paths: $(length(collect(hilbert_paths(s, 3))))") +@info(" Took $(now()-t0_sys)") +@info("Number of order 1 Hilbert Paths: $(length(collect(hilbert_paths(s, 1))))") +@info("Number of order 3 Hilbert Paths: $(length(collect(hilbert_paths(s, 3))))") grd_lin = TimeGrid(t1) -info("Computing linear responses separately.") +@info("Computing linear responses separately.") t0_calc = now() out_root = "$(splitext(basename(states_fn))[1])_$(splitext(basename(cf_fn))[1])" @@ -70,12 +70,12 @@ for p in hilbert_paths(s, 1) rlin = linear(grd_lin, s, p) totlin += rlin out_lin = out_root*"_lin_"*join(p.p[2:end-1], "-")*".txt" - info("Saving linear to: $out_lin") + @info("Saving linear to: $out_lin") writedlm(out_lin, [grid(grd_lin)[1] real(rlin) imag(rlin)]) end writedlm(out_root*"_lin_tot.txt", [grid(grd_lin)[1] real(totlin) imag(totlin)]) -info(" Took $(now()-t0_calc)") -info("Preparing calculation of third order response") +@info(" Took $(now()-t0_calc)") +@info("Preparing calculation of third order response") grd_trd = TimeGrid(t1, t2, t3) info("Grid size: $(size(grd_trd))") diff --git a/examples/basic/basic.jl b/examples/basic/basic.jl index b166a1c..8411f8a 100644 --- a/examples/basic/basic.jl +++ b/examples/basic/basic.jl @@ -9,7 +9,7 @@ import YAML # import requires adding the module name, ie: `YAML.load` function run(args) # Use a main 'run' function. This is not mandatory, but is required for performance. cfg_f = args[1] # index by 1, 1:2 translates to [1, 2], the first two elements -info("Loading parameters from $cfg_f") +@info("Loading parameters from $cfg_f") cfg = open(YAML.load, cfg_f) # load parameters # load parameters @@ -27,39 +27,39 @@ t2_max = cfg["t2_max"] t3_max = cfg["t3_max"] # setup system -info("Setting up system") +@info("Setting up system") s = System("g") energy!(s, "a", ω_a - ω_frame) # use a rotating frame dipole!(s, "g", "a", 1.0) lineshape!(s, "a", "a", t->g_homo(t, γ)+g_inhomo(t, σ)) # use an anonymous function for the lineshape tg = TimeGrid( - linspace(0, t1_max, t1_n), - linspace(0, t2_max, t2_n), - linspace(0, t3_max, t3_n), + range(0, stop=t1_max, length=t1_n), # TODO previously linspace + range(0, stop=t2_max, length=t2_n), + range(0, stop=t3_max, length=t3_n), ) -info("Computing linear response") +@info("Computing linear response") # compute linear r_lin = linear(tg, s) -info("Saving to $(root)_rlin.txt") +@info("Saving to $(root)_rlin.txt") writedlm("$(root)_rlin.txt", [tg.times[1] real(r_lin) imag(r_lin)]) r_lin[1] *= 0.5 # first interval is a half-interval s_lin = fftshift(ifft(r_lin)) f_lin = fftshift(fftfreq(size(tg)[1], 1/(tg.times[1][2]-tg.times[1][1]))) -info("Saving linear spectrum to $(root)_slin.txt") +@info("Saving linear spectrum to $(root)_slin.txt") writedlm("$(root)_slin.txt", [f_lin real(s_lin) imag(s_lin)]) # compute rephasing and non-rephasing separately: the spectra will overlap if # a fully rotating frame is used (ω_a == ω_frame) -info("Computing third order response") +@info("Computing third order response") rr = R2(tg, s) + R3(tg, s) rn = R1(tg, s) + R4(tg, s) # save multidimensional data in binary format. # Julia uses Fortran-contiguous arrays. -info("Saving to $(root)_rr.bin, $(root)_rn.bin") +@info("Saving to $(root)_rr.bin, $(root)_rn.bin") write("$(root)_rr.bin", rr) write("$(root)_rn.bin", rn) # first interval is a half-interval @@ -79,11 +79,11 @@ else sa += flipdim(sr, 1) end # if-else blocks terminated by 'end'. This is true of all code blocks. -info("Saving rephasing spectrum to $(root)_sr.bin") +@info("Saving rephasing spectrum to $(root)_sr.bin") write("$(root)_sr.bin", sr) -info("Saving non-rephasing spectrum to $(root)_sn.bin") +@info("Saving non-rephasing spectrum to $(root)_sn.bin") write("$(root)_sn.bin", sn) -info("Saving absorptive spectrum to $(root)_sa.bin") +@info("Saving absorptive spectrum to $(root)_sa.bin") write("$(root)_sa.bin", sa) end # terminating the `function run` code block diff --git a/examples/cohmap_electronic/diamond.jl b/examples/cohmap_electronic/diamond.jl index 1074177..c9202c4 100644 --- a/examples/cohmap_electronic/diamond.jl +++ b/examples/cohmap_electronic/diamond.jl @@ -12,7 +12,7 @@ import YAML function run(args) cfg_f = args[1] -info("Loading parameters from $cfg_f") +@info("Loading parameters from $cfg_f") cfg = open(YAML.load, cfg_f) # load parameters root = cfg["rootname"] @@ -37,7 +37,7 @@ t1_max = cfg["t1_max"] t2_max = cfg["t2_max"] t3_max = cfg["t3_max"] -info("Setting up system") +@info("Setting up system") s = System("g") energy!(s, "a", ωa) energy!(s, "b", ωb) @@ -66,9 +66,9 @@ tg = TimeGrid( linspace(0, t3_max, t3_n), ) -info("Computing linear response") +@info("Computing linear response") r_lin = linear(tg, s) -info("Saving to $(root)_rlin.txt") +@info("Saving to $(root)_rlin.txt") writedlm("$(root)_rlin.txt", [tg.times[1] real(r_lin) imag(r_lin)]) r_lin[1] *= 0.5 diff --git a/examples/cohmap_vibrational/vibrational_ia.jl b/examples/cohmap_vibrational/vibrational_ia.jl index e239c4b..2855082 100644 --- a/examples/cohmap_vibrational/vibrational_ia.jl +++ b/examples/cohmap_vibrational/vibrational_ia.jl @@ -7,7 +7,7 @@ import YAML function run(args) cfg_f = args[1] -info("Loading parameters from $cfg_f") +@info("Loading parameters from $cfg_f") cfg = open(YAML.load, cfg_f) # load parameters root = cfg["rootname"] diff --git a/examples/electronic/ecoh.jl b/examples/electronic/ecoh.jl index ce7bb22..da47989 100644 --- a/examples/electronic/ecoh.jl +++ b/examples/electronic/ecoh.jl @@ -6,7 +6,7 @@ import YAML function run(args) cfg_f = args[1] -info("Loading parameters from $cfg_f") +@info("Loading parameters from $cfg_f") cfg = open(YAML.load, cfg_f) # load parameters root = cfg["rootname"] @@ -28,7 +28,7 @@ t1_max = cfg["t1_max"] t2_max = cfg["t2_max"] t3_max = cfg["t3_max"] -info("Setting up system") +@info("Setting up system") s = System("g") for tag1 in ["A", "B"], tag2 in ["A", "B"] energy!(s, tag1, ev2angphz(cfg["e_$(tag1)"]) - ω_frame) @@ -45,24 +45,24 @@ tg = TimeGrid( linspace(0, t3_max, t3_n), ) -info("Computing linear response") +@info("Computing linear response") r_lin = linear(tg, s) -info("Saving to $(root)_rlin.txt") +@info("Saving to $(root)_rlin.txt") writedlm("$(root)_rlin.txt", [tg.times[1] real(r_lin) imag(r_lin)]) r_lin[1] *= 0.5 s_lin = fftshift(ifft(r_lin)) f_lin = fftshift(fftfreq(size(tg)[1], 1/(tg.times[1][2]-tg.times[1][1]))) -info("Saving linear spectrum to $(root)_slin.txt") +@info("Saving linear spectrum to $(root)_slin.txt") writedlm("$(root)_slin.txt", [f_lin real(s_lin) imag(s_lin)]) -info("Computing third order response") +@info("Computing third order response") tic() rr = R2(tg, s) + R3(tg, s) rn = R1(tg, s) + R4(tg, s) dt = toq() -info("Calulation took $(dt) s") -info("Saving to $(root)_rr.bin, $(root)_rn.bin") +@info("Calulation took $(dt) s") +@info("Saving to $(root)_rr.bin, $(root)_rn.bin") write("$(root)_rr.bin", rr) write("$(root)_rn.bin", rn) rr[1,:,:] *= 0.5 @@ -79,11 +79,11 @@ else sa += flipdim(sr, 1) end -info("Saving rephasing spectrum to $(root)_sr.bin") +@info("Saving rephasing spectrum to $(root)_sr.bin") write("$(root)_sr.bin", sr) -info("Saving non-rephasing spectrum to $(root)_sn.bin") +@info("Saving non-rephasing spectrum to $(root)_sn.bin") write("$(root)_sn.bin", sn) -info("Saving absorptive spectrum to $(root)_sa.bin") +@info("Saving absorptive spectrum to $(root)_sa.bin") write("$(root)_sa.bin", sa) end # function main diff --git a/examples/esa/basic_ia.jl b/examples/esa/basic_ia.jl index 8d12105..b61819a 100644 --- a/examples/esa/basic_ia.jl +++ b/examples/esa/basic_ia.jl @@ -6,7 +6,7 @@ import YAML function run(args) cfg_f = args[1] -info("Loading parameters from $cfg_f") +@info("Loading parameters from $cfg_f") cfg = open(YAML.load, cfg_f) # load parameters root = cfg["rootname"] @@ -30,7 +30,7 @@ t3_max = cfg["t3_max"] e_e = ev2angphz(cfg["e_e"]) e_f = ev2angphz(cfg["e_f"]) -info("Setting up system") +@info("Setting up system") s = System("g") # rotating frame is a bit artisanal. It shows here. energy!(s, "e", e_e - ω_frame) @@ -48,18 +48,18 @@ tg = TimeGrid( linspace(0, t3_max, t3_n), ) -info("Computing linear response") +@info("Computing linear response") r_lin = linear(tg, s) -info("Saving to $(root)_rlin.txt") +@info("Saving to $(root)_rlin.txt") writedlm("$(root)_rlin.txt", [tg.times[1] real(r_lin) imag(r_lin)]) r_lin[1] *= 0.5 s_lin = fftshift(ifft(r_lin)) f_lin = fftshift(fftfreq(size(tg)[1], 1/(tg.times[1][2]-tg.times[1][1]))) -info("Saving linear spectrum to $(root)_slin.txt") +@info("Saving linear spectrum to $(root)_slin.txt") writedlm("$(root)_slin.txt", [f_lin real(s_lin) imag(s_lin)]) -info("Computing third order response") +@info("Computing third order response") tic() hpaths = collect(hilbert_paths(s, 3)) rr = zeros(Complex128, size(tg)) @@ -77,8 +77,8 @@ for p in filter(hp->hp.p[3] == "f", hpaths) end dt = toq() -info("Calulation took $(dt) s") -info("Saving to $(root)_rr.bin, $(root)_rn.bin") +@info("Calulation took $(dt) s") +@info("Saving to $(root)_rr.bin, $(root)_rn.bin") write("$(root)_rr.bin", rr) write("$(root)_rn.bin", rn) rr[1,:,:] *= 0.5 @@ -95,11 +95,11 @@ else sa += flipdim(sr, 1) end -info("Saving rephasing spectrum to $(root)_sr.bin") +@info("Saving rephasing spectrum to $(root)_sr.bin") write("$(root)_sr.bin", sr) -info("Saving non-rephasing spectrum to $(root)_sn.bin") +@info("Saving non-rephasing spectrum to $(root)_sn.bin") write("$(root)_sn.bin", sn) -info("Saving absorptive spectrum to $(root)_sa.bin") +@info("Saving absorptive spectrum to $(root)_sa.bin") write("$(root)_sa.bin", sa) end # function main diff --git a/examples/qd_ema/ema_BX.jl b/examples/qd_ema/ema_BX.jl index eae4b01..220a7d2 100644 --- a/examples/qd_ema/ema_BX.jl +++ b/examples/qd_ema/ema_BX.jl @@ -6,7 +6,7 @@ import YAML function run(args) cfg_f = args[1] -info("Loading parameters from $cfg_f") +@info("Loading parameters from $cfg_f") cfg = open(YAML.load, cfg_f) # load parameters root = cfg["rootname"] @@ -53,7 +53,7 @@ t1_max = cfg["t1_max"] t2_max = cfg["t2_max"] t3_max = cfg["t3_max"] -info("Setting up system") +@info("Setting up system") s = System("g") for tag1 in ["x1", "x2"], tag2 in ["x1", "x2"] energy!(s, tag1, ev2angphz(cfg["e_$(tag1)"]) - ω_frame) @@ -86,7 +86,7 @@ tg = TimeGrid( linspace(0, t3_max, t3_n), ) steps = map(first ∘ diff, tg.times) -info("Grid steps: $(steps)") +@info("Grid steps: $(steps)") # We cache the value of the lineshape functions on a look-up table. lut_step = 1.0 @assert all([rem(s, lut_step)==0 for s in steps]) @@ -95,18 +95,18 @@ for (tag1, tag2) in keys(g) lineshape!(s, tag1, tag2, LineshapeLUT(g[tag1, tag2].(lut_grid), step(lut_grid))) end -info("Computing linear response") +@info("Computing linear response") r_lin = linear(tg, s) -info("Saving to $(root)_rlin.txt") +@info("Saving to $(root)_rlin.txt") writedlm("$(root)_rlin.txt", [tg.times[1] real(r_lin) imag(r_lin)]) r_lin[1] *= 0.5 s_lin = fftshift(ifft(r_lin)) f_lin = fftshift(fftfreq(size(tg)[1], 1/(tg.times[1][2]-tg.times[1][1]))) -info("Saving linear spectrum to $(root)_slin.txt") +@info("Saving linear spectrum to $(root)_slin.txt") writedlm("$(root)_slin.txt", [f_lin real(s_lin) imag(s_lin)]) -info("Computing third order response") +@info("Computing third order response") tic() # Rephasing induced absorption is given by R1* # Nonrephasing IA is given by R2* @@ -115,7 +115,7 @@ rr = zeros(Complex128, size(tg)) rn = zeros(Complex128, size(tg)) for hp in hilbert_paths(s, 3) # setting mu_bx=0 in the config file will skip the paths automatically - info("Path: $hp") + @info("Path: $hp") if hp.p[3] in ["bx12", "bx11", "bx22"] # is ESA rr += -conj(R1(tg, s, hp)) rn += -conj(R2(tg, s, hp)) @@ -126,8 +126,8 @@ for hp in hilbert_paths(s, 3) end end dt = toq() -info("Calulation took $(dt) s") -info("Saving to $(root)_rr.bin, $(root)_rn.bin") +@info("Calulation took $(dt) s") +@info("Saving to $(root)_rr.bin, $(root)_rn.bin") write("$(root)_rr.bin", rr) write("$(root)_rn.bin", rn) rr[1,:,:] *= 0.5 @@ -144,9 +144,9 @@ else sa += flipdim(sr, 1) end -info("Saving rephasing spectrum to $(root)_sr.bin") +@info("Saving rephasing spectrum to $(root)_sr.bin") write("$(root)_sr.bin", sr) -info("Saving non-rephasing spectrum to $(root)_sn.bin") +@info("Saving non-rephasing spectrum to $(root)_sn.bin") write("$(root)_sn.bin", sn) info("Saving absorptive spectrum to $(root)_sa.bin") write("$(root)_sa.bin", sa) diff --git a/examples/vibrational/vibrational.jl b/examples/vibrational/vibrational.jl index b367dd4..71f435b 100644 --- a/examples/vibrational/vibrational.jl +++ b/examples/vibrational/vibrational.jl @@ -6,7 +6,7 @@ import YAML function run(args) cfg_f = args[1] -info("Loading parameters from $cfg_f") +@info("Loading parameters from $cfg_f") cfg = open(YAML.load, cfg_f) # load parameters root = cfg["rootname"] @@ -25,7 +25,7 @@ t1_max = cfg["t1_max"] t2_max = cfg["t2_max"] t3_max = cfg["t3_max"] -info("Setting up system") +@info("Setting up system") s = System("g") energy!(s, "a", ω_a - ω_frame + s_hr*ω_vib) # maintain the 0-phonon line at \omega_a dipole!(s, "g", "a", 1.0) @@ -39,23 +39,23 @@ tg = TimeGrid( linspace(0, t3_max, t3_n), ) -info("Computing linear response") +@info("Computing linear response") r_lin = linear(tg, s) -info("Saving to $(root)_rlin.txt") +@info("Saving to $(root)_rlin.txt") writedlm("$(root)_rlin.txt", [tg.times[1] real(r_lin) imag(r_lin)]) r_lin[1] *= 0.5 s_lin = fftshift(ifft(r_lin)) f_lin = fftshift(fftfreq(size(tg)[1], 1/(tg.times[1][2]-tg.times[1][1]))) -info("Saving linear spectrum to $(root)_slin.txt") +@info("Saving linear spectrum to $(root)_slin.txt") writedlm("$(root)_slin.txt", [f_lin real(s_lin) imag(s_lin)]) -info("Computing third order response") +@info("Computing third order response") tic() rr = R2(tg, s) + R3(tg, s) rn = R1(tg, s) + R4(tg, s) -info("Saving to $(root)_rr.bin, $(root)_rn.bin") +@info("Saving to $(root)_rr.bin, $(root)_rn.bin") write("$(root)_rr.bin", rr) write("$(root)_rn.bin", rn) rr[1,:,:] *= 0.5 @@ -72,12 +72,12 @@ else sa += flipdim(sr, 1) end dt = toq() -info("Calulation took $(dt) s") -info("Saving rephasing spectrum to $(root)_sr.bin") +@info("Calulation took $(dt) s") +@info("Saving rephasing spectrum to $(root)_sr.bin") write("$(root)_sr.bin", sr) -info("Saving non-rephasing spectrum to $(root)_sn.bin") +@info("Saving non-rephasing spectrum to $(root)_sn.bin") write("$(root)_sn.bin", sn) -info("Saving absorptive spectrum to $(root)_sa.bin") +@info("Saving absorptive spectrum to $(root)_sa.bin") write("$(root)_sa.bin", sa) end # function main