---
title: "Multiplicities"
canonical: "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/PolynomialRingIdealOperations/multiplicities.html"
source: "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/PolynomialRingIdealOperations/multiplicities.md"
part: "Commutative Algebra"
chapter: "Polynomial Ring Ideal Operations"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Commutative Algebra", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/index-commutative-algebra.md"}
  - {"title": "Polynomial Ring Ideal Operations", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/PolynomialRingIdealOperations/index-polynomial-ring-ideal-operations.md"}
prev: {"title": "Computation of Varieties", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/PolynomialRingIdealOperations/variety.md"}
next: {"title": "Elimination", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/PolynomialRingIdealOperations/elimination.md"}
intrinsics:
  - {"name": "MilnorNumber", "signature": "MilnorNumber(f): RngMPolElt -> RngElt"}
  - {"name": "TjurinaNumber", "signature": "TjurinaNumber(f): RngMPolElt -> RngElt"}
examples:
  - "ex-e4a04f"
---

# Multiplicities

This section contains some useful invariants for an isolated singularity at the origin of a hypersurface given by a multivariate polynomial $f$.

<a id="function-milnornumber-rngmpolelt"></a>
## `MilnorNumber(f): RngMPolElt -> RngElt`

Given a polynomial $f\in K[x_1, \ldots, x_n]$, where $K$ is a field, return the Milnor number of $f$ at the origin. This is the dimension of the quotient by the ideal generated by the partials of $f$ in the localization of $K[x_1, \ldots, x_n]$ at the origin. See [[CLO98](https://docs.magma-maths.org/v2.30-1/references.md#cite-uag-clo), p. 147] or [[DL06](https://docs.magma-maths.org/v2.30-1/references.md#cite-deckerlossen), Remark 9.37].

<a id="function-tjurinanumber-rngmpolelt"></a>
## `TjurinaNumber(f): RngMPolElt -> RngElt`

Given a polynomial $f\in K[x_1, \ldots, x_n]$, where $K$ is a field, return the Tjurina number of $f$ at the origin. This is the dimension of the quotient by the ideal generated by $f$ and the partials of $f$ in the localization of $K[x_1, \ldots, x_n]$ at the origin. See [[CLO98](https://docs.magma-maths.org/v2.30-1/references.md#cite-uag-clo), p. 148] or [[DL06](https://docs.magma-maths.org/v2.30-1/references.md#cite-deckerlossen), Def. 9.35].

<a id="example-ex-e4a04f"></a>
## `Example: Milnor and Tjurina Numbers (ex-e4a04f)`

We compute some Milnor and Tjurina numbers, based on Exercise 12 of [[CLO98](https://docs.magma-maths.org/v2.30-1/references.md#cite-uag-clo), p. 177].

```magma
> P<x,y> := PolynomialRing(RationalField(), 2);
> MilnorNumber((x^2 + y^2)^3 - 4*x^2*y^2); // 4-leaved rose
13
> [MilnorNumber(y^2 - x^n): n in [1 .. 5]];
[ 0, 1, 2, 3, 4 ]
> P<x,y,z> := PolynomialRing(RationalField(), 3);
> [MilnorNumber(x*y*z + x^n + y^n + z^n): n in [1 .. 10]];
[ 0, 1, 8, 11, 14, 17, 20, 23, 26, 29 ]
> [TjurinaNumber(x*y*z + x^n + y^n + z^n): n in [1 .. 10]];
[ 0, 1, 8, 10, 13, 16, 19, 22, 25, 28 ]
```

A much larger example is given in [[DL06](https://docs.magma-maths.org/v2.30-1/references.md#cite-deckerlossen), p. 254].

```magma
> P<x,y> := PolynomialRing(RationalField(), 2);
> f := y^2 - 2*x^28*y - 4*x^21*y^17 + 4*x^14*y^33 - 8*x^7*y^49 +
>      x^56 + 20*y^65 + 4*x^49*y^16;
> time TjurinaNumber(f);
2260
Time: 0.010
```
