Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Evaluating expressions with zetan for insertion into numpy array

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.