|
| 1 | +#= |
| 2 | + Example of a zero-temperature Spin-Boson Model with a tailored spectral density J(ω). This spectral density can be either defined with discrete |
| 3 | + modes or continuous formula. |
| 4 | +
|
| 5 | + The dynamics is simulated using the T-TEDOPA method that maps the normal modes environment into a non-uniform tight-binding chain. |
| 6 | +
|
| 7 | + H = \\frac{ω_0}{2} σ_z + Δ σ_x + c_0 σ_x(b_0^\\dagger + b_0) + \\sum_{i=0}^{N-1} t_i (b_{i+1}^\\dagger b_i +h.c.) + \\sum_{i=0}^{N-1} ϵ_i b_i^\\dagger b_i |
| 8 | +
|
| 9 | + Two variants of the one-site Time Dependent Variational Principal (TDVP) are presented for the time evolution of the quantum state. |
| 10 | +=# |
| 11 | + |
| 12 | +using MPSDynamics, Plots, LaTeXStrings |
| 13 | + |
| 14 | +const ∞ = Inf |
| 15 | +#---------------------------- |
| 16 | +# Physical parameters |
| 17 | +#---------------------------- |
| 18 | + |
| 19 | +ω0 = 0.2 # TLS gap |
| 20 | + |
| 21 | +Δ = 0.0 # tunneling |
| 22 | + |
| 23 | +#----------------------- |
| 24 | +# Options and parameters for the Spectral Density |
| 25 | +# Definition of the frequency ranges and J(ω) formula for the continuous case |
| 26 | +#----------------------- |
| 27 | + |
| 28 | +#Jω_type=:Discrete |
| 29 | + |
| 30 | +Jω_type=:Continuous |
| 31 | + |
| 32 | +if Jω_type==:Discrete |
| 33 | + |
| 34 | + freqs = [0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50] # Frequency value |
| 35 | + |
| 36 | + Jω = [0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10] # Value of the spectral density at the respective frequency |
| 37 | + |
| 38 | + N = length(freqs) # The number of mode in the chain is set with the number of discrete frequencies |
| 39 | + |
| 40 | + d = 6 # number of Fock states of the chain modes |
| 41 | + |
| 42 | +elseif Jω_type==:Continuous |
| 43 | + |
| 44 | + N = 30 # length of the chain |
| 45 | + |
| 46 | + d = 6 # number of Fock states of the chain modes |
| 47 | + |
| 48 | + α = 0.1 # coupling strength |
| 49 | + |
| 50 | + s = 1 # ohmicity |
| 51 | + |
| 52 | + ωc = 1.0 # Cut-off of the spectral density J(ω) |
| 53 | + |
| 54 | + #β = 100 # Thermalized environment |
| 55 | + β = ∞ # Case zero temperature T=0, β → ∞ |
| 56 | + |
| 57 | + # AB segments correspond to the different frequency ranges where the spectral density is defined. |
| 58 | + # It corresponds to i=1 ; i=2 ; i=3 and i=4 of the Jω_fct(ω,i) function. |
| 59 | + |
| 60 | + # The y formula and the frequency ranges can be changed while keeping the extra terms for thermalized environments. |
| 61 | + # This example reproduces an Ohmic type spectral density. |
| 62 | + |
| 63 | + AB = [[-Inf -ωc];[-ωc 0];[0 ωc];[ωc Inf]] |
| 64 | + |
| 65 | + function Jω_fct(ω,i) |
| 66 | + if i==1 # First segment of AB (here [-Inf -ωc]) |
| 67 | + y = 0 |
| 68 | + elseif i==2 # Second segment of AB (here [-ωc 0]) |
| 69 | + if β == ∞ |
| 70 | + y = 0 # zero for negative frequencies when β == Inf |
| 71 | + else |
| 72 | + y = -2*α*abs.(ω).^s / ωc^(s-1) .* (coth.((β/2).*ω) .+ 1) ./2 # .* (coth.((β/2).*ω) .+ 1) ./2 and the abs.(ω) have to be added when β != Inf (T-TEDOPA formulation) |
| 73 | + end |
| 74 | + elseif i==3 # Third segment of AB (here [0 ωc]) |
| 75 | + if β == ∞ |
| 76 | + y = 2*α*ω.^s / ωc^(s-1) |
| 77 | + else |
| 78 | + y = 2*α*ω.^s / ωc^(s-1) .* (coth.((β/2).*ω) .+ 1) ./2 # .* (coth.((β/2).*ω) .+ 1) ./2 has to be added when β != Inf (T-TEDOPA formulation) |
| 79 | + end |
| 80 | + elseif i==4 # Fourth segment of AB (here [ωc Inf]) |
| 81 | + y = 0 |
| 82 | + end |
| 83 | + return y |
| 84 | + end |
| 85 | + |
| 86 | +else |
| 87 | + |
| 88 | + throw(ErrorException("The spectral density has either to be Continuous or Discrete")) |
| 89 | + |
| 90 | +end |
| 91 | + |
| 92 | +#----------------------- |
| 93 | +# Calculation of chain parameters |
| 94 | +#----------------------- |
| 95 | + |
| 96 | +if Jω_type==:Discrete |
| 97 | + |
| 98 | + cpars = chaincoeffs_finiteT_discrete(β, freqs, Jω; procedure=:Lanczos, Mmax=5000, save=false) # chain parameters, i.e. on-site energies ϵ_i, hopping energies t_i, and system-chain coupling c_0 |
| 99 | + |
| 100 | +#= If cpars is stored in "../ChainOhmT/discreteT" |
| 101 | + curdir = @__DIR__ |
| 102 | + dir_chaincoeff = abspath(joinpath(curdir, "../ChainOhmT/discreteT")) |
| 103 | + cpars = readchaincoeffs("$dir_chaincoeff/chaincoeffs.h5", N, β) # chain parameters, i.e. on-site energies ϵ_i, hopping energies t_i, and system-chain coupling c_0 |
| 104 | +=# |
| 105 | + |
| 106 | +elseif Jω_type==:Continuous |
| 107 | + |
| 108 | + cpars = chaincoeffs_finiteT(N, β, false; α=α, s=s, J=Jω_fct, ωc=ωc, mc=size(AB)[1], mp=0, AB=AB, iq=1, idelta=2, procedure=:Lanczos, Mmax=5000, save=false) # chain parameters, i.e. on-site energies ϵ_i, hopping energies t_i, and system-chain coupling c_0 |
| 109 | + |
| 110 | +end |
| 111 | + |
| 112 | + |
| 113 | +#----------------------- |
| 114 | +# Simulation parameters |
| 115 | +#----------------------- |
| 116 | + |
| 117 | +dt = 0.5 # time step |
| 118 | + |
| 119 | +tfinal = 30.0 # simulation time |
| 120 | + |
| 121 | +method = :TDVP1 # Regular one-site TDVP (fixed bond dimension) |
| 122 | + |
| 123 | +# method = :DTDVP # Adaptive one-site TDVP (dynamically updating bond dimension) |
| 124 | + |
| 125 | +convparams = [2,4,6] # MPS bond dimension (1TDVP) |
| 126 | + |
| 127 | +# convparams = [1e-2, 1e-3, 1e-4] # threshold value of the projection error (DTDVP) |
| 128 | + |
| 129 | +#--------------------------- |
| 130 | +# MPO and initial state MPS |
| 131 | +#--------------------------- |
| 132 | + |
| 133 | +H = spinbosonmpo(ω0, Δ, d, N, cpars) # MPO representation of the Hamiltonian |
| 134 | + |
| 135 | +ψ = unitcol(1,2) # Initial up-z system state |
| 136 | + |
| 137 | +A = productstatemps(physdims(H), state=[ψ, fill(unitcol(1,d), N)...]) # MPS representation of |ψ>|Vacuum> |
| 138 | + |
| 139 | +#--------------------------- |
| 140 | +# Definition of observables |
| 141 | +#--------------------------- |
| 142 | + |
| 143 | +ob1 = OneSiteObservable("sz", sz, 1) |
| 144 | + |
| 145 | +ob2 = OneSiteObservable("chain mode occupation", numb(d), (2,N+1)) |
| 146 | + |
| 147 | +ob3 = TwoSiteObservable("SXdisp", sx, MPSDynamics.disp(d), [1], collect(2:N+1)) |
| 148 | + |
| 149 | +#------------- |
| 150 | +# Simulation |
| 151 | +#------------ |
| 152 | + |
| 153 | +A, dat = runsim(dt, tfinal, A, H; |
| 154 | + name = "ohmic spin boson model", |
| 155 | + method = method, |
| 156 | + obs = [ob2,ob3], |
| 157 | + convobs = [ob1], |
| 158 | + params = @LogParams(Δ, ω0, N, Jω_type), |
| 159 | + convparams = convparams, |
| 160 | + verbose = false, |
| 161 | + savebonddims = true, # this keyword argument enables the bond dimension at each time step to be saved when using DTDVP |
| 162 | + save = true, |
| 163 | + plot = true, |
| 164 | + ); |
| 165 | + |
| 166 | +#---------- |
| 167 | +# Plots |
| 168 | +#---------- |
| 169 | + |
| 170 | +display(method == :TDVP1 && plot(dat["data/times"], dat["convdata/sz"], label=["Dmax = 2" "Dmax = 4" "Dmax = 6"], xlabel=L"t",ylabel=L"\sigma_z")) |
| 171 | + |
| 172 | +method == :DTDVP && plot(dat["data/times"], dat["convdata/sz"], label=["p = 1e-2" "p = 1e-3" "p = 1e-4"], xlabel=L"t",ylabel=L"\sigma_z") |
| 173 | + |
| 174 | +method == :DTDVP && heatmap(dat["data/times"], collect(0:N+1), dat["data/bonddims"], xlabel=L"t",ylabel="bond index") |
| 175 | + |
| 176 | +heatmap(dat["data/times"], collect(1:N), abs.(dat["data/SXdisp"][1,:,:]), xlabel=L"t",ylabel="chain mode") |
0 commit comments