# Ticket #9634: trac_9634-symbolic_binomial.patch

File trac_9634-symbolic_binomial.patch, 13.0 KB (added by burcin, 3 years ago)

make the top level binomial() function symbolic

• ## sage/combinat/all.py

```# HG changeset patch
# User Burcin Erocal <burcin@erocal.org>
# Date 1286810031 -7200
# Node ID c395ccfdf295be9b70c17d9a231a6960ec8f3434
# Parent  ab64f6839bd9f0b57c418594fa03efa2a863caef
trac 9634: Use the symbolic binomial function defined in sage.functions.other at the top level, instead of the one defined in sage.rings.arith.

diff --git a/sage/combinat/all.py b/sage/combinat/all.py```
 a from combinat import * from combinat import bell_number, catalan_number, euler_number, fibonacci, \ lucas_number1, lucas_number2, stirling_number1, stirling_number2, \ CombinatorialObject, CombinatorialClass, FilteredCombinatorialClass, \ UnionCombinatorialClass, MapCombinatorialClass, \ InfiniteAbstractCombinatorialClass, \ hurwitz_zeta, combinations, combinations_iterator, \ number_of_combinations, arrangements, number_of_arrangements, \ derangements, number_of_derangements, tuples, number_of_tuples, \ unordered_tuples, number_of_unordered_tuples, permutations, \ permutations_iterator, number_of_permutations, cyclic_permutations, \ cyclic_permutations_iterator, bell_polynomial, fibonacci_sequence, \ fibonacci_xrange, bernoulli_polynomial from expnums import expnums from sage.combinat.crystals.all import *
• ## sage/combinat/alternating_sign_matrix.py

`diff --git a/sage/combinat/alternating_sign_matrix.py b/sage/combinat/alternating_sign_matrix.py`
 a from combinat import CombinatorialClass from sage.matrix.matrix_space import MatrixSpace from sage.rings.all import ZZ, factorial from sage.rings.all import ZZ from sage.rings.arith import factorial from sage.sets.set import Set from sage.misc.misc import prod import copy
• ## sage/combinat/combination.py

`diff --git a/sage/combinat/combination.py b/sage/combinat/combination.py`
 a #***************************************************************************** from sage.interfaces.all import gap from sage.rings.all import ZZ, Integer, binomial from sage.rings.all import ZZ, Integer from sage.rings.arith import binomial from combinat import CombinatorialClass from choose_nk import rank, from_rank from integer_vector import IntegerVectors
• ## sage/combinat/composition_signed.py

`diff --git a/sage/combinat/composition_signed.py b/sage/combinat/composition_signed.py`
 a from combinat import CombinatorialClass import composition import cartesian_product from sage.rings.all import binomial, Integer from sage.rings.all import Integer from sage.rings.arith import binomial import __builtin__ def SignedCompositions(n):
• ## sage/combinat/lyndon_word.py

`diff --git a/sage/combinat/lyndon_word.py b/sage/combinat/lyndon_word.py`
 a from combinat import CombinatorialClass from sage.combinat.composition import Composition, Compositions from sage.rings.all import factorial, divisors, gcd, moebius, Integer from sage.rings.all import divisors, gcd, moebius, Integer from sage.rings.arith import factorial from sage.misc.misc import prod import __builtin__ import necklace
• ## sage/combinat/partition.py

`diff --git a/sage/combinat/partition.py b/sage/combinat/partition.py`
 a #***************************************************************************** from sage.interfaces.all import gap, gp from sage.rings.all import QQ, ZZ, infinity, factorial, gcd from sage.rings.all import QQ, ZZ, infinity, gcd from sage.rings.arith import factorial from sage.misc.all import prod from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing import sage.combinat.misc as misc
• ## sage/combinat/permutation.py

