# I am using "Reduce", how to clear workspace before calc?

1. Apr 19, 2016

### Chenkb

Hi, everyone,

I am now using "Reduce", a software system based on "Lisp" for general algebraic computations.
Does anyone use this software and know how to clear workspace before doing calculation?
Just like "clear all" in MATLAB.

I read from the user's manual that the command "clear x, y, ..." will remove x, y, ...
but how to clear all?

Best regard!

2. Apr 19, 2016

### JorisL

A search in the manual turned up nothing. (using the keywords below)
Code (Text):

"CLEAR" site:http://reduce-algebra.sourceforge.net/manual/

Since it's based on Lisp I tried checking out if that functionality natively exists.
It turns out it doesn't as per this thread

I'm afraid you're out of luck.

3. Apr 20, 2016

### Chenkb

Thank you!
Well, this is actually not a serious problem, because I can always reload Reduce.
But I now encounter a more realistic problem.
When Reduce does Dirac Gamma matrix trace, the indices must always be matched (appear in pair).
However, if I just want to calculate, say, the leptonic tensor, that has uncontracted indices u,v.
What should I do?

4. Apr 21, 2016

### JorisL

Can you give some sample code for the trace? I'm not at all familiar with Reduce (or lisp for that matter) so it would take some time to get what's happening while code can lead to faster answers.

5. Apr 21, 2016

### Chenkb

For example, if I want to calculate $Tr(\gamma^\mu\gamma^\nu)\cdot Tr(\gamma_\mu\gamma_\nu)=64$
I write:
Code (Text):
index mu, nu;
ans := 4*g(L1, mu, nu) * 4*g(L2, mu, nu);
;end;
The "4" is because Reduce always calculate 1/4 times the trace.
This will give 64, no problem.

But if I write:
Code (Text):
index mu, nu;
ans1 := 4*g(L1, mu, nu);
ans2 := 4*g(L2, mu, nu);
ans := ans1 * ans2;
;end;
It will generate an error: "Unmatched index mu", for the ans1 line, also ans2 line.

6. Apr 21, 2016

### JorisL

I think this section of the manual can be of use http://reduce-algebra.sourceforge.net/manual/manualch18.html#manualse177.html
Specifically subsection 18.3.

What can also help is an extra package http://reduce-algebra.sourceforge.net/manual/manualse101.html

I suggest you look at http://reduce-algebra.sourceforge.net/manual/manualse177.html#x234-102300018.1 to get very comfortable with the way gamma matrices are implemented in Reduce.

That's about all I can do without learning the full syntaxwhich would take too much time at the moment (unfortunately).

I hope you can resolve your problems with this. A final resource are the official forums https://sourceforge.net/p/reduce-algebra/discussion/

7. Apr 21, 2016

### Chenkb

It's very kind of you to give the help. Thank you very much.
I found the solution to clear workspace from official forums:
Code (Text):