#14496: unify the three implementations of gaussian q-binomial coefficients
-------------------------------------+--------------------------------------
Reporter: chapoton | Owner: tbd
Type: task | Status: needs_work
Priority: major | Milestone: sage-5.10
Component: PLEASE CHANGE | Resolution:
Keywords: gaussian binomial | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
-------------------------------------+--------------------------------------
Changes (by fwclarke):
* status: needs_review => needs_work
Comment:
This looks good. It's certainly nice to have integer parameters giving
integer results.
But `n//d` can causes problems if `q` takes a real value, and similarly in
some other cases. Perhaps this should be a "`try:`", with the exception
giving `n/d` or even `gaussian_binomial(n, k)(q)`. [It is surely not
necessary to introduce `var` when this occurs before.]
I also don't like the way (inherited from the existing code) that `n`
plays two very different rĂ´les; the line
{{{
n = prod([1 - q**i for i in range(n-k+1,n+1)])
}}}
is particularly bad style. It would make the code more readable to call
them "`numerator`" and "`denominator`" (possibly abbreviated)
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14496#comment:3>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.