Opened 5 years ago

# maxima interface severely broken for large input, etc.

Reported by: Owned by: was major sage-6.5 interfaces N/A

### Description

This doesn't work

```~/tmp\$ sage
│ Sage Version 6.4, Release Date: 2014-11-14                         │
...
sage: maxima.eval("""RedGauss(A,variable):=block([q,var,listeD,listeQ,i,a,l,D],
while var#[] do (
a:diff(q,var[1],2)/2,l:subst(0,var[1],diff(q,var[1])),
if a=0 and l=0 then var:rest(var)
elseif a#0 then (
listeD:append(listeD,[a]),listeQ:append(listeQ,[var[1]+l/(2*a)=0]),
q:subst(0,var[1],q)-l^2/(4*a),var:rest(var))
else (
i:2,while subst(0,var[i],diff(l,var[i]))=0 do i:i+1,
a:diff(q,var[i],2)/2,
if a#0 then (
listeD:append(liste,[a]),listeQ:append(listeQ,[var[i]+l/(2*a)=0]),q:subst(0,var[i],q)-l^2/(4*a),
var:append(rest(var,i-1-length(var)),rest(var,i)))
else (
a:diff(q,var[1],1,var[i],1),
l1:subst([var[1]=0,var[i]=0],diff(q,var[1])),li:subst([var[1]=0,var[i]=0],diff(q,var[i])),
listeD:append(listeD,[a/4,-a/4]),
listeQ:append(listeQ,[var[1]+var[i]+(l1+li)/a=0,var[1]-var[i]+(li-l1)/a=0]),
q:subst([var[1]=0,var[i]=0],q)-l1*li/a,
var:append(rest(rest(var,i-1-length(var))),rest(var,i))))),
for k:1 thru length(listeD) do D[k,k]:listeD[k],
return([D,transpose(coefmatrix(listeQ,variable))]))\$""")
```

But I guess it should:

```Maxima 5.34.1 http://maxima.sourceforge.net
using Lisp ECL 13.5.1
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) RedGauss(A,variable):=block([q,var,listeD,listeQ,i,a,l,D],
while var#[] do (
a:diff(q,var[1],2)/2,l:subst(0,var[1],diff(q,var[1])),
if a=0 and l=0 then var:rest(var)
elseif a#0 then (
listeD:append(listeD,[a]),listeQ:append(listeQ,[var[1]+l/(2*a)=0]),
q:subst(0,var[1],q)-l^2/(4*a),var:rest(var))
else (
i:2,while subst(0,var[i],diff(l,var[i]))=0 do i:i+1,
a:diff(q,var[i],2)/2,
if a#0 then (
listeD:append(liste,[a]),listeQ:append(listeQ,[var[i]+l/(2*a)=0]),q:subst(0,var[i],q)-l^2/(4*a),
var:append(rest(var,i-1-length(var)),rest(var,i)))
else (
a:diff(q,var[1],1,var[i],1),
l1:subst([var[1]=0,var[i]=0],diff(q,var[1])),li:subst([var[1]=0,var[i]=0],diff(q,var[i])),
listeD:append(listeD,[a/4,-a/4]),
listeQ:append(listeQ,[var[1]+var[i]+(l1+li)/a=0,var[1]-var[i]+(li-l1)/a=0]),
q:subst([var[1]=0,var[i]=0],q)-l1*li/a,
var:append(rest(rest(var,i-1-length(var))),rest(var,i))))),
for k:1 thru length(listeD) do D[k,k]:listeD[k],
return([D,transpose(coefmatrix(listeQ,variable))]))\$

(%i2)
```

Issues: `maxima._read_in_file_command` isn't implemented.

```sage: maxima._read_in_file_command('x')
...
NotImplementedError:
```

But even if you don't use that (instead hard coding the eval cutoff to something large), things are still broken.

This might be related to #1660. This was first reported here:

since people are starting to use SageMathCloud? as a Maxima notebook, which it would be quite good for, if only the maxima interface actually worked for large input. (It's *very* robust for small input -- just not large input.)

### comment:1 Changed 5 years ago by nbruin

```    def _read_in_file_command(self, filename):
Also, perhaps it's better to put it in `maxima.py`, because `maxima_lib.py` has very little business using this (indeed, the example mentioned in the ticket seems to work for `maxima_lib` out of the box--I don't think maxima_lib ever reverts to using files). Of course, we do so many non-standard things to maxima_lib that using that to interface with "maxima" is probably not a good idea.