Opened 17 months ago

Closed 17 months ago

# normal_basis for positive-dimensional ideals

Reported by: Owned by: gh-mwageringel major sage-9.1 commutative algebra singular klee Markus Wageringel Travis Scrimshaw, Kwankyu Lee N/A 8fd5628 8fd56280a16c52638ae9a0e324162e4c6258acf4

### Description

This ticket adds a `degree` option to the `normal_basis` method of ideals.

This allows to limit the output to monomials of a particular degree, which is useful when the corresponding quotient ring is not finite-dimensional as a vector space.

```sage: R.<x,y,z> = QQ[]
sage: I = R.ideal(x^2 + y^2 - 1)
sage: [I.normal_basis(d) for d in (0..3)]
[[1],
[z, y, x],
[z^2, y*z, x*z, y^2, x*y],
[z^3, y*z^2, x*z^2, y^2*z, x*y*z, y^3, x*y^2]]
```

Previously, the method could only be used when the quotient ring was finite-dimensional.

This functionality is provided by Singular. For reference, the corresponding Singular function is kbase.

### comment:1 Changed 17 months ago by gh-mwageringel

• Authors set to Markus Wageringel
• Branch set to u/gh-mwageringel/29543
• Commit set to 223802c0c46154392886f77378a80d41d24ae87c
• Status changed from new to needs_review
• Summary changed from normal_basis() for positive-dimensional ideals to normal_basis for positive-dimensional ideals

New commits:

 ​223802c `29543: add degree option to normal_basis`

### comment:2 Changed 17 months ago by tscrim

• Reviewers set to Travis Scrimshaw

Note that this change is backwards incompatible for anyone who was passing `algorithm` to `normal_basis` but not as a keyword. IMO, this is sufficiently unlikely to warrant additional action, but you could do a deprecation warning `if isinstance(degree, str):` to possibly catch this. I leave that choice up to you. Either way you decide, you can set a positive review (after adding the deprecation).

### comment:3 Changed 17 months ago by klee

(1) An explicit OUTPUT seems better.

```         INPUT:

-        - ``degree`` -- integer; if not ``None``, return only the monomials of
-          the given degree
+        - ``degree`` -- ``None`` or integer
+
+        OUTPUT:
+
+        If ``degree`` is an integer, only the monomials of the given degree in
+        the normal basis.
```

(2) Some trimming.

```         """
-        Return a vector space basis (consisting of monomials) of the
-        quotient ring of this ideal.
+        Return a vector space basis of the quotient ring of this ideal.

INPUT:

-        - ``degree`` -- integer (default: ``None``); if not ``None``, return
-          only the monomials of the given degree
-
-        - ``algorithm`` -- string (default: ``"libsingular"``); if different
-          from the default, this will use the ``kbase()`` command from
-
-        - ``singular`` -- instance of Singular interface (default: the default
-          instance); the singular interpreter to use when ``algorithm`` is not
-          ``"libsingular"``
+        - ``degree`` -- integer (default: ``None``)
+
+        - ``algorithm`` -- string (default: ``"libsingular"``); if not the
+          default, this will use the ``kbase()`` command from Singular
+
+        - ``singular`` -- the singular interpreter to use when ``algorithm`` is
+          not ``"libsingular"`` (default: the default instance)
+
+        OUTPUT:
+
+        Monomials in the basis. If ``degree`` is given, only the monomials of
+        the given degree.
```

### comment:4 Changed 17 months ago by git

• Commit changed from 223802c0c46154392886f77378a80d41d24ae87c to 8fd56280a16c52638ae9a0e324162e4c6258acf4

Branch pushed to git repo; I updated commit sha1. New commits:

 ​8fd5628 `29543: add deprecation and reformat docstring`

### comment:5 Changed 17 months ago by gh-mwageringel

Thanks for the suggestions. I have implemented them accordingly. Indeed, it is good to keep backward compatibility when possible.

### comment:6 Changed 17 months ago by klee

• Reviewers changed from Travis Scrimshaw to Travis Scrimshaw, Kwankyu Lee
• Status changed from needs_review to positive_review

### comment:7 Changed 17 months ago by vbraun

• Branch changed from u/gh-mwageringel/29543 to 8fd56280a16c52638ae9a0e324162e4c6258acf4
• Resolution set to fixed
• Status changed from positive_review to closed

### comment:8 Changed 17 months ago by mkoeppe

• Milestone changed from sage-9.2 to sage-9.1
Note: See TracTickets for help on using tickets.