From 621c4c577630b3dc7e351bdd0e521c7e2a31d8ba Mon Sep 17 00:00:00 2001 From: Aaron Fenyes Date: Sat, 10 Feb 2024 15:02:26 -0500 Subject: [PATCH] Try uniformly distributed hyperplane orientations Unit normals are uniformly distributed over the sphere. --- engine-proto/Engine.jl | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/engine-proto/Engine.jl b/engine-proto/Engine.jl index b1b0b30..e6b326d 100644 --- a/engine-proto/Engine.jl +++ b/engine-proto/Engine.jl @@ -75,26 +75,29 @@ trivial_soln[sph_z_ind] .= 1 println("trivial solutions: $trivial_soln") norm2 = vec -> real(dot(conj.(vec), vec)) is_nontrivial = soln -> norm2(abs.(real.(soln)) - trivial_soln) > 1e-4*length(gens(coordring)) -max_slope = 5 -binom = Binomial(2max_slope, 1/2) +##max_slope = 5 +##binom = Binomial(2max_slope, 1/2) Random.seed!(6071) n_planes = 3 for through_trivial in [false, true] samples = [] for _ in 1:n_planes - cut_matrix = rand(binom, freedom, length(gens(coordring))) .- max_slope + cut_matrix = transpose(hcat( + (normalize(randn(length(gens(coordring)))) for _ in 1:freedom)... + )) + ##cut_matrix = rand(binom, freedom, length(gens(coordring))) .- max_slope ##cut_matrix = [ ## 1 1 1 1 0 1 1 0 1 1 0; ## 1 2 1 2 0 1 1 0 1 1 0; ## 1 1 0 1 0 1 2 0 2 0 0 ##] - ## [verbose] display(cut_matrix) + display(cut_matrix) ## [verbose] if through_trivial cut_offset = [sum(cf[sph_z_ind]) for cf in eachrow(cut_matrix)] - ## [verbose] display(cut_offset) + display(cut_offset) ## [verbose] cut_subspace = LinearSubspace(cut_matrix, cut_offset) else - cut_subspace = LinearSubspace(cut_matrix, fill(0, freedom)) + cut_subspace = LinearSubspace(cut_matrix, fill(0., freedom)) end wtns = witness_set(system, cut_subspace) real_solns = solution.(filter(isreal, results(wtns)))