Skip to content

Commit

Permalink
Test fixed after normalization update
Browse files Browse the repository at this point in the history
Detection documentation is now no longer included as this is deprecated functions.
  • Loading branch information
mabuni1998 committed Jun 5, 2024
1 parent c3b3f57 commit 21d4ca5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
8 changes: 4 additions & 4 deletions test/helper_functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function test_multiplewaveguides(b,Nw,idx,order,wda1,adw1)
nsteps = length(times)
dt = times[2] - times[1]
ξfun(t1) = 1
psi = tensor([i == bw_idx ? onephoton(b.bases[i],idx,ξfun) : i==bc_idx ? fockstate(b.bases[i],1) : fockstate(b.bases[i],0) for i in 1:3]...)
psi = tensor([i == bw_idx ? onephoton(b.bases[i],idx,ξfun,norm=true) : i==bc_idx ? fockstate(b.bases[i],1) : fockstate(b.bases[i],0) for i in 1:3]...)
tmp = copy(psi)
tmp2 = copy(psi)

Expand Down Expand Up @@ -172,7 +172,7 @@ function test_multiplewaveguides(b,Nw,idx,order,wda1,adw1)
psi_view = view_waveguide(tmp,ground_idx)

for k in filter(x -> x != idx, 1:Nw)
psi = tensor([i == bw_idx ? onephoton(b.bases[i],k,ξfun) : i==bc_idx ? fockstate(b.bases[i],1) : fockstate(b.bases[i],0) for i in 1:3]...)
psi = tensor([i == bw_idx ? onephoton(b.bases[i],k,ξfun,norm=true) : i==bc_idx ? fockstate(b.bases[i],1) : fockstate(b.bases[i],0) for i in 1:3]...)
mul!(tmp,wda1,psi,1,0)
i,j = min(k,idx),max(k,idx)
index = (i-1)*Nw + j - (i*(i+1))÷2
Expand All @@ -199,7 +199,7 @@ function test_interaction(b,Nw,idx1,idx2,order,wd2w1)
nsteps = length(times)
dt = times[2] - times[1]
ξfun(t1) = 1
psi = tensor([i == bw_idx ? onephoton(b.bases[i],idx1,ξfun) : fockstate(b.bases[i],0) for i in 1:3]...)
psi = tensor([i == bw_idx ? onephoton(b.bases[i],idx1,ξfun,norm=true) : fockstate(b.bases[i],0) for i in 1:3]...)
tmp = copy(psi)

testvec2 = ones(nsteps) .* sqrt(2)/get_nsteps(psi.basis)
Expand All @@ -212,7 +212,7 @@ function test_interaction(b,Nw,idx1,idx2,order,wd2w1)
end

ξfun(t1,t2) = 1
psi = tensor([i == bw_idx ? twophoton(b.bases[i],idx1,ξfun) : fockstate(b.bases[i],0) for i in 1:3]...)
psi = tensor([i == bw_idx ? twophoton(b.bases[i],idx1,ξfun,norm=true) : fockstate(b.bases[i],0) for i in 1:3]...)
tmp = copy(psi)

mul!(tmp,wd2w1,psi,1,0)
Expand Down
2 changes: 0 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ println("Starting tests with $(Threads.nthreads()) threads out of `Sys.CPU_THREA

@doset "operators"
@doset "singlecavity"
@doset "detection_single"
@doset "detection_double"
# TODO doctests need fixing
#VERSION == v"1.8" && @doset "doctests"
get(ENV,"QUANTUMOPTICS_JET_TEST","")=="true" && @doset "jet"
Expand Down
8 changes: 4 additions & 4 deletions test/test_operators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ include("helper_functions.jl")
adw = ad w

ξfun(t1,t2) = 1
input = twophoton(bw,ξfun)
input = twophoton(bw,ξfun,norm=true)
psi = fockstate(bc,0) input
psi_out = copy(psi)

Expand All @@ -42,7 +42,7 @@ end
adw = ad w

ξfun(t1) = 1
input = onephoton(bw,ξfun)
input = onephoton(bw,ξfun,norm=true)
psi = fockstate(bc,1) input
psi_out = copy(psi)
mul!(psi_out,wda,psi,1,0.0)
Expand All @@ -67,7 +67,7 @@ end
adw = ad w

ξfun(t1) = 1
input = onephoton(bw,ξfun)
input = onephoton(bw,ξfun,norm=true)
psi = fockstate(bc,0) input
wda_out_2 = copy(psi)
adw_out_2 = copy(psi)
Expand All @@ -84,7 +84,7 @@ end
wda = a wd
adw = ad w

input = onephoton(bw,ξfun)
input = onephoton(bw,ξfun,norm=true)
psi = fockstate(bc,0) input
adw_out_1 = copy(psi)
wda_out_1 = copy(psi)
Expand Down

0 comments on commit 21d4ca5

Please sign in to comment.