Ask Your Question

anon's profile - activity

2021-01-03 13:46:07 -0600 received badge  Popular Question (source)
2019-06-09 04:12:46 -0600 commented answer Efficient way to define many variables?

great thank you!

2019-06-09 03:38:40 -0600 received badge  Editor (source)
2019-06-09 03:38:14 -0600 asked a question Efficient way to define many variables?

Hi, I want to use a computer to look at some examples of a certain determinant function. This function depends on many variables (like up to 50-100 in some examples), and the only way I know how to define variables at the moment is something like this:

a, b, c = var('a, b, c')

So, this limits me to using no more than 26 variables. I would like to have variables x_{i,j}, y_{i,j}, z_{i,j} which are indexed by a pair of positive integers i,j not exceeding a number n (which will depend on the example I'm doing, e.g. let's say n=10).

Is there a good way to define all these variables and have Sage recognize them?

Also, this determinant is a polynomial in these variables, and many terms will cancel. Is there a way to get Sage to simplify the expression and make these cancellations? It seems I would need to tell it that my variables commute with each other, which I don't know how to do.

2019-04-26 15:11:53 -0600 asked a question Scaling and tensor product for Lie Groups

I am new to any coding. I want to compute a tensor product of several scaled weights of a lie group and I can't get this to work.

Looking at the sage math pages for Weyl Character Rings, I figured out how to do tensor product decompositions, e.g. if you put in

A2 = WeylCharacterRing("A3",style="coroots")
A2(1,1,1)*A2(1,1,0)*A2(1,1,0)

then it gives you the decomposition of the above tensor product (where the weights (1,1,1), etc., are written in the fundamental weight basis).

I want to compute something like

A2(2,2,2)*A2(2,2,0)*A2(2,2,0)

where each of the weights is scaled by 2, but without having to manually scale the weights (so I can implement this in some more general code).

You can scale weights by entering e.g. A2(1,1,1).scale(2), and this gives you A2(2,2,2), BUT this only works for me when I add .ambient() to the end of the definition of A2 above. HOWEVER after I add .ambient(), the tensor products no longer work! (If I try to do a tensor product after adding the .ambient(), it just adds the vectors componentwise...)

If anyone is familiar with how to do this sort of thing, your help would be greatly appreciated! Thanks.