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

Add deformation cones and checking for regularity for Point Configurations and normal fans of Polyhedra #39496

Merged
merged 10 commits into from
Feb 21, 2025

Conversation

jplab
Copy link
Contributor

@jplab jplab commented Feb 11, 2025

In this pull request, we add the method deformation_cone (to point configurations and polyhedron) and is_polytopal (to fans).

This is related to the Kahler cone of Toric Varieties, but has some subtle differences to make it work as it should in the discrete geometry context. Therefore, it has a separate implementation.

TODO: In the future, perhaps it could be fusioned.

sage: tc = Polyhedron([(1, -1), (1/3, 1), (1, 1/3), (-1, 1), (-1, -1)])
sage: dc = tc.deformation_cone()
sage: dc.an_element()
(2, 1, 1, 0, 0)
sage: [_.A() for _ in tc.Hrepresentation()]
[(1, 0), (0, 1), (0, -1), (-3, -3), (-1, 0)]
sage: P = Polyhedron(rays=[(1, 0, 2), (0, 1, 1), (0, -1, 1), (-3, -3, 0), (-1, 0, 0)])
sage: P.rays()
(A ray in the direction (-1, -1, 0),
 A ray in the direction (-1, 0, 0),
 A ray in the direction (0, -1, 1),
 A ray in the direction (0, 1, 1),
 A ray in the direction (1, 0, 2))

sage: py = Polyhedron([(0, -1, -1), (0, -1, 1), (0, 1, -1), (0, 1, 1), (1, 0, 0)])
sage: dc_py = py.deformation_cone(); dc_py
A 4-dimensional polyhedron in QQ^5 defined as the convex hull of 1 vertex, 1 ray, 3 lines
sage: [ineq.b() for ineq in py.Hrepresentation()]
[0, 1, 1, 1, 1]
sage: r = dc_py.rays()[0]
sage: l1,l2,l3 = dc_py.lines()
sage: r.vector()-l1.vector()/2-l2.vector()-l3.vector()/2
(0, 1, 1, 1, 1)

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

@jplab jplab self-assigned this Feb 11, 2025
@jplab jplab requested a review from fchapoton February 11, 2025 17:57
@jplab
Copy link
Contributor Author

jplab commented Feb 11, 2025

I still need to add the method is_regular and is_projective... Will do very soon.

@jplab jplab added t: enhancement s: needs work c: geometry sd128 tickets of Sage Days 128 Le Teich labels Feb 11, 2025
@seblabbe
Copy link
Contributor

I made some changes to the code of is_regular. It is available in the branch of the same name in my github.

Copy link

github-actions bot commented Feb 12, 2025

Documentation preview for this PR (built with commit 2a9328a; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

Corrected typo
Copy link
Contributor

@fchapoton fchapoton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good. Let us wait for the continuous integration

vbraun pushed a commit to vbraun/sage that referenced this pull request Feb 18, 2025
…or Point Configurations and normal fans of Polyhedra

    
In this pull request, we add the method `deformation_cone` (to point
configurations and polyhedron) and `is_polytopal` (to fans).

This is related to the Kahler cone of Toric Varieties, but has some
subtle differences to make it work as it should in the discrete geometry
context. Therefore, it has a separate implementation.

TODO: In the future, perhaps it could be fusioned.

```sage
sage: tc = Polyhedron([(1, -1), (1/3, 1), (1, 1/3), (-1, 1), (-1, -1)])
sage: dc = tc.deformation_cone()
sage: dc.an_element()
(2, 1, 1, 0, 0)
sage: [_.A() for _ in tc.Hrepresentation()]
[(1, 0), (0, 1), (0, -1), (-3, -3), (-1, 0)]
sage: P = Polyhedron(rays=[(1, 0, 2), (0, 1, 1), (0, -1, 1), (-3, -3,
0), (-1, 0, 0)])
sage: P.rays()
(A ray in the direction (-1, -1, 0),
 A ray in the direction (-1, 0, 0),
 A ray in the direction (0, -1, 1),
 A ray in the direction (0, 1, 1),
 A ray in the direction (1, 0, 2))

sage: py = Polyhedron([(0, -1, -1), (0, -1, 1), (0, 1, -1), (0, 1, 1),
(1, 0, 0)])
sage: dc_py = py.deformation_cone(); dc_py
A 4-dimensional polyhedron in QQ^5 defined as the convex hull of 1
vertex, 1 ray, 3 lines
sage: [ineq.b() for ineq in py.Hrepresentation()]
[0, 1, 1, 1, 1]
sage: r = dc_py.rays()[0]
sage: l1,l2,l3 = dc_py.lines()
sage: r.vector()-l1.vector()/2-l2.vector()-l3.vector()/2
(0, 1, 1, 1, 1)
```

### 📝 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.
    
URL: sagemath#39496
Reported by: JP Labbe
Reviewer(s): Frédéric Chapoton
@vbraun vbraun merged commit e368fa7 into sagemath:develop Feb 21, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: geometry sd128 tickets of Sage Days 128 Le Teich t: enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants