Hi, I encounterd a memory problem. The file can be found on http://www.sagenb.org/home/rolandb/3/ ( http://:8888/home/pub/1204 ), and is also listed below.
I use version 4.1, Windows. Although it seems a simple set of lines, after two/three minutes my hard disk starts to make a lot of noise and often I have to reboot the whole computer. Why? sage: R.<A,B,C>=QQ[] sage: slimme_formule=[(A^5, 5*A^4*B + 10*A^3*B^2 + 10*A^2*B^3 + 5*A*B^4 + B^5, C^5), (A^5, sage: B^5, A^4*C - A^3*B*C + A^2*B^2*C - A*B^3*C + B^4*C), (A^4 + 6*A^3*B + sage: 12*A^2*B^2 + 8*A*B^3, 2*A*B^3 + 3*B^4, A*C^3 + 3*B*C^3), (-A^4 + sage: 2*A^2*C^2, 4*A^2*B^2 + 4*A*B^3 + B^4, C^4), (A^4 + 4*A^3*B + 6*A^2*B^2, sage: 4*A*B^3 + B^4, C^4), (A^4, 4*A*B^3 + 3*B^4, A^2*C^2 - 2*A*B*C^2 + sage: 3*B^2*C^2), (A^4, A^3*C - A^2*B*C + A*B^2*C - B^3*C, B^4), (A^4, 2*A^3*B sage: + A^2*B^2 + 2*A*B*C^2 + B^2*C^2, C^4), (A^4, 2*A^2*C^2 - C^4, 4*A^2*B^2 sage: + 4*A*B^3 + B^4), (-A^4 + 2*A^3*B, 2*A*B^3 - B^4, A^3*C - 3*A^2*B*C + sage: 3*A*B^2*C - B^3*C), (A^2*B^2 + 2*A*B^3 + A^2*C^2 + 2*A*B*C^2, B^4, C^4), sage: (A^4 + 4*A^3*B + 4*A^2*B^2, -2*B^2*C^2 + C^4, B^4), (A^3, 9*A^2*B + sage: 6*A*B^2 + B^3, 4*A*C^2 + B*C^2), (A^3 + 3*A^2*B + 3*A*B^2, B^3, C^3), sage: (A^3, A*C^2 - 2*B*C^2, 3*A*B^2 + 2*B^3), (A^3, 3*A^2*B + 3*A*B^2 + B^3, sage: C^3), (A^3, B^3, A^2*C - A*B*C + B^2*C), (A^3 + 6*A^2*B + 9*A*B^2, B^3, sage: A*C^2 + 4*B*C^2), (A^3 + 3*A^2*B, 3*A*B^2 + B^3, C^3), (2*A^3 + 3*A^2*B, sage: 2*A*C^2 - B*C^2, B^3), (A^2, 2*A*B + B^2, C^2), (A^2, A*C - B*C, B^2), sage: (A^2 + 2*A*B, B^2, C^2)] sage: R.<A,B,C>=QQ[] sage: def minimaal(expr): ... uit=1 ... for w in (expr.subs(C=A+B)).factor(): ... mogelijk=[w[0],w[0].subs(A=C-B),w[0].subs(B=C-A)] ... keuze=map(lambda x: len(x.dict()),mogelijk) ... uit=uit*mogelijk[keuze.index(min(keuze))]^w[1] ... return uit ... sage: minimaal((A+B)^6*(2*A+B)^2*A^3*B^4).factor() (2*A + B)^2 * A^3 * B^4 * C^6 sage: def vulin(exp1,exp2): ... R.<D,E,F>=QQ[] ... return tuple(map(lambda x: minimaal(x.subs(A=D,B=E,C=F).subs (D=exp2[0],E=exp2[1],F=exp2[2])),exp1)) ... sage: R.<A,B,C>=QQ[] sage: exp1=(A^2, -A*C + B*C, B^2) sage: exp2=(A*B + A*C, B^2, C^2) sage: vulin(exp1,exp2) (A^4 + 4*A^3*B + 4*A^2*B^2, -2*B^2*C^2 + C^4, B^4) sage: def succes(ABC_trio): ... slim=False ... faktoren=list(prod(ABC_trio).subs(C=A+B).factor()) ... tel_fact=sum([w[1] for w in faktoren if w[0] not in [A,B,A +B]])-1 ... if tel_fact==-1: tel_fact=1 ... tel_ABC=sum([w[1] for w in faktoren if w[0] in [A,B,A+B]]) ... test=tel_fact+2*tel_ABC-(7/2)*(max(map(lambda x:x.degree (),ABC_trio))-1) ... if test>6: slim=True ... return slim ... ... sage: print succes((A^4, A^3*B + 2*A^3*C + 3*B^3*C + 3*A*B*C^2 - 2*A*C^3, 3*A*B^3 + 3*B^4 - 3*A^2*B*C - B*C^3 + C^4)) sage: print succes((A,B,C)) True True sage: R.<A,B,C>=QQ[] sage: aantal=23 sage: groot_slim=[] sage: for exp1 in slimme_formule[:aantal]: ... for exp2 in slimme_formule[:aantal]: ... exp12=vulin(exp1,exp2) ... for exp3 in slimme_formule[:aantal]: ... nwerelatie=vulin(exp12,exp3) ... if succes(nwerelatie): ... gevonden=tuple(map(lambda x: slimme_formule.index (x),[exp1,exp2,exp3])) ... print gevonden, ... groot_slim.append(gevonden) -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org