Ask Your Question

Bob67846's profile - activity

2020-01-11 15:18:37 -0500 commented answer Eigenvalues and eigenspaces of orthogonal (or rotation) matrices

Thanks, this is excellent! (I need the actual fractions (1/5,2/5,3/5,4/5 in the example) which I can now deduce inductively from your code using the multiplicities, and then I suppose I can obtain the eigenspaces by first comparing those eigenvalues with E(5)^i in UniversalCyclotomicField, and then taking the real and complex parts of the matching eigenvectors gives the rotation planes. In other words, this is very doable now but if you know some smart tricks for this again then please do let me know!)

2020-01-10 16:05:24 -0500 asked a question Eigenvalues and eigenspaces of orthogonal (or rotation) matrices

Given an orthogonal transformation of finite order, e.g.


Its eigenvalues are going to be of the form


corresponding to a splitting of the matrix into rotation (and reflection) matrices. I'd like to extract these fractions m (mod ZZ) and study the corresponding (real rotation and reflection) eigenspaces.

My impression is that Sage isn't suitable for doing this directly, but that I should use e.g. the Maxima or Mathematica interface? Any suggestions for the most suitable method?

2020-01-04 19:20:41 -0500 commented answer Cython: undeclared name not builtin

... and that's exactly what you meant. Woops!

2020-01-04 15:15:51 -0500 commented answer Cython: undeclared name not builtin

Sorry I'm new to this, but import_statements(RootSystem) didn't seem to work for Cython - I suppose the "right" answer might then be

from sage.combinat.root_system.root_system import RootSystem
2020-01-03 14:11:55 -0500 commented answer Cython: undeclared name not builtin

Thanks, this was helpful - the right answer is

from sage.all import RootSystem
2020-01-03 10:32:28 -0500 asked a question Cython: undeclared name not builtin

Loading a .spyx file with

 def bla(W):


undeclared name not builtin: RootSystem

Is there a library that I need to include?

2019-12-31 19:46:37 -0500 commented answer Local/global variable behaviour of lists

This is clear, thanks!

This leaves me with two minor questions: . Do you know why variables are immutable and lists are mutable by design? At first glance it might seem more useful (?) if the changes to a list remain "local" to the function, just like the changes to the variable x in bla . What are elegant ways to write functions like bla2 without modifying L? Tuples don't seem to work for this purpose, so instead of bla3 just copy L inside the function via K = L[:]?

2019-12-31 11:41:55 -0500 asked a question Local/global variable behaviour of lists

(This might be, in some way, related to this bug).

I recently discovered the following behaviour, which I found quite surprising - if this is intentional, can someone please explain to me why this is supposed to happen?

def bla(x):
    x = 2

def bla2(K):
    K[0] = 2

def bla3(K):
    T = K
    T[0] = 2


x = 1
L = [1]

and then running bla(x) does not change the value of x, but running bla2(L) or bla3(L) DOES change the value of L to [2].

2019-11-26 13:28:42 -0500 commented question Bug: Gap3 interface confuses variables

Yes, the CHEVIE package - currently I'm doing some computations with braids.

2019-11-20 11:15:51 -0500 received badge  Nice Question (source)
2019-11-17 07:59:41 -0500 received badge  Editor (source)
2019-11-17 07:43:19 -0500 commented answer Entries in canonical_matrix for Coxeter groups

Woops, thanks!

2019-11-17 07:41:52 -0500 asked a question Bug: Gap3 interface confuses variables


gap3('4', name = 'x')
gap3('5', name = 'y')
gap3('6', name = 'z')

followed up by




instead of 4,5,6,4. Is this a bug or am I doing this wrong?

Update: I've tried it on a different computer (which uses a slightly older version of Sage) and did not have any issues there. I'm running the latest version of Sage here; any idea what might be causing this?

Update2: I'm experiencing the exact same problem on the other computer, when running slightly more complicated code: the gap3 interface seems to override its variables with other outputs.

2019-11-06 13:48:58 -0500 received badge  Supporter (source)
2019-11-06 13:48:53 -0500 received badge  Scholar (source)
2019-11-06 13:24:31 -0500 received badge  Student (source)
2019-11-06 13:16:53 -0500 asked a question Entries in canonical_matrix for Coxeter groups

Can anyone please tell me what a is doing in the following output? (Depending on the ordering of the Dynkin diagram, I believe it should be either 1 or 3.)

sage: W = WeylGroup(["G",2]) ; s = W.simple_reflections() ; s[2].canonical_matrix()