Skip to content

Commit

Permalink
Fix namespace of fraunhofer
Browse files Browse the repository at this point in the history
  • Loading branch information
roflmaostc committed Mar 25, 2024
1 parent 36c62df commit 834b538
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/fraunhofer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
mid = N ÷ 2+ 1
slit[:, mid-ΔS-ΔW:mid-ΔS+ΔW] .= 1
slit[:, mid+ΔS-ΔW:mid+ΔS+ΔW] .= 1
output = fraunhofer(slit, z, λ, L)
output = WaveOpticsPropagation.fraunhofer(slit, z, λ, L)

efficient_fraunhofer = Fraunhofer(slit, z, λ, L);
output2 = efficient_fraunhofer(slit)
Expand All @@ -34,13 +34,13 @@
arr = randn(ComplexF32, (N, N))
fr = Fraunhofer(arr, z, λ, L)
f(x) = sum(abs2, arr .- fr(x))
f2(x) = sum(abs2, arr .- fraunhofer(x, z, λ, L))
f2(x) = sum(abs2, arr .- WaveOpticsPropagation.fraunhofer(x, z, λ, L))
@test Zygote.gradient(f, arr)[1] Zygote.gradient(f2, arr)[1]

arr = randn(ComplexF32, (15, 15))
fr = Fraunhofer(arr, z, λ, L, skip_final_phase=false)
f(x) = sum(abs2, arr .- fr(x)[1])
f2(x) = sum(abs2, arr .- fraunhofer(x, z, λ, L, skip_final_phase=false)[1])
f2(x) = sum(abs2, arr .- WaveOpticsPropagation.fraunhofer(x, z, λ, L, skip_final_phase=false)[1])
@test Zygote.gradient(f, arr)[1] Zygote.gradient(f2, arr)[1]


Expand Down

0 comments on commit 834b538

Please sign in to comment.