Hi,

On Fri, Apr 16, 2010 at 10:16:58AM -0400, Ben Goodrich wrote:
> Hi again,
> 
> Things are a bit better now, but I still can't get as far as I'd like with
> the polys8 branch (as of a few days ago). I didn't rigorously benchmark the
> attached, but just a rough impression from looking at top implies that
> 
> thing = first * second - third.sqr()
> 
> where first, second, and third are of class Poly with many terms takes about
> 15 minutes and 1.3 GB of RAM on my office machine. But using the Poly class
> is  much better than using basic SymPy like Ondrej suggested upthread.
> 
> In comparison, the equivalent thing in Sage
> 
> thing = expand(first * second - third^2)
> 
> takes about 10 minutes and 0.25 GB of RAM on the same machine (using basic
> Sage variables rather than their multivariate polynomial ring class). That
> much of a difference I don't really understand because in both cases this is
> really just addition, subtraction, and multiplication of Python symbols.
> 
> However, in Mathematica
> 
> thing = Expand[first * second - third^2]
> 
> takes only a few seconds and very little RAM. That is on a different
> machine, so it is not an apples to apples comparison, but it is still a big
> difference.
> 

SymPy can compute things like F*G - H**2 fast, unfortunately not on the
user level. Below you will find a short tutorial how to do it fast but
messy way.

Lets assume you have polynomial-like expressions F, G, H. For my own
convenience, when experimenting, I made my self a function fun() which
returns those expressions:

In [1]: %time F, G, H, gens = fun()
CPU times: user 12.03 s, sys: 0.00 s, total: 12.03 s
Wall time: 12.46 s

So, numer = F*G - H**2. From monomialtools we import a function which
will be used for sorting terms in polynomials, in this case lex order.
From groebnertools we import functions for converting polynomial reprs
and for doing arithmetics:

In [3]: from sympy.polys.monomialtools import monomial_lex_key as O_lex

In [4]: from sympy.polys.groebnertools import *

Now create sparse distributed polynomials from expressions F, G and H:

In [5]: FF = sdp_from_dict(Poly(F, *gens, expand=False).as_dict(), O_lex)

In [6]: GG = sdp_from_dict(Poly(G, *gens, expand=False).as_dict(), O_lex)

In [7]: HH = sdp_from_dict(Poly(H, *gens, expand=False).as_dict(), O_lex)

In [8]: u = len(gens) - 1

Assuming that F, G and H have integer coefficients then FF, GG and HH use
ZZ domain of computation. If this is not true then use QQ for rationals.

In polys8 ZZ and QQ by default use Python's ground types, int and Fraction
(>= Python 2.6, or Rational otherwise). In polys9 the defaults are mpz and
mpq from gmpy library. Here I will use polys9 and all its the defaults to
do arithmetics:

In [9]: %time FGH = sdp_sub(sdp_mul(FF, GG, u, O_lex, ZZ), sdp_sqr(HH, u, 
O_lex, ZZ), u, O_lex, ZZ)
CPU times: user 18.61 s, sys: 0.09 s, total: 18.70 s
Wall time: 19.75 s

(computation done on 1.7 GHz Centrino laptop).

Finally, you can create an expression out of SDP polynomial representation:

In [10]: %time fgh = basic_from_dict(dict(FGH), *gens)
CPU times: user 169.33 s, sys: 0.29 s, total: 169.62 s
Wall time: 178.59 s

The same can be done with Python's int ground type instead of mpz, just
run SymPy as follows, SYMPY_GROUND_TYPES=python bin/isympy (or if you
use polys8, SYMPY_GROUND_TYPES=gmpy bin/isympy, to use gmpy). In the
integers case, difference between int and mpz is usually small. In
the rational case the difference is much more visible.

> Is anyone able to reproduce these resource intensities and / or tell me if
> there is anything I can do to mitigate them?
> 
> Thanks,
> Ben
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> To post to this group, send email to sy...@googlegroups.com.
> To unsubscribe from this group, send email to 
> sympy+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/sympy?hl=en.
> 

