ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 28 Apr 2020 16:02:56 +0200Quantum binomialshttps://ask.sagemath.org/question/7596/quantum-binomials/What is the difference between `q.analogues.q_binomial(n,k)` and `gaussian_binomial(n,k)`?
Superficially they seem to be the same.Thu, 19 Aug 2010 17:14:06 +0200https://ask.sagemath.org/question/7596/quantum-binomials/Comment by William Stein for <p>What is the difference between <code>q.analogues.q_binomial(n,k)</code> and <code>gaussian_binomial(n,k)</code>?
Superficially they seem to be the same.</p>
https://ask.sagemath.org/question/7596/quantum-binomials/?comment=23044#post-id-23044What 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?Thu, 19 Aug 2010 17:34:58 +0200https://ask.sagemath.org/question/7596/quantum-binomials/?comment=23044#post-id-23044Comment by William Stein for <p>What is the difference between <code>q.analogues.q_binomial(n,k)</code> and <code>gaussian_binomial(n,k)</code>?
Superficially they seem to be the same.</p>
https://ask.sagemath.org/question/7596/quantum-binomials/?comment=23043#post-id-23043OK, I was thrown off by underscores getting rendered in a weird way.Thu, 19 Aug 2010 17:35:43 +0200https://ask.sagemath.org/question/7596/quantum-binomials/?comment=23043#post-id-23043Answer by Jason Bandlow for <p>What is the difference between <code>q.analogues.q_binomial(n,k)</code> and <code>gaussian_binomial(n,k)</code>?
Superficially they seem to be the same.</p>
https://ask.sagemath.org/question/7596/quantum-binomials/?answer=11458#post-id-11458gaussian_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.Thu, 19 Aug 2010 17:33:23 +0200https://ask.sagemath.org/question/7596/quantum-binomials/?answer=11458#post-id-11458Comment by ccanonc for <p>gaussian_binomial is faster, for one:</p>
<pre><code>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
</code></pre>
<p>Looking at the code makes me think that <code>gaussian_binomial</code> is strictly better than <code>q_binomial</code>, and the latter should be made an alias for the former. But perhaps I'm missing something.</p>
https://ask.sagemath.org/question/7596/quantum-binomials/?comment=23042#post-id-23042What namespace is q_analogues in?Thu, 19 Aug 2010 17:36:35 +0200https://ask.sagemath.org/question/7596/quantum-binomials/?comment=23042#post-id-23042Comment by William Stein for <p>gaussian_binomial is faster, for one:</p>
<pre><code>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
</code></pre>
<p>Looking at the code makes me think that <code>gaussian_binomial</code> is strictly better than <code>q_binomial</code>, and the latter should be made an alias for the former. But perhaps I'm missing something.</p>
https://ask.sagemath.org/question/7596/quantum-binomials/?comment=23041#post-id-23041What 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_analoguesThu, 19 Aug 2010 17:37:00 +0200https://ask.sagemath.org/question/7596/quantum-binomials/?comment=23041#post-id-23041Comment by Jason Bandlow for <p>gaussian_binomial is faster, for one:</p>
<pre><code>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
</code></pre>
<p>Looking at the code makes me think that <code>gaussian_binomial</code> is strictly better than <code>q_binomial</code>, and the latter should be made an alias for the former. But perhaps I'm missing something.</p>
https://ask.sagemath.org/question/7596/quantum-binomials/?comment=23039#post-id-23039Oops, yes, i forgot to include the import statement. Thanks, William.Thu, 19 Aug 2010 17:38:46 +0200https://ask.sagemath.org/question/7596/quantum-binomials/?comment=23039#post-id-23039Comment by slelievre for <p>gaussian_binomial is faster, for one:</p>
<pre><code>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
</code></pre>
<p>Looking at the code makes me think that <code>gaussian_binomial</code> is strictly better than <code>q_binomial</code>, and the latter should be made an alias for the former. But perhaps I'm missing something.</p>
https://ask.sagemath.org/question/7596/quantum-binomials/?comment=51107#post-id-51107The various functions implementing this functionality were unified at:
- [Sage Trac ticket 14496: unify the three implementations of gaussian q-binomial coefficients](https://trac.sagemath.org/ticket/14496)Tue, 28 Apr 2020 16:02:56 +0200https://ask.sagemath.org/question/7596/quantum-binomials/?comment=51107#post-id-51107