Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maximal angles between convex cones #37854

Merged
merged 71 commits into from
May 12, 2024

Commits on May 4, 2024

  1. Configuration menu
    Copy the full SHA
    0ceab7d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5577cd1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    df5c5b6 View commit details
    Browse the repository at this point in the history
  4. Trac sagemath#29169: tweak two max/critical angle error messages.

    The phrase "this cone cannot be..." can be misinterpreted as making a
    value judgment about the given cone, rather than a blanket statement
    about the argument (self) to these two functions. This commit changes
    it to "cone should not be..." to indicate that the user should not
    pass in either a trivial cone or the ambient space.
    orlitzky committed May 4, 2024
    Configuration menu
    Copy the full SHA
    0f782c1 View commit details
    Browse the repository at this point in the history
  5. Trac sagemath#29169: improve error message for _random_admissible_con…

    …e().
    
    The error message output when _random_admissible_cone() receives an
    invalid ambient dimension was a full sentence. This commit pares it
    down to just the important part; amely, that there are no nontrivial
    cones in the ambient dimension.
    orlitzky committed May 4, 2024
    Configuration menu
    Copy the full SHA
    f7ff1b7 View commit details
    Browse the repository at this point in the history
  6. Trac sagemath#29169: remove two unused example lines.

    The line "G_index_sets = list(gevp_licis(G))" appears twice in EXAMPLES,
    but the variable "G_index_sets" is not used thereafter. It was most
    likely copy/pasted into the example by mistake. This commit removes it.
    orlitzky committed May 4, 2024
    Configuration menu
    Copy the full SHA
    f83a6d4 View commit details
    Browse the repository at this point in the history
  7. Trac sagemath#29169: take advantage of improvements in trac sagemath#…

    …30605.
    
    Thanks to some recent improvements in cone containment testing, we no
    longer have to reimplement it for vectors with irrational entries
    ourselves.
    orlitzky committed May 4, 2024
    Configuration menu
    Copy the full SHA
    9ae23ac View commit details
    Browse the repository at this point in the history
  8. Trac sagemath#29169: remove set_random_seed() calls.

    The sage library is now doctested with a random random seed (imagine),
    making most calls to set_random_seed() superfluous. We remove a few
    from the cone critical angle code here.
    orlitzky committed May 4, 2024
    Configuration menu
    Copy the full SHA
    6a44206 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    fb832ad View commit details
    Browse the repository at this point in the history
  10. Trac sagemath#29169: convert solve_gevp* functions to generators.

    The solve_gevp_zero() and solve_gevp_nonzero() functions for cone
    critical angles are "internal" and can return generators. Likewise for
    the testing function _solve_gevp_naive(). This should be a tiny bit
    more efficient.
    orlitzky committed May 4, 2024
    Configuration menu
    Copy the full SHA
    d0867f4 View commit details
    Browse the repository at this point in the history
  11. Trac sagemath#29169: add a warning about inexact critical angle arith…

    …metic.
    
    Passing exact=False to either the max_angle() or critical_angles()
    method of cones is a bit "dangerous" because we can miss eigenspaces
    of dimension >= 2 due to numerical issues. Add a warning to the
    docstring about it.
    orlitzky committed May 4, 2024
    Configuration menu
    Copy the full SHA
    406599f View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    e416d85 View commit details
    Browse the repository at this point in the history
  13. Trac sagemath#29169: clean up two import lists in cone_critical_angle…

    …s.py.
    
    Two tests in this module imported the gevp_licis() function but then
    did not use it. No longer.
    orlitzky committed May 4, 2024
    Configuration menu
    Copy the full SHA
    e88ad09 View commit details
    Browse the repository at this point in the history
  14. Trac sagemath#29169: use matroid implementation for gevp_licis().

    We already have a matroid method that does more or less what the new
    gevp_licis() function does in cone_critical_angles.py. It's faster to
    use the matroid implementation and then tweak its output slightly, so
    let's do that instead.
    orlitzky committed May 4, 2024
    Configuration menu
    Copy the full SHA
    7f032ae View commit details
    Browse the repository at this point in the history
  15. Trac sagemath#29169: switch from QQbar to AA for cone critical angles.

    For reasons I've long forgotten, the cone max/critical angles
    algorithms were using QQbar for "rationals with roots." Switching it
    to AA causes no problems now, and is clearly preferable (the only
    eigenvalues we compute are of positive-definite matrices).
    orlitzky committed May 4, 2024
    Configuration menu
    Copy the full SHA
    a785b88 View commit details
    Browse the repository at this point in the history
  16. Trac sagemath#29169: use base ring's zero for the zero-eigenvalue sub…

    …problem.
    
    This should make the field of "zero" consistent with all the non-zero
    eigenvalues.
    orlitzky committed May 4, 2024
    Configuration menu
    Copy the full SHA
    0acb3d3 View commit details
    Browse the repository at this point in the history
  17. Trac sagemath#29169: return immutable vectors from eigenvalue problems.

    This lets the user (and us, in the tests) stick the results into a set
    or any other structure whose elements must be hashable.
    orlitzky committed May 4, 2024
    Configuration menu
    Copy the full SHA
    3fea1b6 View commit details
    Browse the repository at this point in the history
  18. Trac sagemath#29169: replace _lists_equivalent() with set equality.

    Now that all eigenvalue problems should be solved over the same field,
    and now that we're returning immutable eigenvectors from those
    problems, using set equality (as oposed to element-wise ==) becomes
    possible.
    orlitzky committed May 4, 2024
    Configuration menu
    Copy the full SHA
    f0e39cc View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    9d0e3e6 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    d0e24ed View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    8347ba5 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    a81dfbd View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    861b00e View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    893029a View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    82caf7e View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    1cdbabe View commit details
    Browse the repository at this point in the history
  27. src/sage/geometry/cone*.py: drop critical_angles() method

    Recent research has shown that (in many cases) the maximal angle does
    not change too much if the cones are perturbed. This creates even more
    of a safety net when computing the maximal angle, because falling back
    to inexact arithmetic "perturbs" the cones.
    
    The critical angle function, however, is not lower-semicontinuous as a
    set-valued map. I don't like having a "debug" parameter that tells you
    you're getting wrong results, and a user interface that requires you
    to understand the subtle differences between upper- and
    lower-semicontinuity for set-valued maps is not awesome. I think it's
    best if we leave this out for now.
    orlitzky committed May 4, 2024
    Configuration menu
    Copy the full SHA
    d3d6f5d View commit details
    Browse the repository at this point in the history
  28. src/sage/geometry/cone.py: document the inexact fallback for max_angle()

    The max_angle() can fall back to exact=False if exact=True runs in to
    (known) issues. The [Or2024] reference discusses when/why this is OK.
    orlitzky committed May 4, 2024
    Configuration menu
    Copy the full SHA
    be692ea View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    37d3cd4 View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    7049f90 View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    e489fae View commit details
    Browse the repository at this point in the history
  32. Configuration menu
    Copy the full SHA
    909f42c View commit details
    Browse the repository at this point in the history
  33. Configuration menu
    Copy the full SHA
    ca7b571 View commit details
    Browse the repository at this point in the history
  34. src/sage/geometry/cone.py: allow the full space in max_angle()

    This special case is handled by the P.intersection(-Q) check before we
    have to think too hard about whether or not it would hurt anything.
    orlitzky committed May 4, 2024
    Configuration menu
    Copy the full SHA
    a53e706 View commit details
    Browse the repository at this point in the history
  35. src/sage/geometry/cone_critical_angles.py: the full space is admissible

    Allow _random_admissible_cone() to generate the entire ambient
    space. This only affects a few test cases where it doesn't matter.
    orlitzky committed May 4, 2024
    Configuration menu
    Copy the full SHA
    d5778f4 View commit details
    Browse the repository at this point in the history
  36. src/sage/geometry/cone.py: update a max_angle() test

    Maxima no longer crashes, so the description was wrong, and we can
    avoid numerical comparisons with simplify() and a round trip through
    sympy.
    orlitzky committed May 4, 2024
    Configuration menu
    Copy the full SHA
    6db77f6 View commit details
    Browse the repository at this point in the history
  37. Configuration menu
    Copy the full SHA
    828d328 View commit details
    Browse the repository at this point in the history
  38. Configuration menu
    Copy the full SHA
    89c9d91 View commit details
    Browse the repository at this point in the history
  39. src/sage/geometry/cone.py: one max_angle() test case is still crashy

    Witness:
    
      sage: n = 4 ## line 6313 ##
      sage: K = cones.schur(n) ## line 6314 ##
      sage: bool( K.max_angle()[0].simplify() == ((n-1)/n)*pi ) ## line 6315 ##
      ------------------------------------------------------------------------
      /usr/lib/python3.11/site-packages/cysignals/signals.cpython-311-x86_64-
      linux-gnu.so(+0x8950)[0x7fa8349c1950]
    
    So let's go through sympy in the n=4 case, too.
    orlitzky committed May 4, 2024
    Configuration menu
    Copy the full SHA
    d158da3 View commit details
    Browse the repository at this point in the history
  40. src/sage/geometry/cone.py: bring back the max_angle() warning

    We should explain why it's not a good idea to _start_ with
    exact=False.
    orlitzky committed May 4, 2024
    Configuration menu
    Copy the full SHA
    03c9230 View commit details
    Browse the repository at this point in the history
  41. Configuration menu
    Copy the full SHA
    fb8ea6c View commit details
    Browse the repository at this point in the history
  42. Configuration menu
    Copy the full SHA
    e7cd5df View commit details
    Browse the repository at this point in the history
  43. Configuration menu
    Copy the full SHA
    c5725fc View commit details
    Browse the repository at this point in the history
  44. Configuration menu
    Copy the full SHA
    e9f2172 View commit details
    Browse the repository at this point in the history
  45. Configuration menu
    Copy the full SHA
    dccc60c View commit details
    Browse the repository at this point in the history
  46. Configuration menu
    Copy the full SHA
    8a18017 View commit details
    Browse the repository at this point in the history
  47. Configuration menu
    Copy the full SHA
    4956d2c View commit details
    Browse the repository at this point in the history
  48. Configuration menu
    Copy the full SHA
    000045f View commit details
    Browse the repository at this point in the history
  49. Configuration menu
    Copy the full SHA
    f43c251 View commit details
    Browse the repository at this point in the history
  50. src/sage/geometry/cone.py: don't define P,Q in max_angle()

    These names are helpful in the cone_critical_angles module, but not in
    max_angle() which immediately passes them off to another method.
    orlitzky committed May 4, 2024
    Configuration menu
    Copy the full SHA
    3b042e7 View commit details
    Browse the repository at this point in the history
  51. Configuration menu
    Copy the full SHA
    ac302c3 View commit details
    Browse the repository at this point in the history
  52. Configuration menu
    Copy the full SHA
    33bb8a4 View commit details
    Browse the repository at this point in the history
  53. Configuration menu
    Copy the full SHA
    603341a View commit details
    Browse the repository at this point in the history
  54. Configuration menu
    Copy the full SHA
    677bde3 View commit details
    Browse the repository at this point in the history
  55. Configuration menu
    Copy the full SHA
    e4d9749 View commit details
    Browse the repository at this point in the history
  56. Configuration menu
    Copy the full SHA
    10d33a9 View commit details
    Browse the repository at this point in the history
  57. Configuration menu
    Copy the full SHA
    6a8db73 View commit details
    Browse the repository at this point in the history
  58. Configuration menu
    Copy the full SHA
    b111700 View commit details
    Browse the repository at this point in the history
  59. Configuration menu
    Copy the full SHA
    ad1c7b4 View commit details
    Browse the repository at this point in the history
  60. Configuration menu
    Copy the full SHA
    3773c6e View commit details
    Browse the repository at this point in the history
  61. Configuration menu
    Copy the full SHA
    1fa06c5 View commit details
    Browse the repository at this point in the history
  62. Configuration menu
    Copy the full SHA
    cc81025 View commit details
    Browse the repository at this point in the history
  63. Configuration menu
    Copy the full SHA
    99295e8 View commit details
    Browse the repository at this point in the history
  64. Configuration menu
    Copy the full SHA
    f3aa994 View commit details
    Browse the repository at this point in the history
  65. Configuration menu
    Copy the full SHA
    61cb012 View commit details
    Browse the repository at this point in the history
  66. Configuration menu
    Copy the full SHA
    1e742e9 View commit details
    Browse the repository at this point in the history
  67. src/sage/geometry/cone_critical_angles.py: optimize M[I,J] indexing

    Using the identity M[I,J].transpose() == M.transpose()[J,I], we can
    avoid transposing M itself and instead transpose the smaller M[I,J]
    when M[I,J] is already known.
    orlitzky committed May 4, 2024
    Configuration menu
    Copy the full SHA
    32e543a View commit details
    Browse the repository at this point in the history
  68. Configuration menu
    Copy the full SHA
    dff5441 View commit details
    Browse the repository at this point in the history

Commits on May 6, 2024

  1. Configuration menu
    Copy the full SHA
    ad7c29c View commit details
    Browse the repository at this point in the history
  2. src/sage/geometry/cone_critical_angles.py: add another "internal" war…

    …ning
    
    The existing warning about this module being internal is easy to
    miss. This one should appear in bright red at the top of the module
    documentation.
    orlitzky committed May 6, 2024
    Configuration menu
    Copy the full SHA
    30464f7 View commit details
    Browse the repository at this point in the history
  3. src/doc/en/reference/discrete_geometry/index.rst: add cone critical a…

    …ngles
    
    This is an internal module, but it's fully documented and nice to have
    access to the implementation behind the max_angle() function. Despite
    being documented, the functions in cone_critical_angles.py are subject
    to change at any time. This itself is loudly documented.
    orlitzky committed May 6, 2024
    Configuration menu
    Copy the full SHA
    1b8f08f View commit details
    Browse the repository at this point in the history