Skip to content

Commit c0bc0e7

Browse files
committed
add tests
1 parent 08bb40d commit c0bc0e7

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/steadystate.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ function _steadystate_fourier(
417417

418418
v0 = _dense_similar(L_0_mat, n_fourier * N)
419419
fill!(v0, 0)
420-
@allowscalar v0[n_max * N + 1] = weight
420+
@allowscalar v0[n_max*N+1] = weight
421421

422422
if !isnothing(solver.Pl)
423423
kwargs = merge((; kwargs...), (Pl = solver.Pl(M),))

test/ext-test/gpu/cuda_ext.jl

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ end
154154
@test ρ_ss_cpu.data Array(ρ_ss_gpu_csr.data) atol = 1e-8 * length(ρ_ss_cpu)
155155
end
156156

157-
158157
@testset "CUDA steadystate_fourier" begin
159158
N = 2
160159
ωd = 1.0
@@ -163,16 +162,19 @@ end
163162
Hp = cu(sigmax())
164163
Hm = cu(sigmax())
165164
c_ops = [cu(sqrt(0.1) * sigmam())]
166-
ρ_list1 = steadystate_fourier(H0, Hp, Hm, ωd, c_ops;
167-
solver = SteadyStateLinearSolver(),
168-
n_max = n_max)
169-
ρ0 = steadystate_fourier(H0, Hp, Hm, ωd, c_ops;
170-
solver = SSFloquetEffectiveLiouvillian(SteadyStateDirectSolver()),
171-
n_max = n_max)
165+
ρ_list1 = steadystate_fourier(H0, Hp, Hm, ωd, c_ops; solver = SteadyStateLinearSolver(), n_max = n_max)
166+
ρ0 = steadystate_fourier(
167+
H0,
168+
Hp,
169+
Hm,
170+
ωd,
171+
c_ops;
172+
solver = SSFloquetEffectiveLiouvillian(SteadyStateDirectSolver()),
173+
n_max = n_max,
174+
)
172175
@test isapprox(ρ0, ρ_list1[1]; atol = 1e-6)
173176
end
174177

175-
176178
@testset "CUDA ptrace" begin
177179
g = fock(2, 1)
178180
e = fock(2, 0)

0 commit comments

Comments
 (0)