Skip to content

Commit

Permalink
test pass
Browse files Browse the repository at this point in the history
  • Loading branch information
EigenSolver committed Jul 11, 2024
1 parent 9bab325 commit 4d7e5f5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/testdephasingfactor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
f = statefidelity(model)
w = dephasingmatrix(model)

w2 = sampling(model, dephasingmatrix, M)
w2 = sampling(model, dephasingmatrix, M)[1]
w2 = abs.(w2)
@test typeof(w2) == Matrix{Float64}
@test norm(w - w2) < 2e-2

rho = model.Ψ * model.Ψ'
Expand All @@ -26,9 +28,9 @@

println(w)
f_c = (model.Ψ' * (w .* rho) * model.Ψ)
f_s = (model.Ψ' * (abs.(w2) .* rho) * model.Ψ)
f_s = (model.Ψ' * (w2 .* rho) * model.Ψ)
@test f f_c
@test f f_s
@test isapprox(f, f_s, rtol=1e-2)
end

##
Expand Down

0 comments on commit 4d7e5f5

Please sign in to comment.