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

  • Thread starter Thread starter Chenkb
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around the use of the "Reduce" software for algebraic computations, specifically focusing on how to clear the workspace before performing calculations and issues related to calculating traces of Dirac Gamma matrices with uncontracted indices.

Discussion Character

  • Technical explanation
  • Conceptual clarification
  • Homework-related

Main Points Raised

  • One participant inquires about how to clear the workspace in "Reduce," similar to the "clear all" command in MATLAB.
  • Another participant notes that the manual does not provide a command for clearing all variables and suggests that such functionality may not exist in Lisp.
  • A participant shares a workaround by reloading "Reduce" instead of clearing the workspace.
  • Concerns are raised about calculating the leptonic tensor with uncontracted indices, specifically regarding the requirement for matched indices in Dirac Gamma matrix traces.
  • One participant requests sample code for calculating traces, expressing unfamiliarity with "Reduce" and Lisp.
  • Another participant provides an example of calculating traces but encounters errors related to unmatched indices when attempting to separate calculations into different variables.
  • Several participants reference sections of the manual and additional packages that may assist with gamma matrix calculations and workspace management.
  • A later reply indicates that a solution for clearing the workspace was found, involving loading a package called "reset" and using the command "resetreduce." Additionally, a solution for handling gamma matrix traces was found by loading the "CVIT" package.

Areas of Agreement / Disagreement

Participants express differing views on the availability of a command to clear the workspace, with some suggesting it does not exist while others propose workarounds. The discussion on calculating traces remains unresolved, with participants sharing different approaches and encountering various issues.

Contextual Notes

Participants reference specific sections of the manual and external resources, indicating that there may be limitations in their understanding of the software's syntax and functionality. The discussion includes unresolved issues regarding the handling of indices in calculations.

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   Reactions: JorisL

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K