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

  • Thread starter Chenkb
  • Start date
In summary, the conversation was about using "Reduce", a software system based on "Lisp" for general algebraic computations. The main questions were about how to clear the workspace before doing calculations and how to calculate the Dirac Gamma matrix trace. The manual was searched for the keyword "CLEAR" but no results were found. It was suggested to check if the functionality natively exists in Lisp, which it does not. The conversation also included a request for sample code for the trace and a link to the manual section on gamma matrices. Additional resources such as an extra package and the official forums were also mentioned. Finally, the solution to clear the workspace was found from the official forums and the solution for calculating the gamma matrix trace was found in
  • #1
Chenkb
41
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
  • #2
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.
 
  • #3
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?
 
  • #4
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
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.
 
  • #6
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
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

1. How do I clear my workspace before using "Reduce"?

To clear your workspace before using "Reduce", you can use the command "rm(list = ls())" to remove all objects from your current workspace.

2. Can I save my workspace before clearing it?

Yes, you can save your workspace before clearing it by using the command "save.image()" and specifying a file name to save it as.

3. Will clearing my workspace delete all my saved data?

No, clearing your workspace will only remove objects from your current session. Your saved data will remain intact and can be accessed again in future sessions.

4. Is there a way to selectively clear certain objects from my workspace?

Yes, you can use the "rm()" command followed by the name of the object you want to remove. You can also use the "ls()" command to view all objects in your workspace and then remove specific ones.

5. Can I clear my workspace automatically before running my code?

Yes, you can use the command "options(warn=-1)" to suppress warnings and then use the "rm(list = ls())" command to clear your workspace before running your code.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
974
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
14
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
  • Mechanical Engineering
Replies
21
Views
458
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • Programming and Computer Science
Replies
2
Views
1K
Back
Top