Skip to content

Commit

Permalink
make rank deterministic
Browse files Browse the repository at this point in the history
  • Loading branch information
araujoms committed Nov 25, 2024
1 parent 956002a commit bd236b3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/random.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
ψ = random_state_ket(3)
@test isa(ψ, Vector{ComplexF64})
for R in [Float64, Double64, Float128, BigFloat]
Random.seed!(1337) #make ranks behave
ψ = random_state_ket(R, 3)
@test ψ' * ψ 1
@test isa(ψ, Vector{R})
Expand All @@ -23,7 +24,7 @@
ψ = random_state_ket(T, 3)
@test ψ' * ψ 1
@test isa(ψ, Vector{T})
ρ = random_state(R, 3)
ρ = random_state(T, 3)
@test tr(ρ) 1
@test rank(ρ; rtol = Ket._rtol(R)) == 3
ρ = random_state(T, 3, 2)
Expand Down

0 comments on commit bd236b3

Please sign in to comment.