These are chat archives for symengine/symengine

Jun 2015
Isuru Fernando
Jun 02 2015 08:41
@certik, all python classes in csympy_wrapper.pyx have custom __dealloc__ methods. It's okay to declare them in Basic class right?
Sumith Kulal
Jun 02 2015 08:58
Should I replace var_ in Polynomial which holding the variable of Univariate Polynomial by Basic or Symbol?
Isuru Fernando
Jun 02 2015 16:24

@certik, SymPy has I as a special symbol and 1+2*I is an Add but in SymEngine, 1+2*I is a Complex type. I started writing a class ComplexDouble which would store std::complex<double>.

One issue is that we cannot have two different types for real part and imaginary part. i.e. we cannot have 0.1+2*I as in SymPy. SymEngine would have to convert it into 0.1+2.0*Iwhich is what happens with Sage.

Ondřej Čertík
Jun 02 2015 19:20
@Sumith1896 it seems Symbols make sense, doesn't it?
@isuruf I think you can move the __dealloc__ method to Basic, if it works, i.e. run it under Valgrind, or use print statements to ensure that it is being called properly.
@isuruf regarding complex numbers, I think that's fine. I think it's much cleaner (and faster) if the whole a+b*I is handled by a numeric class. The user can decide what exact class to use for Complex numbers, whether rational complex (our current default), or ComplexDouble, or arbitrary precision floating point, etc.
Shivam Vats
Jun 02 2015 19:35
@certik In Sympy rings do not take negative exponents. One way to deal with it is to modify ring to accept it. Or we can make make individual functions multiply out the negative exponents before carrying out operations. Are there issues with modifying ring?
Same for Puiseux series.