Skip to content

Commit 46d62b8

Browse files
committed
Use StableRNG for testing
1 parent 9e21727 commit 46d62b8

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

test/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ QuantumControlBase = "f10a33bc-5a64-497c-be7b-6f86b4f0c2aa"
1313
QuantumControlTestUtils = "d3fd27c9-1dfb-4e67-b0c0-90d0d87a1e48"
1414
QuantumPropagators = "7bf12567-5742-4b91-a078-644e72a65fc1"
1515
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
16+
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
1617
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1718
UnicodePlots = "b8865327-cd53-5732-bb35-84acbb429228"
1819

test/test_random.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using Test
2-
using Random: Xoshiro
2+
using StableRNGs: StableRNG
33
using LinearAlgebra: norm, eigvals
44
import SparseArrays
55

@@ -19,7 +19,7 @@ relerr(a, b) = abs(a - b) / max(abs(a), abs(b))
1919
@test H isa Matrix{Float64}
2020
@test size(H) == (N, N)
2121

22-
rng = Xoshiro(3405091510)
22+
rng = StableRNG(3405091510)
2323

2424
ρ = 1.0
2525
H = random_matrix(N; hermitian=true, complex=false, rng)
@@ -50,7 +50,7 @@ end
5050
@test H isa Matrix{ComplexF64}
5151
@test size(H) == (N, N)
5252

53-
rng = Xoshiro(3727996169)
53+
rng = StableRNG(3727996169)
5454

5555
ρ = 1.0
5656
H = random_matrix(N; hermitian=true, rng)
@@ -81,7 +81,7 @@ end
8181
@test H isa SparseArrays.SparseMatrixCSC{Float64,Int64}
8282
@test size(H) == (N, N)
8383

84-
rng = Xoshiro(1572573603)
84+
rng = StableRNG(1572573603)
8585

8686
ρ = 1.0
8787
d = 0.5
@@ -118,7 +118,7 @@ end
118118
@test H isa SparseArrays.SparseMatrixCSC{ComplexF64,Int64}
119119
@test size(H) == (N, N)
120120

121-
rng = Xoshiro(3677556226)
121+
rng = StableRNG(3677556226)
122122

123123
ρ = 1.0
124124
d = 0.5
@@ -155,7 +155,7 @@ end
155155
@test H isa Matrix{Float64}
156156
@test size(H) == (N, N)
157157

158-
rng = Xoshiro(940283801)
158+
rng = StableRNG(1582783931)
159159

160160
ρ = 1.0
161161
H = random_matrix(N; complex=false, rng)
@@ -177,7 +177,7 @@ end
177177
@test maximum(imag.(H)) > 0.0
178178
@test size(H) == (N, N)
179179

180-
rng = Xoshiro(2137585613)
180+
rng = StableRNG(2137585613)
181181

182182
ρ = 1.0
183183
H = random_matrix(N; rng)
@@ -198,7 +198,7 @@ end
198198
@test H isa SparseArrays.SparseMatrixCSC{Float64,Int64}
199199
@test size(H) == (N, N)
200200

201-
rng = Xoshiro(1710562897)
201+
rng = StableRNG(1710562897)
202202

203203
ρ = 1.0
204204
d = 0.5
@@ -236,7 +236,7 @@ end
236236
@test maximum(imag.(H)) > 0.0
237237
@test size(H) == (N, N)
238238

239-
rng = Xoshiro(2799774491)
239+
rng = StableRNG(2799774491)
240240

241241
ρ = 1.0
242242
d = 0.5

0 commit comments

Comments
 (0)