Continuing with the example first discussed on ask.sagemath.org and 
graciously corrected/answered by Eric G, I now find that setting *nproc* to 
anything but *1* in the following will cause the last line to give 
incorrect results.

I am running sagemath version 8.5. According to trac, this should contain 
the last fix to parallelization on manifolds (ticket #26777), so it looks 
to me like a new bug.

sage: version()
'SageMath version 8.5, Release Date: 2018-12-22'
sage: ##
sage: ## If the following sets nproc>1, the last line in this script gives all 
zeroes, which is incorrect.
sage: ##
sage: Parallelism().set(nproc=1)
sage: #Patch to avoid maxima bug
sage: maxima_calculus.eval("domain:real;")
'real'
sage: M = Manifold(3,'R^3',field='real',start_index=1)
sage: c_C.<x,y,z> = M.chart();
sage: c_C.add_restrictions(z>0)
sage: g = M.riemannian_metric('g');
sage: g[1,1],g[2,2],g[3,3] = 1,1,1; 
sage: g.display()
g = dx*dx + dy*dy + dz*dz
sage: c_S.<r,theta,phi> = M.chart(r'r:(0,+oo) theta:(0,pi/2):\theta 
phi:(0,2*pi):\phi');
sage: ch_C_S = c_C.transition_map(c_S, (sqrt(x^2+y^2+z^2), 
arccos(z/(sqrt(x^2+y^2+z^2))), arctan2(y,x)))
sage: ch_C_S
Change of coordinates from Chart (R^3, (x, y, z)) to Chart (R^3, (r, theta, 
phi))
sage: ch_C_S.set_inverse(r*sin(theta)*cos(phi), r*sin(theta)*sin(phi), 
r*cos(theta))
sage: M.set_default_chart(c_S)    # this saves a little typing later
sage: M.set_default_frame(c_S.frame())
sage: g.display()
g = dr*dr + r^2 dtheta*dtheta + r^2*sin(theta)^2 dphi*dphi
sage: chi_s = M.scalar_field({c_S:function('chi')(r,theta,phi)}, name='chi', 
latex_name=r'\chi')
sage: delChi = chi_s.laplacian(g)
sage: ddChi = delChi.expr()
sage: ddChi.collect_common_factors()
((r^2*diff(chi(r, theta, phi), r, r) + 2*r*diff(chi(r, theta, phi), r) + 
diff(chi(r, theta, phi), theta, theta))*sin(theta)^2 + 
cos(theta)*sin(theta)*diff(chi(r, theta, phi), theta) + diff(chi(r, theta, 
phi), phi, phi))/(r^2*sin(theta)^2)
sage: ddChi.coefficient(r,2)
diff(chi(r, theta, phi), r, r)/r^2
sage: for coord in [r, theta, phi]:
...       for order in [1, 2]:
...           der = diff(chi(r,theta,phi), coord, order)
...           print("{}:  {}".format(der, ddChi.coefficient(der, 1)))
diff(chi(r, theta, phi), r):  2/r
diff(chi(r, theta, phi), r, r):  1
diff(chi(r, theta, phi), theta):  cos(theta)/(r^2*sin(theta))
diff(chi(r, theta, phi), theta, theta):  r^(-2)
diff(chi(r, theta, phi), phi):  0
diff(chi(r, theta, phi), phi, phi):  1/(r^2*sin(theta)^2)

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to