-
-
Notifications
You must be signed in to change notification settings - Fork 655
Changed calculate_voronoi_cell to use the orthogonal complement as it's artificial points. #39805
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
Changed calculate_voronoi_cell to use the orthogonal complement as it's artificial points. #39805
Conversation
…'s artificial points.
@DaveWitteMorris. One thing I'm worried about is the multiplication of the |
Also this pull request doesn't depend on the pull request with the updated orthogonal complement stuff. I wanted to keep them separate just in case that other PR doesn't make it through. However |
Documentation preview for this PR (built with commit 1a7901c; changes) is ready! 🎉 |
I think you can solve the problems by rearranging the code to work as follows:
The Edit: Correction - Do not calculate a radius unless |
@DaveWitteMorris. I've implement your changes. It works correctly for the following example:
However for the following example it produces an error:
It seems to be failing on the final cut of the diamond cutting algorithm. I'm not sure what is causing this error? If you have any idea let me know. |
The error comes from a bug in the original code that arises when
So this should fix it: - cut = Polyhedron(ieqs=inequalities)
- V = V.intersection(cut)
+ if inequalities:
+ cut = Polyhedron(ieqs=inequalities)
+ V = V.intersection(cut) Please add a doctest to show that this bug has been fixed. |
Co-authored-by: DaveWitteMorris <43105863+DaveWitteMorris@users.noreply.github.com>
Co-authored-by: DaveWitteMorris <43105863+DaveWitteMorris@users.noreply.github.com>
@DaveWitteMorris. I have made the |
line 130: - and radius ``C``.
+ and squared radius ``C``. line 260: - ``radius`` -- radius of basis vectors to consider
- ``radius`` -- square of radius of basis vectors to consider Delete lines 284 and 285. (They are duplicates of 278 and 279.) line 306: - sage: C = IntegerLattice(M).voronoi_cell(radius=35)
+ sage: C = IntegerLattice(M).voronoi_cell() I am worried that the radius computed by sagemath may be so large that this example is too slow, but let's see. |
I did not intend to delete my comment about not converting to integers. Please delete all of lines 334-339, except line 337. The formula for
|
I don't think I understand this question:
The scalars can be expected to be a subring of the reals (probably integers or rational numbers). I think dividing by 2 is handled correctly. |
…anged radius in test. Fixed artificial_length calculation by adding a square root. Removed the conversion of additional_vectors to integers.
@DaveWitteMorris I've made the changes you suggested. Also for my question it makes sense to be now that you can use real numbers for matrices and modules of different groups. I was worried that they did not have this functionality. |
All tests passed locally, so I do not think the CI doctest failure was caused by this ticket. I will set to positive review on Wednesday if there are no other comments. However, please correct the minor mistake in the title of this web page: change "it's" to "its" (no apostrophe). |
No, I cannot set to positive review yet, because the example from #34091 gives an error: Here is the example:
|
Co-authored-by: DaveWitteMorris <43105863+DaveWitteMorris@users.noreply.github.com>
Thanks for fixing these issues, which were bad bugs. I'll set to positive review if However, as I said earlier, please change the typo in the title of this web page. It should be "its", not "it's" (i.e., the apostrophe should be deleted). |
sagemathgh-39805: Changed calculate_voronoi_cell to use the orthogonal complement as it's artificial points. Fixes sagemath#38052. Fixes sagemath#37086. Changed `calculate_voronoi_cell` to use the orthogonal complement as the artificial points added to the lattice. We then multiply each element of the basis by its denominator in order to get integers instead of rationals. This solution was detailed by @DaveWitteMorris in the original issue. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [X] The title is concise and informative. - [X] The description explains in detail what this PR is about. - [X] I have linked a relevant issue or discussion. - [X] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies URL: sagemath#39805 Reported by: Noel-Roemmele Reviewer(s): DaveWitteMorris, Noel-Roemmele
sagemathgh-39805: Changed calculate_voronoi_cell to use the orthogonal complement as it's artificial points. Fixes sagemath#38052. Fixes sagemath#37086. Changed `calculate_voronoi_cell` to use the orthogonal complement as the artificial points added to the lattice. We then multiply each element of the basis by its denominator in order to get integers instead of rationals. This solution was detailed by @DaveWitteMorris in the original issue. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [X] The title is concise and informative. - [X] The description explains in detail what this PR is about. - [X] I have linked a relevant issue or discussion. - [X] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies URL: sagemath#39805 Reported by: Noel-Roemmele Reviewer(s): DaveWitteMorris, Noel-Roemmele
sagemathgh-39805: Changed calculate_voronoi_cell to use the orthogonal complement as it's artificial points. Fixes sagemath#38052. Fixes sagemath#37086. Changed `calculate_voronoi_cell` to use the orthogonal complement as the artificial points added to the lattice. We then multiply each element of the basis by its denominator in order to get integers instead of rationals. This solution was detailed by @DaveWitteMorris in the original issue. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [X] The title is concise and informative. - [X] The description explains in detail what this PR is about. - [X] I have linked a relevant issue or discussion. - [X] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies URL: sagemath#39805 Reported by: Noel-Roemmele Reviewer(s): DaveWitteMorris, Noel-Roemmele
Fixes #38052. Fixes #37086. Changed
calculate_voronoi_cell
to use the orthogonal complement as the artificial points added to the lattice. We then multiply each element of the basis by its denominator in order to get integers instead of rationals. This solution was detailed by @DaveWitteMorris in the original issue.📝 Checklist
⌛ Dependencies