Ask Your Question

Bob67846's profile - activity

2024-02-26 23:52:22 +0200 received badge  Notable Question (source)
2024-02-26 23:52:22 +0200 received badge  Popular Question (source)
2023-02-01 14:54:07 +0200 received badge  Notable Question (source)
2023-02-01 14:54:07 +0200 received badge  Popular Question (source)
2021-03-12 04:49:52 +0200 received badge  Famous Question (source)
2021-03-12 04:49:52 +0200 received badge  Notable Question (source)
2021-03-12 04:49:52 +0200 received badge  Popular Question (source)
2020-01-11 22:18:37 +0200 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 23:05:24 +0200 asked a question Eigenvalues and eigenspaces of orthogonal (or rotation) matrices

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

Matrix([[0,0,0,-1],[1,0,0,-1],[0,1,0,-1],[0,0,1,-1]])

Its eigenvalues are going to be of the form

exp(I*pi/5),exp(2*I*pi/5),...,exp(2*I*pi*m),...

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-05 02:20:41 +0200 commented answer Cython: undeclared name not builtin

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

2020-01-04 22:15:51 +0200 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 21:11:55 +0200 commented answer Cython: undeclared name not builtin

Thanks, this was helpful - the right answer is

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

Loading a .spyx file with

 def bla(W):
    RootSystem(W.cartan_type())

yields

undeclared name not builtin: RootSystem

Is there a library that I need to include?

2020-01-01 02:46:37 +0200 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 18:41:55 +0200 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

Defining

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 20:28:42 +0200 commented question Bug: Gap3 interface confuses variables

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

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

Woops, thanks!

2019-11-17 14:41:52 +0200 asked a question Bug: Gap3 interface confuses variables

Running

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

followed up by

gap3('x')
gap3('y')
gap3('z')
gap3('x')

yields

4
5
6
6

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 20:48:58 +0200 received badge  Supporter (source)
2019-11-06 20:48:53 +0200 received badge  Scholar (source)
2019-11-06 20:24:31 +0200 received badge  Student (source)
2019-11-06 20:16:53 +0200 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()