13 | | sage: s0 = s[0].expr(); s0 # symbolic expression OK |
14 | | -x^3 - (x^2 - x*f(x))*y + f(x) |
15 | | sage: s0.coefficient(a, 1) # incorrect output |
16 | | 0 |
17 | | }}} |
18 | | The correct result should be `x*y + 1`. The latter is obtained if one sets `nproc=1` in the first line (i.e. no parallelization). Furthermore, if one replaces the line |
19 | | {{{ |
20 | | sage: a = function('f')(x) |
21 | | }}} |
22 | | by |
23 | | {{{ |
24 | | sage: a = sin(x) |
25 | | }}} |
26 | | one gets a correct result as well. |
27 | | |
28 | | With the **python3** version of Sage 8.7.beta7, one does not get a silent failure but an error message when the parallel computation is performed, i.e. at the line `s = t.contract(v)`: |
29 | | {{{ |
30 | | TypeError Traceback (most recent call last) |
31 | | /home/eric/sage/py3/local/lib/python3.6/site-packages/sage/symbolic/function_factory.py in function_factory(name, nargs, latex_name, conversions, evalf_params_first, eval_func, evalf_func, conjugate_func, real_part_func, imag_part_func, derivative_func, tderivative_func, power_func, series_func, print_func, print_latex_func) |
32 | | 109 setattr(NewSymbolicFunction, '_%s_'%func_name, func) |
33 | | 110 |
34 | | --> 111 return NewSymbolicFunction() |
35 | | 112 |
36 | | 113 |
37 | | ... |
38 | | TypeError: expected str, bytes found |
39 | | }}} |
40 | | The full error message is attached. |
41 | | |
42 | | **UPDATE** (1 Aug. 2020): the parallel computation still fails in Sage 9.2.beta6, but this time the error message is different: |
43 | | {{{ |
44 | | sage: s = t.contract(v) |