ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 13 Mar 2019 12:39:43 -0500multiplicity of a point in a schemehttp://ask.sagemath.org/question/45777/multiplicity-of-a-point-in-a-scheme/ The commands
`A1.<x>=AffineSpace(1, QQ)
X=A1.subscheme([x^1789+x])
Q=X([0])
Q.multiplicity() `
result in 1789.
There seems to be a bug in the multiplicity command for subschemes of the line.
Wed, 13 Mar 2019 11:13:41 -0500http://ask.sagemath.org/question/45777/multiplicity-of-a-point-in-a-scheme/Answer by rburing for <p>The commands
<code>A1.<x>=AffineSpace(1, QQ)
X=A1.subscheme([x^1789+x])
Q=X([0])
Q.multiplicity()</code>
result in 1789.
There seems to be a bug in the multiplicity command for subschemes of the line.</p>
http://ask.sagemath.org/question/45777/multiplicity-of-a-point-in-a-scheme/?answer=45779#post-id-45779Yes, this is a bug. Typing `Q.multiplicity??` we see that it calls `X.multiplicity(Q)` and `X.multiplicity??` shows that it changes the monomial ordering to `negdegrevlex` and then tries to use the interface to Singular. However the interface to Singular is broken for *univariate* polynomial rings with "local" monomial ordering (it always uses the global ordering instead); I reported this as [trac ticket #27479](https://trac.sagemath.org/ticket/27479).
As a temporary workaround I guess you can add a variable and set it to zero:
sage: A2.<x,y> = AffineSpace(QQ,2)
sage: X = A2.subscheme([x^1789+x,y])
sage: Q = X([0,0])
sage: Q.multiplicity()
1Wed, 13 Mar 2019 12:39:43 -0500http://ask.sagemath.org/question/45777/multiplicity-of-a-point-in-a-scheme/?answer=45779#post-id-45779