Ask Your Question
0

Count GF(q) arithmetics

asked 2020-06-14 16:26:02 +0100

Taylor Huang gravatar image

Hi, I was trying to count the number of basic arithmetics happened in a GF(q)[x] or GF(q)[x].quo(irr) operation. I turned to define a wrapper class

Fq = GF(q)
class probeFq(Fq):
  def __init__(self,*p,**kw):
    self._cnt = 0
    super(probeFq,self).__init__(*p,**kw)
  def __add__(self, *p,**kw):
    self._cnt += 1
    return super(probeFq,self).__add__(*p,**kw)

However, I turns out that GF(q) in sage is not a class. Instead it is some sort of factory object. Is there any way to count the number of arithmetics happened to an element?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-06-15 01:09:29 +0100

slelievre gravatar image

The profiling tools available in Sage might be what you are after.

See the

edit flag offensive delete link more

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: 2020-06-14 16:26:02 +0100

Seen: 237 times

Last updated: Jun 15 '20