2 from timeit
import default_timer
as clock
3 from sympy
import Symbol
, Add
, Mul
, Integer
, multinomial_coefficients
25 a
= multinomial_coefficients(4, N
)
26 b
= multinomial_coefficients(4, 2*N
)
29 t_mul
= clock() - t_mul
31 print "# of terms:", len(a2
.args
)
32 print "time doing multinomial_coefficients:", t_mul
33 print "total time2:", t_tot
35 #from sympy import ADD, MUL, POW, INTEGER, SYMBOL
40 # return sympy.Add(*[csympy2sympy(x) for x in a.args])
42 # return sympy.Mul(*[csympy2sympy(x) for x in a.args])
44 # return sympy.Pow(*[csympy2sympy(x) for x in a.args])
45 # elif a.type == INTEGER:
46 # return sympy.sympify(str(a))
47 # elif a.type == SYMBOL:
48 # return sympy.sympify(str(a))
50 # raise NotImplementedError("sorry")
52 #e_sympy = csympy2sympy(e)
53 #a2_sympy = doit2(e_sympy)[0]
54 #a2_csympy = csympy2sympy(a2)
55 #print "comparison with sympy:"
56 #print a2_sympy == a2_csympy