Polys are represented using a dense scheme, which is internally represented by lists of lists. The way it works is that a multivariate polynomial is recursively represented as a polynomial with polynomial coefficients. A univariate polynomial is represented just as you would expect it to be, e.g., x**2 + 3*x - 4 is just [1, 3, -4]. (3*y**2 + 7)*x**2 + 4*x + (2*y**3 + y**2) would be represented as [[3, 0, 7], [4], [2, 1, 0, 0]].
The representation of the coefficients depend on ground types and the domain of the polynomial, but it is generally mpz or mpq with gmpy ground types, or int or PythonFraction (our custom Fraction class) for Python ground types. Or, if the domain is expr, it uses just SymPy objects. Does that answer your question? There are higher levels, where these are abstracted into classes, but that's basically what it boils down to at the data level. You can find more information about how it's implemented in Mateusz's masters thesis. Aaron Meurer On Mon, Jan 30, 2012 at 10:26 AM, krastanov.ste...@gmail.com <krastanov.ste...@gmail.com> wrote: > Is there some documentation about what types of data structures are > used in 1. matrices, 2. polynomials, 3. geometric algebra, 4. other > composite objects. > > I am more interested in the data types used for elements, not that > much in the overall structure. I know that there are different > possibilities for polynomials, but how does this translate to matrices > for example? > > Is there an overview page or the only detailed answer is to be found > in the master thesis of the author of the polynomial module? And > again, what about matrices, GA and others? > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To post to this group, send email to sympy@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. > -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sympy@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.