Ask Your Question

Revision history [back]

It seems that the classify function in Singular only prints the singularity type, but does not return it in any way (only the equation of the normal form is returned). So at least you can achieve the same in SageMath:

singular.lib('classify.lib')
r = singular.ring(0, '(x,y,z)', 'ds')
f = singular.new('x^2 + y^2 + z^3')
print(singular.eval('classify({})'.format(f.name())))

Output (just as in Singular):

About the singularity :
          Milnor number(f)   = 2
          Corank(f)          = 1
          Determinacy       <= 3
Guessing type via Milnorcode:  A[2]

Computing normal form ...
   Arnold step number 2
The singularity
   x2+y2+z3
is R-equivalent to A[2].
   Milnor number = 2
   modality      = 0
y^2+z^2+x^3

You could try extracting the type by parsing the string (yuck).