`diff --git a/sage/combinat/permutation.py b/sage/combinat/permutation.py`
 a #                  http://www.gnu.org/licenses/ #***************************************************************************** from sage.interfaces.all import gap from sage.rings.all import ZZ, Integer, PolynomialRing, factorial from sage.rings.all import ZZ, Integer, PolynomialRing from sage.rings.arith import factorial from sage.matrix.all import matrix from sage.combinat.tools import transitive_ideal import sage.combinat.subword as subword
• ## sage/combinat/sf/ns_macdonald.py

`diff --git a/sage/combinat/sf/ns_macdonald.py b/sage/combinat/sf/ns_macdonald.py`
 a from sage.combinat.words.word import Word from sage.combinat.combination import Combinations from sage.combinat.permutation import Permutation from sage.rings.all import QQ, PolynomialRing, prod from sage.rings.all import QQ, PolynomialRing from sage.misc.misc import prod from sage.combinat.backtrack import GenericBacktracker import copy
• ## sage/combinat/skew_tableau.py

`diff --git a/sage/combinat/skew_tableau.py b/sage/combinat/skew_tableau.py`
 a #                  http://www.gnu.org/licenses/ #***************************************************************************** from sage.rings.all import Integer, factorial from sage.rings.all import Integer from sage.rings.arith import factorial from sage.misc.misc import uniq import partition import sage.combinat.tableau
• ## sage/combinat/species/misc.py

`diff --git a/sage/combinat/species/misc.py b/sage/combinat/species/misc.py`
 a #                  http://www.gnu.org/licenses/ #***************************************************************************** from sage.groups.all import PermutationGroup, PermutationGroup_generic, PermutationGroupElement, SymmetricGroup from sage.rings.all import prod from sage.misc.misc import prod from functools import wraps def change_support(perm, support, change_perm=None):
• ## sage/combinat/species/product_species.py

`diff --git a/sage/combinat/species/product_species.py b/sage/combinat/species/product_species.py`
 a sage: S.algebraic_equation_system() [node0 - z^2] """ from sage.rings.all import prod from sage.misc.misc import prod return prod(var_mapping[operand] for operand in self._state_info)
• ## sage/combinat/species/series.py

`diff --git a/sage/combinat/species/series.py b/sage/combinat/species/series.py`
 a #***************************************************************************** from stream import Stream, Stream_class from series_order import  bounded_decrement, increment, inf, unk from sage.rings.all import Integer, Ring, prod from sage.rings.all import Integer, Ring from sage.misc.misc import prod from functools import partial from sage.misc.misc import repr_lincomb, is_iterator
• ## sage/combinat/symmetric_group_algebra.py

`diff --git a/sage/combinat/symmetric_group_algebra.py b/sage/combinat/symmetric_group_algebra.py`
 a import partition from tableau import Tableau, StandardTableaux_n, StandardTableaux_partition, StandardTableaux from sage.interfaces.all import gap from sage.rings.all import factorial, QQ, PolynomialRing from sage.rings.all import QQ, PolynomialRing from sage.rings.arith import factorial from sage.matrix.all import matrix from sage.modules.all import vector
• ## sage/combinat/words/shuffle_product.py

`diff --git a/sage/combinat/words/shuffle_product.py b/sage/combinat/words/shuffle_product.py`
 a #***************************************************************************** from sage.combinat.words.word import Word_class from sage.combinat.combinat import CombinatorialClass from sage.rings.all import binomial from sage.rings.arith import binomial from sage.combinat.integer_vector import IntegerVectors from sage.combinat.subset import Subsets
• ## sage/functions/all.py

`diff --git a/sage/functions/all.py b/sage/functions/all.py`
 a from other import ( ceil, floor, gamma, psi, factorial, from other import ( ceil, floor, gamma, psi, factorial, binomial, abs_symbolic, erf, sqrt, gamma_inc, incomplete_gamma, real_part, real,
• ## sage/matrix/matrix_integer_dense_saturation.py

`diff --git a/sage/matrix/matrix_integer_dense_saturation.py b/sage/matrix/matrix_integer_dense_saturation.py`
 a Saturation over ZZ """ from sage.rings.all import ZZ, gcd, binomial, GF from sage.rings.all import ZZ, gcd, GF from sage.rings.arith import binomial from sage.matrix.constructor import identity_matrix, random_matrix from sage.misc.misc import verbose from sage.misc.randstate import current_randstate
