The following sage code dies on me, after computing for quite some time: ┌────────────────────────────────────────────────────────────────────┐ │ Sage Version 6.1.1, Release Date: 2014-02-04 │ │ Type "notebook()" for the browser-based notebook interface. │ │ Type "help()" for help. │ └────────────────────────────────────────────────────────────────────┘ sage: PR.<b,t1,t2,x1,y1,x2,y2> = QQ[] sage: PR2.<mu> = PR[] sage: E1 = diagonal_matrix(PR, [1, b^2, -b^2]) sage: RotScale = matrix(PR, [[1, -t1, 0], [t1, 1, 0], [0, 0, 1]]) sage: E2 = diagonal_matrix(PR, [1, 1, 1+t1^2])*RotScale.transpose()*E1*RotScale sage: Transl = matrix(PR, [[1, 0, -x1], [0, 1, -y1], [0, 0, 1]]) sage: E3 = Transl.transpose()*E2*Transl sage: E4 = E3.subs(t1=t2, x1=x2, y1=y2) sage: Transl = matrix(PR, [[1, 0, 0], [0, 1, 1+b], [0, 0, 1]]) sage: E2 = Transl.transpose()*diagonal_matrix(PR, [b^2, 1, -b^2])*Transl sage: eqs = [det(mu*Ei + Ej).discriminant() for Ei, Ej in ....: [(E1, E3), (E1, E4), (E2, E3), (E3, E4)]] Segmentation fault
Attaching a debugger, I got thousands of stack frames from within the python interpreter: symtable_visit_expr from Python-2.7.6/Python/symtable.c:1191 seems to be calling itself till the call stack overflows. The above is from Sage on Gentoo, but the Sage 6.1.1 official release for Mac segfaults as well. I'm a bit surprised both at the segfault and at the fact that this takes so long. After all, I'm just computing the discriminant of a bunch of cubic polynomials. Wikipedia has a formula for this, and using that formula, things complete in no time at all. Should discriminants for polynomials of small degree be special-cased to avoid such issues? Or perhaps the discriminant should be computed first for a generic polynomial (i.e. one variable for every non-zero coefficient of the input), and the actual coefficients of the input substituted into that in a second step. I guess I'll be using that hardcoded formula for cubic discriminants for now, but it would be nice if such things could work out of the box. -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
