Try uniformly distributed hyperplane orientations

Unit normals are uniformly distributed over the sphere.
This commit is contained in:
Aaron Fenyes 2024-02-10 15:02:26 -05:00
parent b3b7c2026d
commit 621c4c5776
1 changed files with 9 additions and 6 deletions

View File

@ -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)))