# Ticket #13011: trac_13011.patch

File trac_13011.patch, 1.8 KB (added by William Stein, 11 years ago)
• ## sage/interfaces/mathematica.py

```# HG changeset patch
# User William Stein <wstein@gmail.com>
# Date 1337968618 25200
# Node ID f3b4868661208951a7c2e2d3bf58c371a7c2335d
# Parent  19ab641989626403bb4ee4ae4efdb93de31892d2
Trac #13011: several optional tests fail in the sage/mathematica interface with mathematica 8.0

diff --git a/sage/interfaces/mathematica.py b/sage/interfaces/mathematica.py```
 a 2 {x  - 3 y == 3, 2 x - y == 1} sage: sys.Solve('{x, y}')               # optional - mathematica {{y -> -1, x -> 0}, {y -> 11, x -> 6}} {{x -> 0, y -> -1}, {x -> 6, y -> 11}} Assignments and definitions ~~~~~~~~~~~~~~~~~~~~~~~~~~~ sage: v = m([eq1, eq2]); v              # optional - mathematica {x^2 - 3*y == 3, 2*x - y == 1} sage: v.Solve(['x', 'y'])               # optional - mathematica {{y -> -1, x -> 0}, {y -> 11, x -> 6}} {{x -> 0, y -> -1}, {x -> 6, y -> 11}} Function definitions ~~~~~~~~~~~~~~~~~~~~ return -1  # everything is supposed to be comparable in Python, so we define # the comparison thus when no comparable in interfaced system. def N(self, *args): """ EXAMPLES:: sage: mathematica('Pi').N(10) 3.1415926536 sage: mathematica('Pi').N(50) 3.14159265358979323846264338327950288419716939937511 """ # The base class way up the hierarchy defines an "N" (modeled # after Mathematica's!)  which overwrites the Mathematica one, # and doesn't work at all. We restore it here. return self.parent().N(self, *args) class MathematicaFunction(ExpectFunction): def _sage_doc_(self): M = self._parent