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

Generic implementation of fitting ideal #36299

Merged
merged 2 commits into from
Sep 27, 2023
Merged

Conversation

miguelmarco
Copy link
Contributor

and specific _fitting_ideal for MPolynomialRing

This implements a method fitting_ideal for generic matrices, that only does a simple optimizations, and a more optimized version (named _fitting_ideal ) for matrices over polynomial rings with multiple variables.

Fixes #36298

📝 Checklist

  • The title is concise, informative, and self-explanatory.
  • 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 accordingly.

⌛ Dependencies

@github-actions
Copy link

Documentation preview for this PR (built with commit e4e3f36; changes) is ready! 🎉

@vbraun vbraun merged commit 034f1f6 into sagemath:develop Sep 27, 2023
18 of 19 checks passed
@mkoeppe mkoeppe added this to the sage-10.2 milestone Sep 27, 2023
vbraun pushed a commit to vbraun/sage that referenced this pull request Dec 4, 2023
…tic varieties

    
<!-- Describe your changes here in detail -->
 Recently in sagemath#36128 (already in develop) characteristic varieties of
finitely presented fundamental groups were introduced. Its computation
is based on Fitting ideals of Laurent polynomial matrices. In sagemath#36299,
Fitting ideals were implemented for generic rings with some improvements
for PID and polynomial rings.

There are two original goals in this PR: to improve the output of
characteristic varieties and to use the cited implementation.  In order
to make computations faster, the implementation of Fitting ideals should
apply to Laurent polynomial rings and for this goal, several changes
should be applied to Laurent polynomials in `Sagemath`.

I am not sure if a deeper change should be made, since I applied only
the changes I needed for the above goal:

- src/sage/groups/finitely_presented.py:
    - Changes in `fitting_ideals`.
- src/sage/matrix/matrix2.py: Style changes.
- src/sage/matrix/matrix_laurent_mpolynomial_dense.pyx: This is a new
file to create the class `Matrix_laurent_mpolynomial_dense`.
    - A method `laurent_matrix_reduction` to obtain a matrix of
polynomials where the variables are non common factors for neither the
rows nor the columns.
    - A methord `_fitting_ideal` to use the same method for matrices of
polynomials.
- src/sage/matrix/matrix__mpolynomial_dense.pyx: Style changes.

The main changes are for Laurent polynomials to avoid errors in the
above implementations.

- src/sage/rings/polynomials/laurent_polynomial.pyx:
    - Style changes.
    - Create `xgcd` needed for `inverse_mod`.
    - Create `inverse_mod`.
    - Create `divides`, I copied the code for polynomials with minor
changes.
- src/sage/rings/polynomials/laurent_polynomial_ideal.py:
    - Style changes.
    - Changes in hint keyword in  `__init__`, the previous code create
issues, e.g., impossible to sum ideals of univariate Laurent polynomial
rings. They involve changes in doctests for `hint`
    - Changes in `__contains__` since `__reduce__` is different for
univariate and multivaraite case.
    - Create `gens_reduced`.
    - Changes in `polynomial_ideal` to deal differently if uni- and
multi-variate.
- src/sage/rings/polynomials/laurent_polynomial_mpair.py:
    - Style changes.
    - Create `divides`, I copied the code for polynomials with minor
changes.
- src/sage/rings/polynomials/laurent_polynomial_ring.py:
    - Style changes.
    - Some `TestSuite`'s applied to domains as base_rings; the
corresponding `TestSuite`'s for polynomials also failed if applied to
polynomial rings.
- src/sage/rings/polynomials/laurent_polynomial_ring_base.py:
    - Style changes.
    - Implement `is_noetherian`.
- src/sage/rings/polynomials/polynomial_element.pyx: Style changes.

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [x] I have created tests covering the changes.
- [x] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36368
Reported by: Enrique Manuel Artal Bartolo
Reviewer(s): Enrique Manuel Artal Bartolo, kedlaya, miguelmarco, Travis Scrimshaw
vbraun pushed a commit to vbraun/sage that referenced this pull request Dec 5, 2023
…tic varieties

    
<!-- Describe your changes here in detail -->
 Recently in sagemath#36128 (already in develop) characteristic varieties of
finitely presented fundamental groups were introduced. Its computation
is based on Fitting ideals of Laurent polynomial matrices. In sagemath#36299,
Fitting ideals were implemented for generic rings with some improvements
for PID and polynomial rings.

There are two original goals in this PR: to improve the output of
characteristic varieties and to use the cited implementation.  In order
to make computations faster, the implementation of Fitting ideals should
apply to Laurent polynomial rings and for this goal, several changes
should be applied to Laurent polynomials in `Sagemath`.

I am not sure if a deeper change should be made, since I applied only
the changes I needed for the above goal:

- src/sage/groups/finitely_presented.py:
    - Changes in `fitting_ideals`.
- src/sage/matrix/matrix2.py: Style changes.
- src/sage/matrix/matrix_laurent_mpolynomial_dense.pyx: This is a new
file to create the class `Matrix_laurent_mpolynomial_dense`.
    - A method `laurent_matrix_reduction` to obtain a matrix of
polynomials where the variables are non common factors for neither the
rows nor the columns.
    - A methord `_fitting_ideal` to use the same method for matrices of
polynomials.
- src/sage/matrix/matrix__mpolynomial_dense.pyx: Style changes.

The main changes are for Laurent polynomials to avoid errors in the
above implementations.

- src/sage/rings/polynomials/laurent_polynomial.pyx:
    - Style changes.
    - Create `xgcd` needed for `inverse_mod`.
    - Create `inverse_mod`.
    - Create `divides`, I copied the code for polynomials with minor
changes.
- src/sage/rings/polynomials/laurent_polynomial_ideal.py:
    - Style changes.
    - Changes in hint keyword in  `__init__`, the previous code create
issues, e.g., impossible to sum ideals of univariate Laurent polynomial
rings. They involve changes in doctests for `hint`
    - Changes in `__contains__` since `__reduce__` is different for
univariate and multivaraite case.
    - Create `gens_reduced`.
    - Changes in `polynomial_ideal` to deal differently if uni- and
multi-variate.
- src/sage/rings/polynomials/laurent_polynomial_mpair.py:
    - Style changes.
    - Create `divides`, I copied the code for polynomials with minor
changes.
- src/sage/rings/polynomials/laurent_polynomial_ring.py:
    - Style changes.
    - Some `TestSuite`'s applied to domains as base_rings; the
corresponding `TestSuite`'s for polynomials also failed if applied to
polynomial rings.
- src/sage/rings/polynomials/laurent_polynomial_ring_base.py:
    - Style changes.
    - Implement `is_noetherian`.
- src/sage/rings/polynomials/polynomial_element.pyx: Style changes.

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [x] I have created tests covering the changes.
- [x] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36368
Reported by: Enrique Manuel Artal Bartolo
Reviewer(s): Enrique Manuel Artal Bartolo, kedlaya, miguelmarco, Travis Scrimshaw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fitting ideals
4 participants