Ask Your Question

# How to show the elements of GF(2^4) as z^k instead of a_0*1+a_1*z+a_2*z^2+a_3*z^3

Hello, Sage shows elements of $GF(2^n)$ as their decomposition in $GF(2^n)$ viewed as a vector space over $GF(2)$. But $GF(2^n)$ is also a field, whose multiplicative group is cyclic, so elements (except $0$) have a natural description as $z^k$ with $k$ in $[0..(n-1)]$. How can I make Sage reveal this?

edit retag close merge delete

## 1 Answer

Sort by ยป oldest newest most voted

If F = GF(32), then F.multiplicative_generator() returns a generator g of the cyclic group of units, and for a nonzero element a of F, if it happens to equal g^13, for example, then a._log_repr() returns the string '13'.

more

## Comments

Thank you so much, this is exactly what I was looking for!

( 2022-06-13 18:21:10 +0200 )edit

## Your Answer

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

Add Answer

## Stats

Asked: 2022-06-12 12:39:25 +0200

Seen: 210 times

Last updated: Jun 13 '22