Mathematica

Mathematica

Mathematica is a computer program used widely in scientific, engineering and mathematical fields. It is mainly known as a computer algebra system, but it has various other features for technical computing. It was originally conceived by Stephen Wolfram and developed by a team of mathematicians and programmers that he assembled and led. It is developed by Wolfram Research of Champaign, Illinois.

Overview

Mathematica is split into two parts, the "kernel" and the "front end". The kernel interprets expressions (Mathematica code) and returns result expressions. The Front End provides a document-centered GUI.

Front ends

The Mathematica Front End provides an interface which allows the creation and editing of Notebook documents which can contain program code with prettyprinting, formatted text together with results including typeset mathematics, graphics, GUI components, tables and sounds. All contents and formatting can be generated algorithmically or interactively edited and most standard word processing capabilities are supported but only one level of "undo" is supported.

Documents can be structured using a hierarchy of cells, which allow for outlining and sectioning of a document and support automatic numbering index creation. Documents can be presented a slide show environment for presentations. Starting with version 3.0 of the software, notebooks and their contents are represented as Mathematica expressions that can be created, modified or analysed by Mathematica programs. This allows conversion to other formats such as TeX or XML.

The Mathematica Front End includes development tools such as a debugger, input completion and automatic syntax coloring.

The kernel and the front end communicate via the MathLink protocol. It is possible to use the kernel on one computer and the front end on another.

The standard Mathematica front end is used by default, but alternative front ends are available:

The Wolfram Workbench is an Eclipse based IDE, introduced in 2006, that provides project based code development tools for Mathematica, including revision management, debugging, profiling, and testing.

High-performance computing

In recent years the capabilities for high-performance computing have been extended with the introduction of packed arrays (version 4, 1999) , sparse matrices (version 5, 2003), and by adopting the free GNU Multi-Precision Library to evaluate high-precision arithmetic.

Version 5.2 (2005) added automatic multi-threading when computations are performed on modern multi-core computers. This release included CPU specific optimized libraries. In addition Mathematica is supported by third party specialist acceleration hardware such as ClearSpeed.

Development

Several solutions are available for deploying applications written in Mathematica:

Mathematica Player Pro is a runtime version of Mathematica that will run any Mathematica application but does not allow editing or creation of the code.

Mathematica Player is a free interactive player is provided for running Mathematica programs that have been digitally signed for non-commercial use via a Wolfram Research web service, or published on the Wolfram Demonstrations Project website. It can also view unsigned Mathematica files, but not run them.

webMathematica allows a web browser to act as a front end to a remote Mathematica server. It is designed to allow a user written application to be remotely accessed via a browser on any platform. It may not be used to give full access to Mathematica. The current version of webMathematica (2.3) does not support Mathematica 6.

Connections with other applications

Communication with other applications occurs through a protocol called MathLink It allows communication between the Mathematica kernel and front-end, and also provides a general interface between the kernel and other applications. Wolfram Research freely distributes a developer kit for linking applications written in the C programming language to the Mathematica kernel through MathLink. Two other components of Mathematica, whose underlying protocol is MathLink, allow developers to establish communication between the kernel and a .NET or Java program: .NET/Link. and J/Link

Using .NET/Link, a .NET program can ask Mathematica to perform computations; likewise, a Mathematica program can load .NET classes, manipulate .NET objects and perform method calls. This makes it possible to build .NET graphical user interfaces from within Mathematica. Similar functionality is achieved with J/Link, but with Java programs instead of .NET programs.

Communication with SQL databases is achieved through built-in support for JDBC..

Common structures and manipulations

One guiding principle in Mathematica is a unified structure behind almost all objects representable in Mathematica. For example, the expression x^4+1 if entered will be represented as if it were written:

In[8]:= x^4 + 1

Out[8]= 1+x4

If the FullForm command is used on this expression however:

In[9]:= FullForm[x^4 + 1]

Out[9]= Plus[1, Power[x, 4]]

All objects in Mathematica, except atomic ones such as symbols, numbers, and strings, have the basic form head[e1, e2, ...] (which may be displayed or entered in some other fashion). For example, the head of the above expression is Plus. Lists have this structure too, where the head is List, and the elements are e1, e2, etc. The concept of head is defined for atomic objects as well (Symbol for symbols, Integer for whole numbers, etc.), but they have no extractable subparts.

The principle permits ordinary expressions unrelated to lists to be operated on with list operators:

In[10]:= Expand[(Cos[x] + 2 Log[x^11])/13][[2, 1]]

Out[10]= 2/13

The reverse can also occur -- lists can be modified to behave like ordinary expressions:
In[11]:= Map[Apply[Log, #] &, {{2, x}, {3, x}, {4, x}}]
Out[11]= {Log[x]/Log[2], Log[x]/Log[3], Log[x]/Log[4]}
where the Apply function changes the head of its second argument to that of the first, and Map behaves like the map function found in many functional languages. Note that Log[b,x] is the base b logarithm, which is converted to Log[x]/Log[b] on input.

Because of this equivalence between a regular mathematical object represented in Mathematica to that of a simple list structure, some built-in Mathematica functions permit threading, where functions map themselves over lists without much further specification. Indeed, Apply threads itself over lists when invoked as
In[12]:= Apply[Log, {{2,x}, {3,x}, {4,x}}, 1]
Out[12]= {Log[x]/Log[2], Log[x]/Log[3], Log[x]/Log[4]}
where the third argument being a 1 specifies that Apply replaces the heads of its argument only at the first level in the list, which is what we want, and is equivalent to the above example.

When writing a large piece of code ("Module"), variables references are by default global rather than local
and must be declared at the top rather than inline.

Licensing

A regular single-user license for Mathematica 6.0 includes one year of service which includes updates, technical support, a home use license, a webMathematica Amateur license, and a Wolfram Workbench license. Discounts are available for government, charity, educational, pre-college, school, student and retiree use and depend on geographical region. Educational site licenses allow use by students at home. A license manager similar to Flexlm is available to provide efficient sharing of licenses within a group.