From 779675749d5a5ca9e33015232d2a99077c70d658 Mon Sep 17 00:00:00 2001 From: apkille Date: Mon, 30 Dec 2024 17:17:41 -0500 Subject: [PATCH 1/2] decrease max nmode size in tests to 5 --- test/test_autodiff.jl | 2 +- test/test_randoms.jl | 8 ++++---- test/test_states.jl | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/test_autodiff.jl b/test/test_autodiff.jl index 6b8da9d..c06b4c7 100644 --- a/test/test_autodiff.jl +++ b/test/test_autodiff.jl @@ -7,7 +7,7 @@ @testset "derivatives" begin - n = rand(1:20) + n = rand(1:5) xs = rand(Float64) function f1(x::R) where {R<:Real} diff --git a/test/test_randoms.jl b/test/test_randoms.jl index 65ea290..1928880 100644 --- a/test/test_randoms.jl +++ b/test/test_randoms.jl @@ -4,7 +4,7 @@ using LinearAlgebra: eigvals, adjoint @testset "random utils" begin - nmodes = rand(1:20) + nmodes = rand(1:5) qpairbasis = QuadPairBasis(nmodes) qblockbasis = QuadBlockBasis(nmodes) U_qpair = Gabs._rand_unitary(qpairbasis) @@ -36,7 +36,7 @@ end @testset "random states" begin - nmodes = rand(1:20) + nmodes = rand(1:5) qpairbasis = QuadPairBasis(nmodes) qblockbasis = QuadBlockBasis(nmodes) rs_pair = randstate(qpairbasis) @@ -76,7 +76,7 @@ end @testset "random unitaries" begin - nmodes = rand(1:20) + nmodes = rand(1:5) qpairbasis = QuadPairBasis(nmodes) qblockbasis = QuadBlockBasis(nmodes) ru = randunitary(qpairbasis) @@ -102,7 +102,7 @@ end @testset "random channels" begin - nmodes = rand(1:20) + nmodes = rand(1:5) qpairbasis = QuadPairBasis(nmodes) qblockbasis = QuadBlockBasis(nmodes) rc = randchannel(qpairbasis) diff --git a/test/test_states.jl b/test/test_states.jl index 158f33d..553a876 100644 --- a/test/test_states.jl +++ b/test/test_states.jl @@ -16,8 +16,8 @@ end @testset "thermal states" begin - n = rand(1:10) - ns = rand(1:10, nmodes) + n = rand(1:5) + ns = rand(1:5, nmodes) state = thermalstate(qpairbasis, n) @test state isa GaussianState @test thermalstate(SVector{2*nmodes}, SMatrix{2*nmodes,2*nmodes}, qpairbasis, n) isa GaussianState @@ -126,7 +126,7 @@ end @testset "symplectic spectrum" begin - nmodes = rand(1:20) + nmodes = rand(1:5) qpairbasis = QuadPairBasis(nmodes) qblockbasis = QuadBlockBasis(nmodes) From ff064d6d0afe3c65f424e74efc140299fe69c9b5 Mon Sep 17 00:00:00 2001 From: apkille Date: Mon, 30 Dec 2024 17:20:44 -0500 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cdfb032..8cd6fd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## v1.2.4 - 2024-12-30 - **(fix)** Preserve mode correlations in `ptrace``. +- Change maximum number of modes from 20 to 5 in random multimode system tests to reduce numerical instabilies. ## v1.2.3 - 2024-12-26