Loading [MathJax]/jax/output/HTML-CSS/jax.js

First time here? Check out the FAQ!

Ask Your Question
0

Evaluating expressions with zetan for insertion into numpy array

asked 1 year ago

ayodan gravatar image

I'm working with the character table of the centralizer for Z4: G = CyclicPermutationGroup(4) followed by t = G.character_table() yields

[     1      1      1      1]
[     1     -1      1     -1]
[     1 -zeta4     -1  zeta4]
[     1  zeta4     -1 -zeta4]

I'm trying to simplify results of calculations using this table for insertion into numpy arrays (these results simply involve adding and multiplying elements of the table). For example, let us consider f = t[1,3] - 4 * t[3,3] which evaluates to -4*zeta4 - 1. I've tried using AlgebraicConverter and .arithmetic() functionalities.

a = AlgebraicConverter(QQbar)
a.arithmetic(f, f.operator())

I obtain the following error

AttributeError: 'sage.rings.number_field.number_field_element.NumberFieldElement_absolute' object has no attribute 'operator'

Advice on how to remedy this error or how to follow a better approach would be greatly appreciated.

Preview: (hide)

Comments

Do you mean something like this :

sage: G = CyclicPermutationGroup(4)
sage: t = G.character_table()
sage: t[1,3]-4*t[3,3]
-4*zeta4 - 1
sage: import numpy
sage: numpy.complex64((t[1,3]-4*t[3,3]))
(-1-4j)
Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 1 year ago )

Yes thank you!

ayodan gravatar imageayodan ( 1 year ago )

1 Answer

Sort by » oldest newest most voted
1

answered 1 year ago

Emmanuel Charpentier gravatar image

In order to give an explicit answer to this question for the enefit of future perusers, I copy my previous comment :

sage: G = CyclicPermutationGroup(4)
sage: t = G.character_table()
sage: t[1,3]-4*t[3,3]
-4*zeta4 - 1
sage: import numpy
sage: numpy.complex64((t[1,3]-4*t[3,3]))
(-1-4j)

HTH,

Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 1 year ago

Seen: 153 times

Last updated: Sep 27 '23