December 15, 2009 - On Windows Vista machines, some users have found that the init.m file to be used to set $Path and other needed
commands is
C:\ProgramData\Mathematica\Kernel\init.m
October 28, 2009 - The MakeSum function, as used in Section 4.1.10 of the MathTensor book, will no longer work in Mathematica 7 unless the following is added to init.m or done at the
beginning of a MathTensor session.
Unprotect[Sum]
Sum[a_] := a
Protect[Sum]
This is not needed in Mathematica 6 or lower,
November 25, 2008 - For
Mathematica 7, it is now necessary to add the line
Unprotect[RiemannR]
to the init.m file - typically this file is in the Library/Mathematica/Kernel
subdirectory of your user directory.
May 23, 2008 - On systems with Mathematica 6, the placement
of the init.m file that needs to be read (see below) to set the $Path
and other items has moved to /Library/Mathematica/Kernel/init.m (or sometimes
in the Library folder in the user's home folder). On Windows machines, the
appropriate init.m file is intallation dependent and may be in a place like
..\Wolfram Research\Mathematica\6.0\SystemFiles\Kernel\Packages\init.m
or
..\Application Data\Mathematica\Kernel\init.m
where the ..\ in front depends on where you have Mathematica installed.
A user recently reported this -
Have just installed MathTensor and managed to get it to load and recognise the password file. Just a couple of comments on what seems to be mac/Mathematica 6.x specific stuff that you might want to add to the install instructions before I forget!
(1) In my installation at least, there is no init.m file in the Applications/Mathematica path. Instead I used the local one in /Users/Library/Mathematica/, which I guess means I have only installed for one user and not globally. If you edit it in Mathematica you get the package editor, which seems to work fine. Sometimes the mac front end (mostly the packaging system for applications) makes it a bit difficult to see the nuts and bolts of the UNIX which is underneath! I didn't need any double slashes in the path for it to work.
(2) The password file was slightly more problematic - I tried to use the default mac TextEdit to produce an rtf and rename it, but that doesn't seem to read in Mathematica (could be the old windows/UNIX carriage return, linefeed incompatibility?) After that I tried to make a mathematica package file (.m) but that didn't work either. Finally I resorted to vim to get a really pure ASCII file, which works fine. You might like to add a comment somewhere to indicate that you need to really use a low level editor to get it to read properly? I guess emacs would work too, but I haven't tried it.
Another user sent this suggestion -
Simplified Installation Instructions suggested by Alessandro Stecchina:
We will create a MathTensor Loader notebook which will take care of all the settings required to run MathTensor. (This is written for a Windows system and might need to be modified slightly for Mac or Unix systems.)
0 - Start a new Mathematica session
1 - In Mathematica evaluate $BaseDirectory or $UserBaseDirectory. This will give you a
Mathematica folder that contains an Applications folder.
The Applications folder is the place to install the MathTensor package-folder.
This is the recommended place for 3rd party packages in Mathematca 6.x
So go ahead and place the MathTensor package-folder inside the Applications folder inside $BaseDirectory or inside $UserBaseDirectory
At the conclusion you should have the structure:
...\Mathematica\Applications
\MathTensor package folder (called mathtensor or MathTensor, or something smilar)
\package files
2 - Create a new blank notebook and paste the following code in one cell:
-------------------------------------------------------------------------------
Unprotect[TensorQ];
$Path = Join[$Path, {$BaseDirectory <> "\Applications\mathtensor"}];
Off[Syntax::"com"];
<< mathtens.m
postfunc[x_Graphics | x_Graphics3D] := x;
postfunc[x_] := OutputForm[x];
$Post := postfunc;
--------------------------------------------------------------------------------
Some users of Mathematica 7 find that the
postfunc lines above cause problems. They can be left out.
3 -Depending on your operating system or configuration, you may need to:
Replace $BaseDirectory with $UserBaseDirectory if you have installed MathTensor in $UserBaseDirectory.
Replace "mathtensor" with the folder name containing the MathTensor package (for ex. MathTensor)
Replace "mathtens.m" with the appropriate filename for launching MathTensor (for ex. MathTensor.m)
Deepending on your operating system, you may need to slightly change the folder separators in the string "\Applications\mathtensor".
Just look at how the $BaseDirectory string is made and copy the separator
4 - Save the notebook as "MathTensor Loader" (or whatever else you wish) in the folder where you keep your regular notebooks.
5 - Evaluate the cell
If all is well you have loaded MathTensor and you can do some testing to see that everything is ok.
Try also:
as you see graphics cells are output in standard (graphics) form. All the rest is in OutputForm
If you like to save your work, just use the Save as... menu command and choose a name and location for your notebook. It will be saved with the loader cell inside, so next time you can just open it and launch MathTensor from it.
Otherwise, every time you wish to use MathTensor from scratch, just open the MathTensor Loader notebook and evaluate the cell.
That's it!
October 1, 2007 - On Macintosh OS X systems running Mathematica 6,
we have found it better to install the UNIX/Linux version of MathTensor.
So, on the Macintosh CD, if you are using Mathematica 6, use the
mathtensor.tar.gz file in the Mathematica 6 folder and follow the
UNIX instructions below. If you are not using Mathematica 6, use
the files in the other folder and follow the Macintosh instructions.
May 5, 2007 - In Mathematica 6, you will need to set the output form
for tensors in a different way. See Step 5 below for more details.
July 11, 2003 - Mathematica 5 or higher differences.
Some users have reported that when they move to Mathematica 5 or higher,
they are having load problems with MathTensor. One is that
it appears that a TensorQ function has been added in Mathematica 5 or higher
which will conflict with MathTensor's TensorQ function and give
errors when loading. The quick fix for this is to just do
Unprotect[TensorQ]
in Mathematica before you try to load MathTensor. Alternatively,
you can add the Unprotect line in your init.m file after the
Off[Syntax::"com"] line discussed in Step 7 below. This last
option will not permit you to use Mathematica's TensorQ at any
time of course. This will be corrected in a future release.
The $PreRead discussion on page 39 of the MathTensor book
no longer works and should not be used.
Also, in the Windows version at least, it may be necessary to
put type \\ instead of \ in your $Path statement in init.m.
See below for details on init.m. If you have any other
problems, report them to mathtensor@smc.vnet.net immediately.
Note that new instructions
for Mathematica
4.1, 4.2 or higher on Macintosh have been added due to differences in
how to
edit the init.m file. If you have moved to OSX, email
steve@smc.vnet.net for
details on new files that you will need to get in order to run
MathTensor. Three new files are needed. See below for some further
details.
These instructions assume some knowledge of how Mathematica works. It
is suggested that you read the installation details for Mathematica
before proceeding with the Instructions below. It is assumed that you
are running version 3.0 or higher of Mathematica. If you have any
problems with installation, report them immediately to us at mathtensor@wolfram.com.
If you are using a version of Mathematica older that 3.0, contact
MathTensor, Inc. for different instructions. Because certain functions
(especially front end formatting functions) do not work in older
versions of Mathematica, we recommend you upgrade. Instructions for
computer platforms vary slightly. These will be noted when needed.
By far, the most problems that are reported are due to either a
mis-typing of one of the $Path commands below or mis-placement of the
init.m file.
Step 1:
Locate the CD containing the MathTensor software and place it in
your CD drive. (If you have an older MathTensor release that came
on floppy, you can replace the word CD with floppy.)
Step 2:
Macintosh/PowerMac Systems: Once the CD disk icon appears on the
screen, click on it to open it up. There you will find two MathTensor
folders. One is for systems running OS 9 or less. The second labeled
MathTensor OSX is for OSX only. You only need to install the folder
that corresponds to the version of Mathematica you are running.
Windows Systems: Click on your My Computer icon to open it up and then
on the CD drive icon to open it. On some systems when you put the CD
in your drive, the CD folder may open up automatically, In the folder window, you will find a MathTensor
folder.
Unix/Linux Systems: Typically, your system will have some sort of
file manager window tool. On Sun Solaris systems, this is called the
File Manager. Open up the File Manager. You may have to go to a File
menu in order to get the machine to find the CD. Usually, a
CD drive window with then appear. It will contain a file
called mathtensor.tar.gz.
Step 3:
When you installed Mathematica 3.0 or higher on your system, the directory where
its files are located contains an AddOns\Applications subdirectory.
This location varies depending on your computer type and directory
structure. You will need to find this subdirectory on your machine.
Windows or Macintosh (OS 9 or less):
Copy the MathTensor folder in the CD disk into the
AddOns/Applications folder.
Macintosh OSX:
It is easiest to copy the MathTensor OSX folder to your home directory, usually
in the /User directory with your login name.
Unix/Linux:
Go to the AddOns/Applications directory.
Copy the mathtensor.tar.gz to this directory. Then run
gunzip mathtensor.tar.gz
tar xvf mathtensor.tar
A MathTensor directory will be created containing the MathTensor files.
Most versions of Unix/Linux
Step 4:
You now need to find the Configuration\Kernel
folder (directory) in
your Mathematica directory. In this directory you will find the init.m
file. This file needs to be edited (within Mathematica usually by
finding the file with the File->Open menu items) to include a line
like
Windows:
$Path=Join[$Path,{"(drive:Mathematica directory)\AddOns\Applications\MathTensor"}]
For example, after a typical Mathematica install, the above line
will look like:
$Path=Join[$Path,{"C:\Program Files\Wolfram Research\Mathematica\3.0\AddOns\Applications\MathTensor"}].
Macintosh OS9 or lower:
$Path= Join[$Path,{"(drive with Mathematica directory):AddOns:Applications:MathTensor 2.2"}]
Macintosh OSX:
$Path= Join[$Path,{"/Users//MathTensor 2.2 "}]
Unix/Linux:
$Path= Join[$Path,{"(drive/Mathematica directory)/AddOns/Applications/MathTensor"}]
to the VERY END of the file after the End[] statement. You must put in
the full path name of the Mathematica directory where the
AddOns\Applications subdirectory is located. This replaces the (drive ... )
objects above. Make very sure to type all the brackets, quotes, and
spaces exactly correct. Not typing this line correctly is the most
common installation mistake. Save the editing into the init.m file.
We have noticed that the installation for
Mathematica 4.1 or higher on the Macintosh requires a slightly different
placement of the $Path and Syntax lines (see below) in the init.m
file. These two lines need to be before the End[] statement
rather than after it. When you edit the init.m file, a dialog
box may appear asking if you want the file to be loaded automatically
during Mathematica startup. You need to answer yes to this
by clicking the top button in the box.
To test the $Path, you need to restart Mathematica and then type
$Path
Your path to your MathTensor directory/folder should appear in the
output of this. If it does not appear exactly or is incorrect, you will need to
re-edit the init.m file.
Some users have received a message like:
Syntax::sntoct1:
3 octal digits are required after \ to construct an 8-bit character.
This is due to the form
\Mathematica\4.0\AddOns
being part of the $Path statement in the init.m file. This can be fixed
by using the string
\Mathematica\\4.0\AddOns
instead.
In Mathematica 5 or higher for Windows you may need to put
\\ instead of just \ in each place in the init.m $Path line. One
of our users comments also that in his case:
In Mathtensor with Mathematica 5 or higher for Windows it is not only necessary to
use two \\ slashes for one in the init file ($PATH) but also within
notebooks when reading/writing (within my experience in Windows XP).
Example lines follow.
Components["C:\\RuleTheWaves\\Kazanas\\Partitioned\\formal.m", \
"C:\RuleTheWaves\Kazanas\Partitioned\Heat.m", \
"C:\RuleTheWaves\Kazanas\Partitioned\Heat.out"]
Notice that I had to double the backslashes to read, but not to write.
I believe it is OK to use doubles in both places. The backslashes that
follow commas are not really in the notebooks, at least not as such
(visibly) !!!!!!!!!! They evidently result from mouse-copying from
notebooks that have long lines broken for continuation and then pasting
in this e-mail. Evidently, Mathematica 5 or higher uses the "\" as a hidden
symbol for continuing lines.
In one case I had to use
<< "MathTens.m"
with the quotes in place; other times I have not had to do that. There
may be invisible characters accidentally typed in the notebook that
required the quotes in that line.
Step 5:
Before loading MathTensor 2.2, go to the Cell menu item and go to
Default Output Format Type and then select OutputForm. This gives what
we consider to be a better looking screen appearance for the
superscripts and subscripts.
In Mathematica 6, this is done in the Mathematica->Preferences window.
In the Format type for new output cells: set this to OutputForm
before loading MathTensor.
In Mathematica 7, go to the Preferences->Evaluation window. In that, look for the "Format type of new output cells" line and change the value to
OutputForm before loading MathTensor.
Step 6:
Currently, for Unix/Linux systems only, you will need to get a password. In
a Mathematica session, type
$MachineID
and email the result to MathTensor, Inc. at mathtensor@wolfram.com. A
password will be issued. Once you have the password, create a file
called mathtensorpass.m in the same directory as your MathTensor
files. In that file put the two lines:
$MachineID
password
where $MachineID is the number you email to us put inside the quotes
and password is the number you get from us.
Step 7:
If you are using Mathematica 4 or higher on any system, you will need to add
the following line to your init.m file after the $Path statement:
Off[Syntax::"com"]
Mathematica 4 and higher appears to have a new warning message that looks for
particular comma structures in code. These structures in MathTensor
do not affect computations but do cause warning messages like
Syntax::com: Warning: comma encountered with no adjacent expression; the
expression will be treated as Null.
during loading. The Off line above causes these warnings not to be
generated. Future versions of MathTensor will not require this
fix.
Step 8:
If the $Path is correct and in the Unix/Linux case you have a valid password,
you can now start MathTensor by typing
<<MathTensor.m (Macintosh or Unix/Linux/OSX)
<<MathTens.m (Windows)
command. MathTensor should now load giving the Copyright symbol and
other information about MathTensor default settings.
If you use the Components function, you load with
<<Components.m (Macintosh or Unix/Linux/OSX)
<<Componen.m (Windows)
You can now use MathTensor. Report any problems to MathTensor, Inc.
Do not report problems with MathTensor to Wolfram Research first.
While you may have purchased the product there, they do not provide
support for MathTensor.
It is now possible in Mathematica 3.0 or higher and MathTensor 2.2 to have Greek
tensor names (still not indices, but soon) by doing something like:
DefineTensor[esc-a-esc,"esc-a-esc",{{1,2},1}]
where esc is the escape key. An alpha symbol should appear on the
screen in the DefineTensor and later in any expression where you type
in esc-a-esc[la,lb].
The use of MathTensorFast.m described in the MathTensor
book is no
longer supported.
In versions shipped after November 1998, the VariationalDerivative
function has been changed to automatically symmetrize the output
indices.
It is our policy to report bugs and other problems openly and to
try to give fixes as soon as possible.
There are several misprints or changes in the MathTensor Book:
Page 39: the $PreRead part of this page should be deleted. It
no longer works in current Mathematica versions.
Page 102: In the RiemannRule13, 1/4 should be 1/2. (if your calculation
uses RiemannRule13, contact us)
Page 103: In the RiemannRule19, there is an R0 in the second term.
This should just be an R.
Page 180: In the box at the top, AbosrbKdelta should be AbsorbKdelta.
Page 292: The file name CompOut.m two-thirds the way down the page should read CylOut.m.
Page 296: The output of DSolve in Out[22] will not
appear this way in recent versions of Mathematica. This is a bug in
Mathematica and has been reported to Wolfram Research.
Page 309: In the second line, GaussBonnetMetricProdctFourDimensions
should be GaussBonnetMetricProductFourDimensions.
Page 369: The PairAntisymmetrize entry should say
and anti-symmetrizes over all the pairs.
Bug in Variation: The value for Variation[CD[ScalarR,la],Metricg] is incorrect
in placement of two indices. If you use this structure, contact
us for a replacement file.
Bug: The Ttransform function does not work properly in certain
situations where there are mixed covariant and contravariant indices.
It does work when the indices are one or the other. To use Ttransform,
write mixed tensors in terms of non-mixed ones and metric tensors.
Bug: The CommuteCD and OrderCD functions do not work properly when Rmsign is
set to -1. Default is Rmsign = 1, so the bug does not occur if you have
not set Rmsign to -1. If you do not use Rmsign=-1, this will not
affect any computations. If you have to set Rmsign to -1, contact
us.
Bug: RiemannRule38 is defective. If you run
a program and it says that RiemannRule38 has been used, you will
get an erroneous answer. A new fix for this is being developed,
Contact Steve Christensen if you see this problem.
Comment: Tsimplify will not always work if you don't run
Expand on an expression with tensors inside ( )'s. Always run Expand
before running Tsimplify.
Send comments or questions to steve@smc.vnet.net
© Copyright 2009 MathTensor, Inc.
MathTensor is a Trademark of MathTensor, Inc.
Mathematica is a Registered Trademark of Wolfram Research, Inc.
This page was last updated on December 20, 2009.