Engine prototype #13
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "engine-proto"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The branch to be merged tracks our work on prototyping a geometric constraint-solving engine. This work is in the
engine-proto
folder. Most of the code is in Julia (version 1.10.0).Approaches
We tried two broad approaches to the constraint geometry problem. Each one suggested various solution techniques. The Gram matrix approach, with the low-rank factorization technique, seems the most promising.
Algebraic (In the
alg-test
subfolder). Write the constraints as polynomials in the inversive coordinates of the elements, and use computational algebraic geometry techniques to solve the resulting system. We tried the following techniques.Engine.Algebraic.jl
). Symbolic. Find a Gröbner basis for the ideal generated by the constraint equations. Information about the solution variety, like its codimension, is then relatively easy to extract.Engine.Numerical.jl
). Numerical. Cut the solution set along a random hyperplane to get a generic zero-dimensional slice, and then use a fancy homotopy technique to approximate the points in that slice.A few notes about our experiences can be found on the engine prototype wiki page.
Gram matrix (in the
gram-test
subfolder). A construction is described completely, up to conformal transformations, by the Gram matrix of the vectors representing its elements. Express the constraints as fixed entries of the Gram matrix, and use numerical linear algebra techniques to find a list of vectors whose Gram matrix fits the bill. We tried the following techniques.gram-test.sage
,gram-test.jl
,overlap-test.jl
). Find a cluster of up to five elements whose Gram matrix is completely filled in by the constraints. Use LDL decomposition to find a list of vectors with that Gram matrix. This technique can be made algebraic, as seen inoverlap-test.jl
.low-rank-test.jl
) and an visualization of the loss function landscape near global minima (basin-shapes.jl
).The Gram matrix parameterization wiki page contains detailed notes on this approach.
Findings
With the algebraic approach, we hit a performance wall pretty quickly as our constructions grew. It was often hard to find real solutions of the polynomial system, since the techniques we use work most naturally in the complex world.
With the Gram matrix approach, on the other hand, we could solve interesting problems in acceptably short times using the low-rank factorization technique. We put the optimization routine in its own module (
Engine.jl
) and used it to solve five example problems:overlapping-pyramids.jl
circles-in-triangle.jl
sphere-in-tetrahedron.jl
tetrahedron-radius-ratio.jl
irisawa-hexlet.jl
We plan to use low-rank factorization of the Gram matrix in our first app prototype.
Visualizations
We used the visualizer in the
ganja-test
folder to visually check our low-rank factorization results. The visualizer runs Ganja.js in an Electron app, made with Blink. Although Ganja.js makes beautiful pictures under most circumstances, we found two obstacles to using it in production.OK, by way of starting the review of this PR, I looked over the first six rows of notes/inversive.md, and had a few questions:
I will finish the review when you've had a chance to do these things, thanks.
P.S. I have now understood from today's discussion that the coordinates in the current prototype are not quite exactly these. I think we should probably leave these notes alone, but just clearly document wherever the coordinate entities are declared exactly what they are are and how they relate to these coordinates. Thanks!
Checkout
From your project repository, check out a new branch and test the changes.