Ask Your Question

Quantum binomials

asked 2010-08-19 10:14:06 -0600

BWW gravatar image

updated 2015-07-31 11:02:00 -0600

FrédéricC gravatar image

What is the difference between q.analogues.q_binomial(n,k) and gaussian_binomial(n,k)? Superficially they seem to be the same.

edit retag flag offensive close merge delete


What is "qbinomial" or "q.analgoues"? I can't find anything like that. Can you post a complete example to make this question easier to answer?

William Stein gravatar imageWilliam Stein ( 2010-08-19 10:34:58 -0600 )edit

OK, I was thrown off by underscores getting rendered in a weird way.

William Stein gravatar imageWilliam Stein ( 2010-08-19 10:35:43 -0600 )edit

1 answer

Sort by » oldest newest most voted

answered 2010-08-19 10:33:23 -0600

Jason Bandlow gravatar image

updated 2011-01-03 15:37:58 -0600

kcrisman gravatar image

gaussian_binomial is faster, for one:

sage: %timeit a=q_analogues.q_binomial(20,10)
25 loops, best of 3: 8.45 ms per loop
sage: %timeit a=gaussian_binomial(20,10)
625 loops, best of 3: 1.52 ms per loop

Looking at the code makes me think that gaussian_binomial is strictly better than q_binomial, and the latter should be made an alias for the former. But perhaps I'm missing something.

edit flag offensive delete link more


What namespace is q_analogues in?

ccanonc gravatar imageccanonc ( 2010-08-19 10:36:35 -0600 )edit

What is this q_analogues? For people who want to try the above, you have to first type sage: import sage.combinat.q_analogues as q_analogues

William Stein gravatar imageWilliam Stein ( 2010-08-19 10:37:00 -0600 )edit

Oops, yes, i forgot to include the import statement. Thanks, William.

Jason Bandlow gravatar imageJason Bandlow ( 2010-08-19 10:38:46 -0600 )edit

The various functions implementing this functionality were unified at:

slelievre gravatar imageslelievre ( 2020-04-28 09:02:56 -0600 )edit

Your Answer

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

Add Answer

Question Tools


Asked: 2010-08-19 10:14:06 -0600

Seen: 237 times

Last updated: Jan 03 '11