Skip to content

Commit 0b7cf20

Browse files
committed
Updated Volkov phases to use "automatic integration"
1 parent 250d243 commit 0b7cf20

File tree

3 files changed

+41
-67
lines changed

3 files changed

+41
-67
lines changed

src/automatic_integration.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ function AutomaticIntegration(f, x, x₀; k=3, init=zero(f(x₀)))
117117
ai
118118
end
119119

120+
Base.eltype(ai::AutomaticIntegration) = eltype(ai.∫f)
121+
120122
(ai::AutomaticIntegration)(x; i=find_closest(ai.x, x)) =
121123
ai.∫f[i] + primitive_integral(ai.f, ai.x[i], x, ai.c, ai.w)
122124

src/dyson_expansions.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,9 @@ function evaluate_momenta!(𝐩s, prefactors, system, unique_momenta, indetermin
361361
for idm in indeterminate_momenta
362362
uidm = unique_momenta[idm]
363363
a,b = i[uidm[1]],i[uidm[2]]
364-
set_momentum!(𝐩s, stationary_momentum(system.volkov, a, b), idm)
365-
τ = system.t[a]-system.t[b]
364+
ta,tb = system.t[a], system.t[b]
365+
set_momentum!(𝐩s, stationary_momentum(system.volkov, ta, tb), idm)
366+
τ = ta - tb
366367
ζ = (2π/(im*τ + ϵ))^(3/2)
367368
prefactors[idm] = ζ
368369
end
@@ -424,9 +425,10 @@ function integrate_diagram(::Type{Amp}, system::System, diagram::Diagram, iref,
424425
Sₑₗ = zero(ctT)
425426
for j = 1:order
426427
a,b = is[j], is[j+1]
427-
τ = system.t[a] - system.t[b]
428+
ta,tb = system.t[a], system.t[b]
429+
τ = ta - tb
428430
Sᵢₒₙ += Eᵢₒₙₛ[j]*τ
429-
Sₑₗ += volkov_phase(𝐩s[j], system.volkov, a, b)
431+
Sₑₗ += volkov_phase(𝐩s[j], system.volkov, ta, tb)
430432
end
431433
S = Sᵢₒₙ + Sₑₗ
432434
aₚᵣₒₚ = prod(prefactors)*exp(-im*S)

src/volkov.jl

Lines changed: 33 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,49 @@
1-
struct VolkovPhases{Time,T,U}
2-
t::Time
3-
∫A::Vector{T}
4-
∫A²::Vector{U}
1+
struct VolkovPhases{ReferenceTime,∫At,∫A²t}
2+
T::ReferenceTime
3+
∫A::∫At
4+
∫A²::∫A²t
55
end
66

7-
function VolkovPhases(F::ElectricFields.AbstractField, t::AbstractVector)
8-
At = typeof(vector_potential(F, t[1]))
9-
Tt = eltype(t)
10-
nt = length(t)
11-
∫Av = zeros(At, nt)
12-
∫A²v = zeros(Tt, nt)
13-
14-
tend = t[end]
7+
function _VolkovPhases(F::ElectricFields.AbstractField, t, tend)
158
Aend = ElectricFields.vector_potential(F, tend)
169

1710
A = t -> ElectricFields.vector_potential(F, t) - Aend
18-
∫A = AccumulatedIntegral(A, At, Tt; t=tend)
19-
∫A² = AccumulatedIntegral(t -> sum(abs2, A(t)), Tt, Tt; t=tend)
20-
21-
for i = nt-1:-1:1
22-
set!(∫A, t[i])
23-
set!(∫A², t[i])
24-
∫Av[i] = ∫A.∫f
25-
∫A²v[i] = ∫A².∫f
26-
end
11+
∫A = AutomaticIntegration(A, t, tend)
12+
square(z) = z^2
13+
∫A² = AutomaticIntegration(t -> sum(square, A(t)), t, tend)
2714

28-
VolkovPhases(t .- tend, ∫Av, ∫A²v)
15+
VolkovPhases(tend, ∫A, ∫A²)
2916
end
3017

31-
# This is second-order accurate, assuming Av[1] == Av[end] == 0
32-
function VolkovPhases(Av::AbstractVector{At}, t::AbstractVector{Tt}) where {At,Tt}
33-
nt = length(t)
34-
dt = step(t)
35-
∫Av = zeros(At, nt)
36-
∫A²v = zeros(Tt, nt)
37-
38-
tend = t[end]
39-
Aend = Av[end]
18+
VolkovPhases(F::ElectricFields.AbstractField, t::AbstractVector) =
19+
_VolkovPhases(F, t, t[end])
4020

41-
∫Av[end] = -Av[end]*dt
42-
∫A²v[end] = -sum(abs2, Av[end])*dt
21+
VolkovPhases(F::ElectricFields.AbstractField, tre::AbstractVector, tim::AbstractVector) =
22+
_VolkovPhases(F, ComplexPlane(tre, tim), tre[end])
4323

44-
for i = nt-1:-1:1
45-
dA = (Av[i] + Av[i+1])/2
46-
dA² = sum(abs2, dA)
47-
∫Av[i] = ∫Av[i+1] - dA*dt
48-
∫A²v[i] = ∫A²v[i+1] - dA²*dt
49-
end
50-
51-
VolkovPhases(t .- tend, ∫Av, ∫A²v)
52-
end
24+
volkov_phase_k²(k, v::VolkovPhases, t) = norm(k)^2*t
5325

54-
volkov_phase_k²(k, v, i) = norm(k)^2*v.t[i]
26+
kdotA(k::Number, A::Number) = k*A
27+
kdotA(k::SVector{3}, A::Number) = k[3]*A
28+
kdotA(k::SVector{3}, A::SVector{3}) = dot(k, A)
29+
volkov_phase_2kA(k, v::VolkovPhases, t) = 2kdotA(k, v.∫A(t))
5530

56-
volkov_phase_2kA(k::Number, v::VolkovPhases{<:Any,<:Number,<:Number}, i) =
57-
2k*v.∫A[i]
31+
volkov_phase_A²(v::VolkovPhases, t) = v.∫A²(t)
5832

59-
volkov_phase_2kA(k::SVector{3}, v::VolkovPhases{<:Any,<:Number,<:Number}, i) =
60-
2k[3]*v.∫A[i]
61-
62-
volkov_phase_2kA(k::SVector{3}, v::VolkovPhases{<:Any,<:SVector{3},<:Number}, i) =
63-
2dot(k, v.∫A[i])
64-
65-
volkov_phase_A²(v, i) = v.∫A²[i]
66-
67-
volkov_phase(k, v::VolkovPhases, i) =
68-
-(volkov_phase_k²(k, v, i) +
69-
volkov_phase_2kA(k, v, i) +
70-
volkov_phase_A²(v, i))/2
33+
function volkov_phase(k, v::VolkovPhases, t)
34+
# We only have to subtract the reference time from the integral
35+
# over k², since it has been properly accounted for when setting
36+
# up the integrals over A and A².
37+
-(volkov_phase_k²(k, v, t - v.T) +
38+
volkov_phase_2kA(k, v, t) +
39+
volkov_phase_A²(v, t))/2
40+
end
7141

72-
volkov_phase(k, v::VolkovPhases, i, j) =
73-
-(volkov_phase(k, v, i) -
74-
volkov_phase(k, v, j))
42+
volkov_phase(k, v::VolkovPhases, a, b) =
43+
-(volkov_phase(k, v, a) -
44+
volkov_phase(k, v, b))
7545

76-
function stationary_momentum(v::VolkovPhases, i, j)
77-
τ = v.t[i] - v.t[j]
78-
-1/τ*(v.∫A[i]-v.∫A[j])
46+
function stationary_momentum(v::VolkovPhases, a, b)
47+
τ = a - b
48+
-1/τ*v.∫A(b, a)
7949
end

0 commit comments

Comments
 (0)