• ## sage/modular/modform/vm_basis.py

`diff --git a/sage/modular/modform/vm_basis.py b/sage/modular/modform/vm_basis.py`
 a import math from sage.matrix.all import MatrixSpace, Matrix from sage.rings.all import QQ, ZZ, Integer, binomial, PowerSeriesRing, O as bigO from sage.rings.all import QQ, ZZ, Integer, PowerSeriesRing, O as bigO from sage.rings.arith import binomial from sage.structure.all import Sequence from sage.libs.flint.fmpz_poly import Fmpz_poly from sage.misc.all import verbose
• ## sage/rings/all.py

`diff --git a/sage/rings/all.py b/sage/rings/all.py`
 a from contfrac import continued_fraction, CFF, ContinuedFractionField # Arithmetic from arith import * from arith import algdep, bernoulli, is_prime, is_prime_power, \ is_pseudoprime, is_pseudoprime_small_power, valuation, \ prime_powers, primes_first_n, eratosthenes, primes, \ next_prime_power, next_probable_prime, next_prime, \ previous_prime, previous_prime_power, random_prime, \ divisors, sigma, gcd, GCD, lcm, LCM, xlcm, xgcd, \ inverse_mod, get_gcd, get_inverse_mod, power_mod, \ rational_reconstruction, mqrr_rational_reconstruction, \ trial_division, factor, prime_divisors, odd_part, prime_to_m_part, \ is_square, is_squarefree, euler_phi, crt, CRT, CRT_list, CRT_basis, \ CRT_vectors, multinomial, multinomial_coefficients, \ gaussian_binomial, kronecker_symbol, kronecker, legendre_symbol, \ primitive_root, nth_prime, quadratic_residues, moebius, \ farey, continued_fraction_list, convergent, convergents, \ continuant, number_of_divisors, hilbert_symbol, hilbert_conductor, \ hilbert_conductor_inverse, falling_factorial, rising_factorial, \ integer_ceil, integer_floor, two_squares, four_squares, \ subfactorial, is_power_of_two, differences, \ sort_complex_numbers_for_display, \ fundamental_discriminant, squarefree_divisors from fast_arith import prime_range from bernoulli_mod_p import bernoulli_mod_p, bernoulli_mod_p_single
• ## sage/schemes/elliptic_curves/ell_finite_field.py

`diff --git a/sage/schemes/elliptic_curves/ell_finite_field.py b/sage/schemes/elliptic_curves/ell_finite_field.py`
 a J = polygen(GF(p),'j') if p<13: return J.parent().one() from sage.rings.all import binomial from sage.rings.arith import binomial from sage.misc.all import prod m=(p-1)//2 X,T = PolynomialRing(GF(p),2,names=['X','T']).gens()
• ## sage/schemes/elliptic_curves/heegner.py

`diff --git a/sage/schemes/elliptic_curves/heegner.py b/sage/schemes/elliptic_curves/heegner.py`
 a #    You can think this through or just type something like #      f = function('f',x); g = function('g',x); diff(f*g,6) #    into Sage to be convinced. L = rings.binomial(rE + rF, rE) * (L_E * L_F / (rings.factorial(rE+rF)) ) L = arith.binomial(rE + rF, rE) * (L_E * L_F / (arith.factorial(rE+rF)) ) #  - ||omega||^2 -- the period.  It's twice the volume of the #    period lattice.  See the following paper for a derivation:
• ## sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py

`diff --git a/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py b/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py`
 a #                  http://www.gnu.org/licenses/ #***************************************************************************** from sage.rings.all import ZZ, RR, binomial from sage.rings.all import ZZ, RR from sage.rings.arith import binomial import hyperelliptic_generic from sage.schemes.hyperelliptic_curves.hypellfrob import hypellfrob