## Computer algebra with Squeak

Leandro Caniglia caniglia at dm.uba.ar
Thu Aug 27 04:10:26 UTC 1998

```David.

Here in the University of Buenos Aires we have been using Squeak for our
mathematical work since version 1.16. Today I begun the third course about
Squeak and Mathematic. The results we are obtaining are incredible. Of
course we have made algebra (LinearSpaces, LinearTransformations, Matrices,
Polynomilas in any number of variables, Algebraic Numbers, FiniteFields,
Groebner Basis, SLP representations, Permutations, Groups, Functions, etc)
and also Numeric Analysis (Integration, DiferentialEquations, PowerSeries,
etc.). Currently we are making our first steps in Physical experiments
inside Morphic and, again, the results are terrific. If you are interested,
we can share our experiences each other. You are invited to contact us by
mail to our MathSqueak list at objetosm at dm.uba.ar.

Saludos,
Leandro
-----
"Although it is quite possible to write programs which depend on the byte
size, this is an illegal act which will not be tolerated" Donald E. Knuth,
The Art of Computer Programming, Vol 1.

>
> Hello,
>
> I was working on a project to build a small computer algebra system in
>Squeak, and have just updated the package that I made available on the web
>at http://cage.rug.ac.be/~stes/squeak.html.
>
> (I think this would be a good application of Squeak, in mathematics, and
>I've also added the URL of my package to the Squeak Swiki server at
>http://minnow.cc.gatech.edu/squeak.20)
>
> There's already some simple things you can do with the package (and more
>to come) :
>
> Create a BigInt instance,
>
>one := BigInt int:1 1
>
> Make a polynomial z+1,
>
>p := Polynomial scalar:one 1
>t := Term scalar:one symbol:'z'exponent:1 'z'
>p insertTerm:t 'z' + 1
>
> Square the polynomial,
>
>q := p square 'z'^2 + 2 'z' + 1
>
> Add a term in a different variable (to get a multivariate polynomial)
>
>t := Term scalar:one symbol:'a' exponent:1 'a'
>q insertTerm:t 'z'^2 + 2 'z' + 'a' + 1
>q := q square 'z'^4 + 4 'z'^3 + (2 'a' + 6) 'z'^2 + (4 'a' + 4) 'z' +
>'a'^2 + 2 'a' + 1
>
> Now convert the polynomial from the recursive representation (where
>coefficients are polynomials) to the expanded representations, where the
>polynomial is an (expanded) sum of monomials,
>
>p := q makeExpanded 'z'^4 + 4 'z'^3 + 6 'z'^2 + 4 'z' + 'a'^2 + 2 'a'
>'z'^2 + 4 'a' 'z' + 2 'a' + 1
>
> The total degree and order of the polynomial,
>
>p degree 4
>q order 0
>
> Get the leading monomial (or term etc.)
>
>
> Convert back to recursive representation
>
>p makeRecursive 'z'^4 + 4 'z'^3 + (2 'a' + 6) 'z'^2 + (4 'a' + 4) 'z' +
>'a'^2 + 2 'a' + 1
>
>
> I hope to eventually have a good set of 'building blocks' for algebra in
>Squeak, and then you could use Squeak for other computations as well
>(group theoretical, for instance).
>
>David.
>
>

```