Opened 8 years ago

Closed 8 years ago

#16591 closed defect (wontfix)

make sympy Diophantine functions work with symbolic expressions

Reported by: Ralf Stephan Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: symbolics Keywords: interface, solve, equation, integer
Cc: Merged in:
Authors: Reviewers: Volker Braun
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

This should work, shouldn't it?

sage: from sympy.solvers.diophantine import diop_solve
sage: var('x,y,m')
(x, y, m)
sage: diop_solve(2*x + 3*y - 5, m)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-10-bda9278b9cd0> in <module>()
----> 1 diop_solve(Integer(2)*x + Integer(3)*y - Integer(5), m)

/home/ralf/sage/local/lib/python2.7/site-packages/sympy/solvers/diophantine.py in diop_solve(eq, param)
    158     diophantine()
    159     """
--> 160     var, coeff, eq_type = classify_diop(eq)
    161 
    162     if eq_type == "linear":

/home/ralf/sage/local/lib/python2.7/site-packages/sympy/solvers/diophantine.py in classify_diop(eq)
    220     ([x, y], {1: 5, x: 1, x**2: 1, y: 0, y**2: 1, x*y: -1}, 'binary_quadratic')
    221     """
--> 222     eq = eq.expand(force=True)
    223     var = list(eq.free_symbols)
    224     var.sort(key=default_sort_key)

/home/ralf/sage/local/lib/python2.7/site-packages/sage/symbolic/expression.so in sage.symbolic.expression.Expression.expand (build/cythonized/sage/symbolic/expression.cpp:19411)()

TypeError: expand() got an unexpected keyword argument 'force'

Change History (2)

comment:1 Changed 8 years ago by Ralf Stephan

Milestone: sage-6.3sage-duplicate/invalid/wontfix
Status: newneeds_review

Not possible because expand() is a member function of sympy.core.function and is used as such in the resp. code.

Ticket and whole idea invalid.

comment:2 Changed 8 years ago by Volker Braun

Resolution: wontfix
Reviewers: Volker Braun
Status: needs_reviewclosed
Note: See TracTickets for help on using tickets.