jarvist / PolaronMobility.jl

@@ -546,7 +546,7 @@
Loading
546 546
547 547
See also [`multi_F`](@ref), [`feynmanvw`](@ref).
548 548
"""
549 -
function var_params(α...; v = 0.0, w = 0.0, ω = 1.0, N = 1, show_trace = false) # N number of v and w params
549 +
function extended_feynmanvw(α...; v = 0.0, w = 0.0, ω = 1.0, N = 1, show_trace = false) # N number of v and w params
550 550
551 551
    if N != length(v) != length(w)
552 552
        return error("The number of variational parameters v & w must be equal to N.")

@@ -337,7 +337,7 @@
Loading
337 337
    betas = [T == 0.0 ? Inf64 : ħ * ω[j] / (kB * T) * 1e12 for j in eachindex(ω)]
338 338
339 339
    # Calculate variational parameters for each temperature from multiple phonon frequencies.
340 -
    params = T == 0.0 ? var_params(α; v=v_guess, w=v_guess, ω=ω, N=N_params) : var_params(α, betas; v=v_guess, w=w_guess, ω=ω, N=N_params)
340 +
    params = T == 0.0 ? extended_feynmanvw(α; v=v_guess, w=v_guess, ω=ω, N=N_params) : extended_feynmanvw(α, betas; v=v_guess, w=w_guess, ω=ω, N=N_params)
341 341
342 342
    # Separate tuples of variational parameters into a list of 'v' and 'w' parameters for each temperature.
343 343
    v_params = params[1]
@@ -426,7 +426,7 @@
Loading
426 426
            v_guess, w_guess, E_guess = params[i-1]
427 427
        end
428 428
        
429 -
        params[i] = Trange[i] == 0.0 ? var_params(α; v=v_guess, w=w_guess, ω=ω, N=N_params) : var_params(α, @view(betas[i, :]); v=v_guess, w=w_guess, ω=ω, N=N_params)
429 +
        params[i] = Trange[i] == 0.0 ? extended_feynmanvw(α; v=v_guess, w=w_guess, ω=ω, N=N_params) : extended_feynmanvw(α, @view(betas[i, :]); v=v_guess, w=w_guess, ω=ω, N=N_params)
430 430
431 431
        @fastmath @inbounds @simd for j in 1:N_params
432 432
            v_params[i, j] = params[i][1][j]
@@ -470,7 +470,7 @@
Loading
470 470
    beta = T == 0.0 ? Inf64 : ω / T
471 471
472 472
    # Calculate variational parameters for each alpha parameter and temperature. Returns a Matrix of tuples.
473 -
    params = T == 0.0 ? var_params(α; v=v_guess, w=w_guess, ω=ω, N=N_params) : var_params(α, beta; v=v_guess, w=w_guess, ω=ω, N=N_params)
473 +
    params = T == 0.0 ? extended_feynmanvw(α; v=v_guess, w=w_guess, ω=ω, N=N_params) : extended_feynmanvw(α, beta; v=v_guess, w=w_guess, ω=ω, N=N_params)
474 474
475 475
    # Separate tuples of variational parameters into a Matrices of 'v' and 'w' parameters for each alpha parameter and temperature.
476 476
    v_param = params[1]
@@ -538,7 +538,7 @@
Loading
538 538
539 539
        @fastmath @inbounds @simd for i in eachindex(αrange)
540 540
        
541 -
            params[i, j] = Trange[j] == 0.0 ? var_params(αrange[i]; v=v_guess, w=w_guess, ω=ω, N=N_params) : var_params(αrange[i], betas[j]; v=v_guess, w=w_guess, ω=ω, N=N_params)
541 +
            params[i, j] = Trange[j] == 0.0 ? extended_feynmanvw(αrange[i]; v=v_guess, w=w_guess, ω=ω, N=N_params) : extended_feynmanvw(αrange[i], betas[j]; v=v_guess, w=w_guess, ω=ω, N=N_params)
542 542
543 543
            for k in 1:N_params
544 544
                v_params[i, j, k] = params[i, j][1][k]

@@ -174,7 +174,7 @@
Loading
174 174
    Δv = v - w # defines a constraint, so that v>w
175 175
    initial = [Δv + 0.01, w]
176 176
177 -
    # Tthermal action 
177 +
    # Thermal action 
178 178
    f(x) = F(x[1] + x[2], x[2], β, α)
179 179
180 180
    # Use Optim to optimise v and w to minimise enthalpy.
Files Coverage
src 59.48%
Project Totals (9 files) 59.48%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading