Skip to content

Commit fabe307

Browse files
committed
add test for SpinEnsemble
1 parent 6d8b621 commit fabe307

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

test/runtests.jl

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ using Test
33
using SpinEnsembles
44
import LinearAlgebra: norm
55

6-
include("../src/RandLoctions.jl")
7-
include("../src/Visualization.jl")
6+
include("../src/randloctions.jl")
7+
include("../src/visualization.jl")
88

99
##
1010
M=randsphericallocs(1000,1,10)
@@ -29,11 +29,18 @@ M=randcartesianlocs(1000,1,10)
2929
@test all(v->all(x->x<10,abs.(v)), eachrow(M))
3030

3131
## Type pass for all the function
32-
@test typeof(dipolarcoefs(M))<:Vector{Float64}
32+
@test dipolarcoefs(M) isa Vector{Float64}
3333

3434
## Test FID function
3535
D=randcoefs(2000,3,10)
3636
t=0:0.01:20
3737
h=0.5
38-
fid(t,D,h)
39-
rabi(t,D,h)
38+
fid_curve=fid(t,D,h)
39+
@test fid_curve isa Vector{Float64}
40+
rabi_curve=rabi(t,D,h)
41+
@test rabi_curve isa Vector{Float64}
42+
43+
## Test SpinEnsemble
44+
spins=SpinEnsemble(1000,2,[1,1,0],3,5)
45+
@test abs(spins.rho-2.436)<1e3
46+
randlocs(spins)

0 commit comments

Comments
 (0)