The purpose of the NZMATH system is to provide mathematical, especially number-theoretic computational power to you. It is written in Python scripting language in order to enhance quickly with users' experiences.
If you have not yet installed NZMATH, please Install first.
At the time of writing this tutorial, NZMATH is on an early stage of development and does not have own interpreter nor graphical interface. Users have to use with the raw Python interpreter. Though the interpreter is designed well, of course, it is not specialized for mathematical computation. Please be patient about it.
Start your Python interpreter
% python Python 2.3.4 (#1, May 31 2004, 23:11:48) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>
(we use '%' for a command prompt. If you are on Windows, it may be 'C:\>' or something.)
Here, '>>>' is a Python prompt. You are in the Python interpreter until you will type EOF (Ctrl-D on unices and Ctrl-Z on Windows). Then, type:
>>> from nzmath import * >>>
The whole NZMATH stuff is imported.
>>> r = rational.Rational(113, 355) >>> print r 113/355 >>> ....
The session continues until you will stop.
Writing everything at the interpreter prompt is a dull work. Instead of it, you can make a program file.
The name of file must end with '.py'; for example, 'sample.py'.
The contents of the file must be a valid Python program. And, you may want to import NZMATH module at the start of the file.
See the Python documents for detailed Python syntax or built-in data types and functions. NZMATH data types are explained below.
To invoke your program (sample.py, say), simply:
% python sample.py
Or, if you are using unices, make it executable as usual.
Python is an object-oriented programming language, and user can create a new data type as class. The data types provided by NZMATH are also classes, which have a lot of methods including overloaded operators.
There are two integer data types already in Python; int (single precision) and long (arbitrary precision). NZMATH has Integer (nzmath.rational.Integer) to give a rational result for division instead of a float.
NZMATH provides Rational (nzmath.rational.Rational) class representing a rational number.
There are several polynomial classes.
Integers are in the integer ring, A polynomial in a certain polynomial ring, etc.. They are obtained from elements of them by getRing method. For example, rational.Integer(1).getRing() returns a rational.IntegerRing object.
This is a convention in NZMATH and does not apply to the object provided by Python itself such as int or long.
If you encounter a bug, please notify us with, if possible, the data you supply, by email to nzmath-user@tnt.math.metro-u.ac.jp. (See 6.1. Mailing List)
If you are interested in joining to the development team, say so on the mailing list. We will then give you an account on the server which provides cvs repository. (See 6.1. Mailing List)
A mailing list nzmath-user@tnt.math.metro-u.ac.jp is for discussing anything about NZMATH. You can join the list with writing a mail containing a line of "subscribe" in the body to nzmath-user-request@tnt.math.metro-u.ac.jp. *Be careful* not to send it to nzmath-user.
NZMATH is distributed under the BSD license. Please read LICENSE.txt in the distribution tar ball for detail.
Copyright (c) 2004, NZMATH development group, all right reserved.