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

  • Thread starter Thread starter Chenkb
  • Start date Start date
AI Thread Summary
The discussion centers on using the "Reduce" software for algebraic computations and the need to clear the workspace before calculations, similar to MATLAB's "clear all" function. Users found that while individual variables can be cleared with the command "clear x, y, ...", there is no direct command to clear all variables at once. A solution was discovered through the official forums, involving loading the package "reset" and using the command "resetreduce." Additionally, for calculating gamma matrix traces with uncontracted indices, users were directed to load the "CVIT" package and consult specific sections of the manual for guidance. The conversation highlights the importance of community resources and documentation in resolving software usage challenges.
Chenkb
Messages
38
Reaction score
1
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!
 
Physics news on Phys.org
A search in the manual turned up nothing. (using the keywords below)
Code:
"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 http://www.cadtutor.net/forum/showthread.php?6091-Nil-(reseting)-all-variables-in-a-lisp-routine

I'm afraid you're out of luck.
 
JorisL said:
A search in the manual turned up nothing. (using the keywords below)
Code:
"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 http://www.cadtutor.net/forum/showthread.php?6091-Nil-(reseting)-all-variables-in-a-lisp-routine

I'm afraid you're out of luck.

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?
 
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.
 
JorisL said:
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.

For example, if I want to calculate ##Tr(\gamma^\mu\gamma^\nu)\cdot Tr(\gamma_\mu\gamma_\nu)=64##
I write:
Code:
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:
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.
 
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/
 
JorisL said:
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/

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:
load_package "reset";
resetreduce;

For gamma matrix trace with index, I found the solution from the manual, by loading the package "CVIT".
 
Last edited:
  • Like
Likes JorisL
Back
Top