> 
> a,b,c,d,e,f,g,h,i,j,k,l,k,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A = 
> symbols('abcdefghijklkmnopqrstuvwxyzA')
> 
> first = Poly(-2*a*b*h*k*p*r - 2*a*b*h*m*o*r - 2*a*b*i*l*p*r - 2*a*b*i*m*o*p - 
> 2*a*b*j*k*o*p - 2*a*b*j*l*o*r - 2*a*c*g*k*p*r - 2*a*c*g*m*o*r - 2*a*c*i*k*m*p 
> - 2*a*c*i*l*m*r - 2*a*c*j*k*l*r - 2*a*c*j*k*m*o - 2*a*d*g*l*p*r - 
> 2*a*d*g*m*o*p - 2*a*d*h*k*m*p - 2*a*d*h*l*m*r - 2*a*d*j*k*l*p - 2*a*d*j*l*m*o 
> - 2*a*e*g*k*o*p - 2*a*e*g*l*o*r - 2*a*e*h*k*l*r - 2*a*e*h*k*m*o - 
> 2*a*e*i*k*l*p - 2*a*e*i*l*m*o - 2*b*c*g*i*p*r - 2*b*c*g*j*o*r - 2*b*c*h*i*m*r 
> - 2*b*c*h*j*k*r - 2*b*c*i*j*k*p - 2*b*c*i*j*m*o - 2*b*d*g*h*p*r - 
> 2*b*d*g*j*o*p - 2*b*d*h*i*m*p - 2*b*d*h*j*l*r - 2*b*d*h*j*m*o - 2*b*d*i*j*l*p 
> - 2*b*e*g*h*o*r - 2*b*e*g*i*o*p - 2*b*e*h*i*k*p - 2*b*e*h*i*l*r - 
> 2*b*e*h*j*k*o - 2*b*e*i*j*l*o - 2*c*d*g*h*m*r - 2*c*d*g*i*m*p - 2*c*d*g*j*k*p 
> - 2*c*d*g*j*l*r - 2*c*d*h*j*k*m - 2*c*d*i*j*l*m - 2*c*e*g*h*k*r - 
> 2*c*e*g*i*l*r - 2*c*e*g*i*m*o - 2*c*e*g*j*k*o - 2*c*e*h*i*k*m - 2*c*e*i*j*k*l 
> - 2*d*e*g*h*k*p - 2*d*e*g*h*m*o - 2*d*e*g*i*l*p - 2*d*e*g*j*l*o - 
> 2*d*e*h*i*l*m - 2*d*e*h*j*k*l + 4*a*b*g*o*p*r + 4*a*c*h*k*m*r + 4*a*d*i*l*m*p 
> + 4*a*e*j*k*l*o + 4*b*c*i*j*l*r + 4*b*d*h*j*k*p + 4*b*e*h*i*m*o + 
> 4*c*d*g*j*m*o + 4*c*e*g*i*k*p + 4*d*e*g*h*l*r - a**2*k**2*p**2 - 
> a**2*l**2*r**2 - a**2*m**2*o**2 - b**2*h**2*r**2 - b**2*i**2*p**2 - 
> b**2*j**2*o**2 - c**2*g**2*r**2 - c**2*i**2*m**2 - c**2*j**2*k**2 - 
> d**2*g**2*p**2 - d**2*h**2*m**2 - d**2*j**2*l**2 - e**2*g**2*o**2 - 
> e**2*h**2*k**2 - e**2*i**2*l**2 + a**2*k**2*x**2*z**2 + a**2*l**2*y**2*z**2 + 
> a**2*m**2*x**2*y**2 + a**2*o**2*w**2*z**2 + a**2*p**2*w**2*y**2 + 
> a**2*r**2*w**2*x**2 + b**2*h**2*y**2*z**2 + b**2*i**2*x**2*z**2 + 
> b**2*j**2*x**2*y**2 + b**2*o**2*v**2*z**2 + b**2*p**2*v**2*y**2 + 
> b**2*r**2*v**2*x**2 + c**2*g**2*y**2*z**2 + c**2*i**2*w**2*z**2 + 
> c**2*j**2*w**2*y**2 + c**2*k**2*v**2*z**2 + c**2*m**2*v**2*y**2 + 
> c**2*r**2*v**2*w**2 + d**2*g**2*x**2*z**2 + d**2*h**2*w**2*z**2 + 
> d**2*j**2*w**2*x**2 + d**2*l**2*v**2*z**2 + d**2*m**2*v**2*x**2 + 
> d**2*p**2*v**2*w**2 + e**2*g**2*x**2*y**2 + e**2*h**2*w**2*y**2 + 
> e**2*i**2*w**2*x**2 + e**2*k**2*v**2*x**2 + e**2*l**2*v**2*y**2 + 
> e**2*o**2*v**2*w**2 + g**2*o**2*u**2*z**2 + g**2*p**2*u**2*y**2 + 
> g**2*r**2*u**2*x**2 + h**2*k**2*u**2*z**2 + h**2*m**2*u**2*y**2 + 
> h**2*r**2*u**2*w**2 + i**2*l**2*u**2*z**2 + i**2*m**2*u**2*x**2 + 
> i**2*p**2*u**2*w**2 + j**2*k**2*u**2*x**2 + j**2*l**2*u**2*y**2 + 
> j**2*o**2*u**2*w**2 + k**2*p**2*u**2*v**2 + l**2*r**2*u**2*v**2 + 
> m**2*o**2*u**2*v**2 - a**2*w**2*x**2*y**2*z**2 - b**2*v**2*x**2*y**2*z**2 - 
> c**2*v**2*w**2*y**2*z**2 - d**2*v**2*w**2*x**2*z**2 - 
> e**2*v**2*w**2*x**2*y**2 - g**2*u**2*x**2*y**2*z**2 - 
> h**2*u**2*w**2*y**2*z**2 - i**2*u**2*w**2*x**2*z**2 - 
> j**2*u**2*w**2*x**2*y**2 - k**2*u**2*v**2*x**2*z**2 - 
> l**2*u**2*v**2*y**2*z**2 - m**2*u**2*v**2*x**2*y**2 - 
> o**2*u**2*v**2*w**2*z**2 - p**2*u**2*v**2*w**2*y**2 - 
> r**2*u**2*v**2*w**2*x**2 - 2*a*b*g*o**2*z**2 - 2*a*b*g*p**2*y**2 - 
> 2*a*b*g*r**2*x**2 - 2*a*c*h*k**2*z**2 - 2*a*c*h*m**2*y**2 - 2*a*c*h*r**2*w**2 
> - 2*a*d*i*l**2*z**2 - 2*a*d*i*m**2*x**2 - 2*a*d*i*p**2*w**2 - 
> 2*a*e*j*k**2*x**2 - 2*a*e*j*l**2*y**2 - 2*a*e*j*o**2*w**2 - 2*b*c*l*i**2*z**2 
> - 2*b*c*l*j**2*y**2 - 2*b*c*l*r**2*v**2 - 2*b*d*k*h**2*z**2 - 
> 2*b*d*k*j**2*x**2 - 2*b*d*k*p**2*v**2 - 2*b*e*m*h**2*y**2 - 2*b*e*m*i**2*x**2 
> - 2*b*e*m*o**2*v**2 - 2*c*d*o*g**2*z**2 - 2*c*d*o*j**2*w**2 - 
> 2*c*d*o*m**2*v**2 - 2*c*e*p*g**2*y**2 - 2*c*e*p*i**2*w**2 - 2*c*e*p*k**2*v**2 
> - 2*d*e*r*g**2*x**2 - 2*d*e*r*h**2*w**2 - 2*d*e*r*l**2*v**2 - 
> 2*g*h*l*d**2*z**2 - 2*g*h*l*e**2*y**2 - 2*g*h*l*r**2*u**2 - 2*g*i*k*c**2*z**2 
> - 2*g*i*k*e**2*x**2 - 2*g*i*k*p**2*u**2 - 2*g*j*m*c**2*y**2 - 
> 2*g*j*m*d**2*x**2 - 2*g*j*m*o**2*u**2 - 2*h*i*o*b**2*z**2 - 2*h*i*o*e**2*w**2 
> - 2*h*i*o*m**2*u**2 - 2*h*j*p*b**2*y**2 - 2*h*j*p*d**2*w**2 - 
> 2*h*j*p*k**2*u**2 - 2*i*j*r*b**2*x**2 - 2*i*j*r*c**2*w**2 - 2*i*j*r*l**2*u**2 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i*l*n*o - 2*b*c*g*i*q*s - 2*b*c*g*k*o*s 
> - 2*b*c*h*i*n*s - 2*b*c*i*k*n*o - 2*b*d*g*h*q*s - 2*b*d*g*k*o*q - 
> 2*b*d*h*i*n*q - 2*b*d*h*k*l*s - 2*b*d*h*k*n*o - 2*b*d*i*k*l*q - 2*b*f*g*h*o*s 
> - 2*b*f*g*i*o*q - 2*b*f*h*i*k*q - 2*b*f*h*i*l*s - 2*b*f*i*k*l*o - 
> 2*c*d*g*h*n*s - 2*c*d*g*i*n*q - 2*c*d*g*k*l*s - 2*c*d*i*k*l*n - 2*c*f*g*h*k*s 
> - 2*c*f*g*i*l*s - 2*c*f*g*i*n*o - 2*c*f*h*i*k*n - 2*d*f*g*h*k*q - 
> 2*d*f*g*h*n*o - 2*d*f*g*i*l*q - 2*d*f*g*k*l*o - 2*d*f*h*i*l*n + 4*a*b*g*o*q*s 
> + 4*a*c*h*k*n*s + 4*a*d*i*l*n*q + 4*b*c*i*k*l*s + 4*b*f*h*i*n*o + 
> 4*c*d*g*k*n*o + 4*c*f*g*i*k*q + 4*d*f*g*h*l*s + k**4*u**2*x**2 - 
> a**2*k**2*q**2 - a**2*l**2*s**2 - a**2*n**2*o**2 - b**2*h**2*s**2 - 
> b**2*i**2*q**2 - b**2*k**2*o**2 - c**2*g**2*s**2 - c**2*i**2*n**2 - 
> d**2*g**2*q**2 - d**2*h**2*n**2 - d**2*k**2*l**2 - f**2*g**2*o**2 - 
> f**2*h**2*k**2 - f**2*i**2*l**2 + A**2*a**2*k**2*x**2 + A**2*a**2*l**2*y**2 + 
> A**2*a**2*o**2*w**2 + A**2*b**2*h**2*y**2 + A**2*b**2*i**2*x**2 + 
> A**2*b**2*o**2*v**2 + A**2*c**2*g**2*y**2 + A**2*c**2*i**2*w**2 + 
> A**2*c**2*k**2*v**2 + A**2*d**2*g**2*x**2 + A**2*d**2*h**2*w**2 + 
> A**2*d**2*l**2*v**2 + A**2*g**2*o**2*u**2 + A**2*h**2*k**2*u**2 + 
> A**2*i**2*l**2*u**2 + a**2*n**2*x**2*y**2 + a**2*q**2*w**2*y**2 + 
> a**2*s**2*w**2*x**2 + b**2*k**2*x**2*y**2 + b**2*q**2*v**2*y**2 + 
> b**2*s**2*v**2*x**2 + c**2*k**2*w**2*y**2 + c**2*n**2*v**2*y**2 + 
> c**2*s**2*v**2*w**2 + d**2*k**2*w**2*x**2 + d**2*n**2*v**2*x**2 + 
> d**2*q**2*v**2*w**2 + f**2*g**2*x**2*y**2 + f**2*h**2*w**2*y**2 + 
> f**2*i**2*w**2*x**2 + f**2*k**2*v**2*x**2 + f**2*l**2*v**2*y**2 + 
> f**2*o**2*v**2*w**2 + g**2*q**2*u**2*y**2 + g**2*s**2*u**2*x**2 + 
> h**2*n**2*u**2*y**2 + h**2*s**2*u**2*w**2 + i**2*n**2*u**2*x**2 + 
> i**2*q**2*u**2*w**2 + k**2*l**2*u**2*y**2 + k**2*o**2*u**2*w**2 + 
> k**2*q**2*u**2*v**2 + l**2*s**2*u**2*v**2 + n**2*o**2*u**2*v**2 - 
> 2*a*f*k**3*x**2 - 2*b*d*k**3*x**2 - 2*h*q*k**3*u**2 - 2*l*o*k**3*u**2 + 
> 2*g*s*c**2*k**2 + 2*i*n*c**2*k**2 - A**2*a**2*w**2*x**2*y**2 - 
> A**2*b**2*v**2*x**2*y**2 - A**2*c**2*v**2*w**2*y**2 - 
> A**2*d**2*v**2*w**2*x**2 - A**2*g**2*u**2*x**2*y**2 - 
> A**2*h**2*u**2*w**2*y**2 - A**2*i**2*u**2*w**2*x**2 - 
> A**2*k**2*u**2*v**2*x**2 - A**2*l**2*u**2*v**2*y**2 - 
> A**2*o**2*u**2*v**2*w**2 - f**2*v**2*w**2*x**2*y**2 - 
> k**2*u**2*w**2*x**2*y**2 - n**2*u**2*v**2*x**2*y**2 - 
> q**2*u**2*v**2*w**2*y**2 - s**2*u**2*v**2*w**2*x**2 - 2*a*b*g*A**2*o**2 - 
> 2*a*b*g*q**2*y**2 - 2*a*b*g*s**2*x**2 - 2*a*b*o*q*k**2 - 2*a*c*h*A**2*k**2 - 
> 2*a*c*h*n**2*y**2 - 2*a*c*h*s**2*w**2 - 2*a*c*l*s*k**2 - 2*a*c*n*o*k**2 - 
> 2*a*d*i*A**2*l**2 - 2*a*d*i*n**2*x**2 - 2*a*d*i*q**2*w**2 - 2*a*d*l*q*k**2 - 
> 2*a*f*k*l**2*y**2 - 2*a*f*k*o**2*w**2 - 2*b*c*h*s*k**2 - 2*b*c*i*q*k**2 - 
> 2*b*c*l*A**2*i**2 - 2*b*c*l*k**2*y**2 - 2*b*c*l*s**2*v**2 - 2*b*d*k*A**2*h**2 
> - 2*b*d*k*q**2*v**2 - 2*b*f*h*o*k**2 - 2*b*f*n*h**2*y**2 - 2*b*f*n*i**2*x**2 
> - 2*b*f*n*o**2*v**2 - 2*c*d*g*q*k**2 - 2*c*d*h*n*k**2 - 2*c*d*o*A**2*g**2 - 
> 2*c*d*o*k**2*w**2 - 2*c*d*o*n**2*v**2 - 2*c*f*g*o*k**2 - 2*c*f*i*l*k**2 - 
> 2*c*f*q*g**2*y**2 - 2*c*f*q*i**2*w**2 - 2*c*f*q*k**2*v**2 - 2*d*f*h*l*k**2 - 
> 2*d*f*s*g**2*x**2 - 2*d*f*s*h**2*w**2 - 2*d*f*s*l**2*v**2 - 2*g*h*l*A**2*d**2 
> - 2*g*h*l*f**2*y**2 - 2*g*h*l*s**2*u**2 - 2*g*i*k*A**2*c**2 - 
> 2*g*i*k*f**2*x**2 - 2*g*i*k*q**2*u**2 - 2*g*k*n*c**2*y**2 - 2*g*k*n*d**2*x**2 
> - 2*g*k*n*o**2*u**2 - 2*g*s*k**2*u**2*x**2 - 2*h*i*o*A**2*b**2 - 
> 2*h*i*o*f**2*w**2 - 2*h*i*o*n**2*u**2 - 2*h*k*q*b**2*y**2 - 2*h*k*q*d**2*w**2 
> - 2*i*k*s*b**2*x**2 - 2*i*k*s*c**2*w**2 - 2*i*k*s*l**2*u**2 - 
>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h*i*s*w**2 + 2*c*f*i*k*o*w**2 + 2*c*f*k*l*s*v**2 + 
> 2*c*f*k*n*o*v**2 + 2*c*f*q*v**2*w**2*y**2 + 2*d*f*g*i*n*x**2 + 
> 2*d*f*h*i*q*w**2 + 2*d*f*h*k*o*w**2 + 2*d*f*k*l*q*v**2 + 2*d*f*l*n*o*v**2 + 
> 2*d*f*s*v**2*w**2*x**2 + 2*g*h*k*q*s*u**2 + 2*g*h*l*A**2*u**2*y**2 + 
> 2*g*h*n*o*s*u**2 + 2*g*i*k*A**2*u**2*x**2 + 2*g*i*l*q*s*u**2 + 
> 2*g*i*n*o*q*u**2 + 2*g*k*l*o*s*u**2 + 2*g*k*n*u**2*x**2*y**2 + 
> 2*h*i*k*n*q*u**2 + 2*h*i*l*n*s*u**2 + 2*h*i*o*A**2*u**2*w**2 + 
> 2*h*k*q*u**2*w**2*y**2 + 2*i*k*l*n*o*u**2 + 2*i*k*s*u**2*w**2*x**2 + 
> 2*k*l*o*A**2*u**2*v**2 + 2*k*n*s*u**2*v**2*x**2 + 2*l*n*q*u**2*v**2*y**2 + 
> 2*o*q*s*u**2*v**2*w**2 + 2*a*c*q*k**3 + 2*b*c*o*k**3 + 2*c*d*l*k**3 + 
> 2*c*f*h*k**3 - c**2*k**4, domain = 'QQ')
> 
> third = Poly(-a*b*h*k*p*s - a*b*h*k*q*r - a*b*h*m*o*s - a*b*h*n*o*r - 
> a*b*i*l*p*s - a*b*i*l*q*r - a*b*i*m*o*q - a*b*i*n*o*p - a*b*j*k*o*q - 
> a*b*j*l*o*s - a*b*k*l*o*r - a*c*g*k*p*s - a*c*g*k*q*r - a*c*g*m*o*s - 
> a*c*g*n*o*r - a*c*i*k*m*q - a*c*i*k*n*p - a*c*i*l*m*s - a*c*i*l*n*r - 
> a*c*j*k*l*s - a*c*j*k*n*o - a*d*g*l*p*s - a*d*g*l*q*r - a*d*g*m*o*q - 
> a*d*g*n*o*p - a*d*h*k*m*q - a*d*h*k*n*p - a*d*h*l*m*s - a*d*h*l*n*r - 
> a*d*j*k*l*q - a*d*j*l*n*o - a*d*k*l*m*o - a*e*g*k*o*q - a*e*g*l*o*s - 
> a*e*h*k*l*s - a*e*h*k*n*o - a*e*i*k*l*q - a*e*i*l*n*o - a*f*g*k*o*p - 
> a*f*g*l*o*r - a*f*h*k*l*r - a*f*h*k*m*o - a*f*i*k*l*p - a*f*i*l*m*o - 
> b*c*g*i*p*s - b*c*g*i*q*r - b*c*g*j*o*s - b*c*g*k*o*r - b*c*h*i*m*s - 
> b*c*h*i*n*r - b*c*h*j*k*s - b*c*i*j*k*q - b*c*i*j*n*o - b*c*i*k*m*o - 
> b*d*g*h*p*s - b*d*g*h*q*r - b*d*g*j*o*q - b*d*g*k*o*p - b*d*h*i*m*q - 
> b*d*h*i*n*p - b*d*h*j*l*s - b*d*h*j*n*o - b*d*h*k*l*r - b*d*h*k*m*o - 
> b*d*i*j*l*q - b*d*i*k*l*p - b*e*g*h*o*s - b*e*g*i*o*q - b*e*h*i*k*q - 
> b*e*h*i*l*s - b*e*i*k*l*o - b*f*g*h*o*r - b*f*g*i*o*p - b*f*h*i*k*p - 
> b*f*h*i*l*r - b*f*h*j*k*o - b*f*i*j*l*o - c*d*g*h*m*s - c*d*g*h*n*r - 
> c*d*g*i*m*q - c*d*g*i*n*p - c*d*g*j*k*q - c*d*g*j*l*s - c*d*g*k*l*r - 
> c*d*h*j*k*n - c*d*i*j*l*n - c*d*i*k*l*m - c*e*g*h*k*s - c*e*g*i*l*s - 
> c*e*g*i*n*o - c*e*h*i*k*n - c*f*g*h*k*r - c*f*g*i*l*r - c*f*g*i*m*o - 
> c*f*g*j*k*o - c*f*h*i*k*m - c*f*i*j*k*l - d*e*g*h*k*q - d*e*g*h*n*o - 
> d*e*g*i*l*q - d*e*g*k*l*o - d*e*h*i*l*n - d*f*g*h*k*p - d*f*g*h*m*o - 
> d*f*g*i*l*p - d*f*g*j*l*o - d*f*h*i*l*m - d*f*h*j*k*l + 2*a*b*g*o*p*s + 
> 2*a*b*g*o*q*r + 2*a*b*h*k*o*t + 2*a*b*h*l*r*s + 2*a*b*i*k*p*q + 2*a*b*i*l*o*t 
> + 2*a*c*g*k*o*t + 2*a*c*g*l*r*s + 2*a*c*h*k*m*s + 2*a*c*h*k*n*r + 
> 2*a*c*i*k*l*t + 2*a*c*i*m*n*o + 2*a*d*g*k*p*q + 2*a*d*g*l*o*t + 2*a*d*h*k*l*t 
> + 2*a*d*h*m*n*o + 2*a*d*i*l*m*q + 2*a*d*i*l*n*p + 2*a*f*j*k*l*o + 
> 2*b*c*g*h*r*s + 2*b*c*g*i*o*t + 2*b*c*h*i*k*t + 2*b*c*i*j*l*s + 2*b*c*i*k*l*r 
> + 2*b*d*g*h*o*t + 2*b*d*g*i*p*q + 2*b*d*h*i*l*t + 2*b*d*h*j*k*q + 
> 2*b*d*j*k*l*o + 2*b*e*h*i*n*o + 2*b*f*h*i*m*o + 2*c*d*g*h*k*t + 2*c*d*g*i*l*t 
> + 2*c*d*g*j*n*o + 2*c*d*g*k*m*o + 2*c*d*h*i*m*n + 2*c*e*g*i*k*q + 
> 2*c*f*g*i*k*p + 2*d*e*g*h*l*s + 2*d*f*g*h*l*r + 2*e*f*g*h*k*o + 2*e*f*g*i*l*o 
> + 2*e*f*h*i*k*l + g*r*c**2*k**2 + i*m*c**2*k**2 + j*k**3*u**2*x**2 + 
> t*a**2*k**2*x**2 + t*a**2*l**2*y**2 + t*a**2*o**2*w**2 + t*b**2*h**2*y**2 + 
> t*b**2*i**2*x**2 + t*b**2*o**2*v**2 + t*c**2*g**2*y**2 + t*c**2*i**2*w**2 + 
> t*c**2*k**2*v**2 + t*d**2*g**2*x**2 + t*d**2*h**2*w**2 + t*d**2*l**2*v**2 + 
> t*g**2*o**2*u**2 + t*h**2*k**2*u**2 + t*i**2*l**2*u**2 - a*e*k**3*x**2 - 
> e*f*g**2*o**2 - e*f*h**2*k**2 - e*f*i**2*l**2 - h*p*k**3*u**2 - j*k*b**2*o**2 
> - j*k*d**2*l**2 - m*n*a**2*o**2 - m*n*c**2*i**2 - m*n*d**2*h**2 - 
> p*q*a**2*k**2 - p*q*b**2*i**2 - p*q*d**2*g**2 - r*s*a**2*l**2 - r*s*b**2*h**2 
> - r*s*c**2*g**2 + a*b*j*n*o**2 + a*b*k*m*o**2 + a*b*r*k**2*x**2 + 
> a*c*j*q*k**2 + a*d*j*s*l**2 + a*d*k*r*l**2 + a*d*m*k**2*x**2 + a*e*g*n*o**2 + 
> a*e*h*q*k**2 + a*e*i*s*l**2 + a*f*g*m*o**2 + a*f*h*p*k**2 + a*f*i*r*l**2 + 
> b*c*m*q*i**2 + b*c*n*p*i**2 + b*d*m*s*h**2 + b*d*n*r*h**2 + b*e*g*k*o**2 + 
> b*e*i*k**2*x**2 + b*e*k*s*h**2 + b*e*l*q*i**2 + b*f*g*j*o**2 + b*f*k*r*h**2 + 
> b*f*l*p*i**2 + c*d*p*s*g**2 + c*d*q*r*g**2 + c*e*l*n*i**2 + c*e*o*s*g**2 + 
> c*f*h*j*k**2 + c*f*l*m*i**2 + c*f*o*r*g**2 + d*e*g*k**2*x**2 + d*e*i*k*l**2 + 
> d*e*k*n*h**2 + d*e*o*q*g**2 + d*f*i*j*l**2 + d*f*k*m*h**2 + d*f*o*p*g**2 + 
> e*f*g**2*x**2*y**2 + e*f*h**2*w**2*y**2 + e*f*i**2*w**2*x**2 + 
> e*f*k**2*v**2*x**2 + e*f*l**2*v**2*y**2 + e*f*o**2*v**2*w**2 + g*h*m*q*d**2 + 
> g*h*n*p*d**2 + g*i*m*s*c**2 + g*i*n*r*c**2 + g*j*k*s*c**2 + g*j*l*q*d**2 + 
> g*k*l*p*d**2 + g*o*p*k**2*u**2 + h*i*p*s*b**2 + h*i*q*r*b**2 + h*j*l*n*d**2 + 
> h*j*o*s*b**2 + h*k*l*m*d**2 + h*k*o*r*b**2 + h*l*r*k**2*u**2 + 
> h*m*o*k**2*u**2 + i*j*k*n*c**2 + i*j*o*q*b**2 + i*k*o*p*b**2 + 
> i*l*p*k**2*u**2 + j*k*b**2*x**2*y**2 + j*k*c**2*w**2*y**2 + 
> j*k*d**2*w**2*x**2 + j*k*l**2*u**2*y**2 + j*k*o**2*u**2*w**2 + k*l*p*s*a**2 + 
> k*l*q*r*a**2 + k*m*o*q*a**2 + k*n*o*p*a**2 + l*m*o*s*a**2 + l*n*o*r*a**2 + 
> m*n*a**2*x**2*y**2 + m*n*c**2*v**2*y**2 + m*n*d**2*v**2*x**2 + 
> m*n*h**2*u**2*y**2 + m*n*i**2*u**2*x**2 + m*n*o**2*u**2*v**2 + 
> p*q*a**2*w**2*y**2 + p*q*b**2*v**2*y**2 + p*q*d**2*v**2*w**2 + 
> p*q*g**2*u**2*y**2 + p*q*i**2*u**2*w**2 + p*q*k**2*u**2*v**2 + 
> r*s*a**2*w**2*x**2 + r*s*b**2*v**2*x**2 + r*s*c**2*v**2*w**2 + 
> r*s*g**2*u**2*x**2 + r*s*h**2*u**2*w**2 + r*s*l**2*u**2*v**2 - a*b*o*p*k**2 - 
> a*c*l*r*k**2 - a*c*m*o*k**2 - a*d*l*p*k**2 - a*e*k*l**2*y**2 - 
> a*e*k*o**2*w**2 - a*f*j*k**2*x**2 - a*f*j*l**2*y**2 - a*f*j*o**2*w**2 - 
> b*c*h*r*k**2 - b*c*i*p*k**2 - b*e*h*o*k**2 - b*e*n*h**2*y**2 - 
> b*e*n*i**2*x**2 - b*e*n*o**2*v**2 - b*f*m*h**2*y**2 - b*f*m*i**2*x**2 - 
> b*f*m*o**2*v**2 - c*d*g*p*k**2 - c*d*h*m*k**2 - c*e*g*o*k**2 - c*e*i*l*k**2 - 
> c*e*q*g**2*y**2 - c*e*q*i**2*w**2 - c*e*q*k**2*v**2 - c*f*p*g**2*y**2 - 
> c*f*p*i**2*w**2 - c*f*p*k**2*v**2 - d*e*h*l*k**2 - d*e*s*g**2*x**2 - 
> d*e*s*h**2*w**2 - d*e*s*l**2*v**2 - d*f*r*g**2*x**2 - d*f*r*h**2*w**2 - 
> d*f*r*l**2*v**2 - g*j*n*c**2*y**2 - g*j*n*d**2*x**2 - g*j*n*o**2*u**2 - 
> g*k*m*c**2*y**2 - g*k*m*d**2*x**2 - g*k*m*o**2*u**2 - g*r*k**2*u**2*x**2 - 
> h*j*q*b**2*y**2 - h*j*q*d**2*w**2 - h*j*q*k**2*u**2 - h*k*p*b**2*y**2 - 
> h*k*p*d**2*w**2 - i*j*s*b**2*x**2 - i*j*s*c**2*w**2 - i*j*s*l**2*u**2 - 
> i*k*r*b**2*x**2 - i*k*r*c**2*w**2 - i*k*r*l**2*u**2 - i*m*k**2*u**2*x**2 - 
> k*m*s*a**2*x**2 - k*m*s*c**2*v**2 - k*m*s*h**2*u**2 - k*n*r*a**2*x**2 - 
> k*n*r*c**2*v**2 - k*n*r*h**2*u**2 - l*m*q*a**2*y**2 - l*m*q*d**2*v**2 - 
> l*m*q*i**2*u**2 - l*n*p*a**2*y**2 - l*n*p*d**2*v**2 - l*n*p*i**2*u**2 - 
> o*p*s*a**2*w**2 - o*p*s*b**2*v**2 - o*p*s*g**2*u**2 - o*q*r*a**2*w**2 - 
> o*q*r*b**2*v**2 - o*q*r*g**2*u**2 - t*a**2*w**2*x**2*y**2 - 
> t*b**2*v**2*x**2*y**2 - t*c**2*v**2*w**2*y**2 - t*d**2*v**2*w**2*x**2 - 
> t*g**2*u**2*x**2*y**2 - t*h**2*u**2*w**2*y**2 - t*i**2*u**2*w**2*x**2 - 
> t*k**2*u**2*v**2*x**2 - t*l**2*u**2*v**2*y**2 - t*o**2*u**2*v**2*w**2 - 
> 2*a*b*g*t*o**2 - 2*a*c*h*t*k**2 - 2*a*d*i*t*l**2 - 2*b*c*l*t*i**2 - 
> 2*b*d*j*k**2*x**2 - 2*b*d*k*t*h**2 - 2*c*d*o*t*g**2 - 2*g*h*l*t*d**2 - 
> 2*g*i*k*t*c**2 - 2*h*i*o*t*b**2 - 2*j*l*o*k**2*u**2 - 2*k*l*o*t*a**2 + 
> 2*a*e*l*o*k**2 + 2*b*c*j*o*k**2 + 2*b*d*h*p*k**2 + 2*c*d*j*l*k**2 + 
> a*b*h*m*q*y**2 + a*b*h*n*p*y**2 + a*b*i*m*s*x**2 + a*b*i*n*r*x**2 + 
> a*b*j*k*s*x**2 + a*b*j*l*q*y**2 + a*b*k*l*p*y**2 + a*c*g*m*q*y**2 + 
> a*c*g*n*p*y**2 + a*c*i*p*s*w**2 + a*c*i*q*r*w**2 + a*c*j*l*n*y**2 + 
> a*c*j*o*s*w**2 + a*c*k*l*m*y**2 + a*c*k*o*r*w**2 + a*d*g*m*s*x**2 + 
> a*d*g*n*r*x**2 + a*d*h*p*s*w**2 + a*d*h*q*r*w**2 + a*d*j*k*n*x**2 + 
> a*d*j*o*q*w**2 + a*d*k*o*p*w**2 + a*e*g*k*s*x**2 + a*e*g*l*q*y**2 + 
> a*e*h*l*n*y**2 + a*e*h*o*s*w**2 + a*e*i*k*n*x**2 + a*e*i*o*q*w**2 + 
> a*e*k*w**2*x**2*y**2 + a*f*g*k*r*x**2 + a*f*g*l*p*y**2 + a*f*h*l*m*y**2 + 
> a*f*h*o*r*w**2 + a*f*i*k*m*x**2 + a*f*i*o*p*w**2 + a*f*j*w**2*x**2*y**2 + 
> b*c*g*j*q*y**2 + b*c*g*k*p*y**2 + b*c*h*j*n*y**2 + b*c*h*k*m*y**2 + 
> b*c*k*p*s*v**2 + b*c*k*q*r*v**2 + b*c*m*o*s*v**2 + b*c*n*o*r*v**2 + 
> b*d*g*j*s*x**2 + b*d*g*k*r*x**2 + b*d*i*j*n*x**2 + b*d*i*k*m*x**2 + 
> b*d*l*p*s*v**2 + b*d*l*q*r*v**2 + b*d*m*o*q*v**2 + b*d*n*o*p*v**2 + 
> b*e*g*h*q*y**2 + b*e*g*i*s*x**2 + b*e*h*k*l*y**2 + b*e*k*o*q*v**2 + 
> b*e*l*o*s*v**2 + b*e*n*v**2*x**2*y**2 + b*f*g*h*p*y**2 + b*f*g*i*r*x**2 + 
> b*f*h*j*l*y**2 + b*f*i*j*k*x**2 + b*f*k*o*p*v**2 + b*f*l*o*r*v**2 + 
> b*f*m*v**2*x**2*y**2 + c*d*h*j*s*w**2 + c*d*h*k*r*w**2 + c*d*i*j*q*w**2 + 
> c*d*i*k*p*w**2 + c*d*k*m*q*v**2 + c*d*k*n*p*v**2 + c*d*l*m*s*v**2 + 
> c*d*l*n*r*v**2 + c*e*g*h*n*y**2 + c*e*g*k*l*y**2 + c*e*h*i*s*w**2 + 
> c*e*i*k*o*w**2 + c*e*k*l*s*v**2 + c*e*k*n*o*v**2 + c*e*q*v**2*w**2*y**2 + 
> c*f*g*h*m*y**2 + c*f*g*j*l*y**2 + c*f*h*i*r*w**2 + c*f*i*j*o*w**2 + 
> c*f*k*l*r*v**2 + c*f*k*m*o*v**2 + c*f*p*v**2*w**2*y**2 + d*e*g*i*n*x**2 + 
> d*e*h*i*q*w**2 + d*e*h*k*o*w**2 + d*e*k*l*q*v**2 + d*e*l*n*o*v**2 + 
> d*e*s*v**2*w**2*x**2 + d*f*g*i*m*x**2 + d*f*g*j*k*x**2 + d*f*h*i*p*w**2 + 
> d*f*h*j*o*w**2 + d*f*k*l*p*v**2 + d*f*l*m*o*v**2 + d*f*r*v**2*w**2*x**2 + 
> g*h*k*p*s*u**2 + g*h*k*q*r*u**2 + g*h*m*o*s*u**2 + g*h*n*o*r*u**2 + 
> g*i*l*p*s*u**2 + g*i*l*q*r*u**2 + g*i*m*o*q*u**2 + g*i*n*o*p*u**2 + 
> g*j*k*o*q*u**2 + g*j*l*o*s*u**2 + g*j*n*u**2*x**2*y**2 + g*k*l*o*r*u**2 + 
> g*k*m*u**2*x**2*y**2 + h*i*k*m*q*u**2 + h*i*k*n*p*u**2 + h*i*l*m*s*u**2 + 
> h*i*l*n*r*u**2 + h*j*k*l*s*u**2 + h*j*k*n*o*u**2 + h*j*q*u**2*w**2*y**2 + 
> h*k*p*u**2*w**2*y**2 + i*j*k*l*q*u**2 + i*j*l*n*o*u**2 + i*j*s*u**2*w**2*x**2 
> + i*k*l*m*o*u**2 + i*k*r*u**2*w**2*x**2 + k*m*s*u**2*v**2*x**2 + 
> k*n*r*u**2*v**2*x**2 + l*m*q*u**2*v**2*y**2 + l*n*p*u**2*v**2*y**2 + 
> o*p*s*u**2*v**2*w**2 + o*q*r*u**2*v**2*w**2 + t*u**2*v**2*w**2*x**2*y**2 - 
> a*b*j*n*x**2*y**2 - a*b*k*m*x**2*y**2 - a*c*j*q*w**2*y**2 - a*c*k*p*w**2*y**2 
> - a*d*j*s*w**2*x**2 - a*d*k*r*w**2*x**2 - a*e*g*n*x**2*y**2 - 
> a*e*h*q*w**2*y**2 - a*e*i*s*w**2*x**2 - a*f*g*m*x**2*y**2 - a*f*h*p*w**2*y**2 
> - a*f*i*r*w**2*x**2 - b*c*m*q*v**2*y**2 - b*c*n*p*v**2*y**2 - 
> b*d*m*s*v**2*x**2 - b*d*n*r*v**2*x**2 - b*e*g*k*x**2*y**2 - b*e*k*s*v**2*x**2 
> - b*e*l*q*v**2*y**2 - b*f*g*j*x**2*y**2 - b*f*k*r*v**2*x**2 - 
> b*f*l*p*v**2*y**2 - c*d*p*s*v**2*w**2 - c*d*q*r*v**2*w**2 - c*e*h*k*w**2*y**2 
> - c*e*l*n*v**2*y**2 - c*e*o*s*v**2*w**2 - c*f*h*j*w**2*y**2 - 
> c*f*l*m*v**2*y**2 - c*f*o*r*v**2*w**2 - d*e*i*k*w**2*x**2 - d*e*k*n*v**2*x**2 
> - d*e*o*q*v**2*w**2 - d*f*i*j*w**2*x**2 - d*f*k*m*v**2*x**2 - 
> d*f*o*p*v**2*w**2 - e*f*v**2*w**2*x**2*y**2 - g*h*m*q*u**2*y**2 - 
> g*h*n*p*u**2*y**2 - g*i*m*s*u**2*x**2 - g*i*n*r*u**2*x**2 - g*j*k*s*u**2*x**2 
> - g*j*l*q*u**2*y**2 - g*k*l*p*u**2*y**2 - h*i*p*s*u**2*w**2 - 
> h*i*q*r*u**2*w**2 - h*j*l*n*u**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2*x**2 + 2*c*d*o*t*v**2*w**2 + 2*g*h*l*t*u**2*y**2 + 
> 2*g*i*k*t*u**2*x**2 + 2*h*i*o*t*u**2*w**2 + 2*k*l*o*t*u**2*v**2 - j*c**2*k**3 
> + a*c*p*k**3 + c*e*h*k**3, domain = 'QQ')
> 
> thing = first * second - third.sqr()

-- 
Mateusz

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to