ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 28 Mar 2017 14:51:15 +0200Covariant Derivative gives Error, why? (SAGE 7.5.1)https://ask.sagemath.org/question/36777/covariant-derivative-gives-error-why-sage-751/This simple code gives an Error:
f = function('f')
B=Manifold(2,'B',start_index=1)
polar.<R,Phi> = B.chart(R'R:(0,+oo) Phi:(0,2*pi):\Phi')
G = B.riemannian_metric('G')
G[1,1]=diff(f(R),R)
G[2,2]=f(R)^2
nabla=G.connection()
S=B.tensor_field(1,1)
S[1,1]=R^(0.5)
S[2,2]=R^3
S.display()
nabla(S)
Error: TypeError: unable to convert R to an integer
This Error doesn't occur either if I avoid the square root in S[1,1]=R^(0.5), for example by writing S[1,1]=R^(0.4) or if I avoid the dependence of the derivative of f in the first entry of the metric, for example by writing G[1,1]=f(R)^2.
This Error also doesn't occur in older Sage versions, for example Sage 7.1
Thanks a lot for help!Wed, 01 Mar 2017 16:28:32 +0100https://ask.sagemath.org/question/36777/covariant-derivative-gives-error-why-sage-751/Answer by eric_g for <p>This simple code gives an Error:</p>
<pre><code>f = function('f')
B=Manifold(2,'B',start_index=1)
polar.<R,Phi> = B.chart(R'R:(0,+oo) Phi:(0,2*pi):\Phi')
G = B.riemannian_metric('G')
G[1,1]=diff(f(R),R)
G[2,2]=f(R)^2
nabla=G.connection()
S=B.tensor_field(1,1)
S[1,1]=R^(0.5)
S[2,2]=R^3
S.display()
nabla(S)
Error: TypeError: unable to convert R to an integer
</code></pre>
<p>This Error doesn't occur either if I avoid the square root in S[1,1]=R^(0.5), for example by writing S[1,1]=R^(0.4) or if I avoid the dependence of the derivative of f in the first entry of the metric, for example by writing G[1,1]=f(R)^2.</p>
<p>This Error also doesn't occur in older Sage versions, for example Sage 7.1</p>
<p>Thanks a lot for help!</p>
https://ask.sagemath.org/question/36777/covariant-derivative-gives-error-why-sage-751/?answer=36783#post-id-36783This is a known bug, related to some recent change in the treatment of derivatives of symbolic functions, cf. [this discussion](https://groups.google.com/d/msg/sage-support/lZ4AjbmvvQE/4ZZddjLTBAAJ). In your case, the bug shows up because of both `G[1,1]=diff(f(R),R)` and the square root in `S[1,1]=R^(0.5)`.
A fix is under preparation; hopefully it will be included in Sage 7.6.
EDIT: the fix is ready, cf. the comment belowThu, 02 Mar 2017 10:32:32 +0100https://ask.sagemath.org/question/36777/covariant-derivative-gives-error-why-sage-751/?answer=36783#post-id-36783Comment by Claudia for <p>This is a known bug, related to some recent change in the treatment of derivatives of symbolic functions, cf. <a href="https://groups.google.com/d/msg/sage-support/lZ4AjbmvvQE/4ZZddjLTBAAJ">this discussion</a>. In your case, the bug shows up because of both <code>G[1,1]=diff(f(R),R)</code> and the square root in <code>S[1,1]=R^(0.5)</code>.</p>
<p>A fix is under preparation; hopefully it will be included in Sage 7.6.</p>
<p>EDIT: the fix is ready, cf. the comment below</p>
https://ask.sagemath.org/question/36777/covariant-derivative-gives-error-why-sage-751/?comment=36785#post-id-36785Thanks Eric, now that I know it is a bug, i will for now use an older version of Sage. Many greetings!Thu, 02 Mar 2017 11:18:17 +0100https://ask.sagemath.org/question/36777/covariant-derivative-gives-error-why-sage-751/?comment=36785#post-id-36785Comment by eric_g for <p>This is a known bug, related to some recent change in the treatment of derivatives of symbolic functions, cf. <a href="https://groups.google.com/d/msg/sage-support/lZ4AjbmvvQE/4ZZddjLTBAAJ">this discussion</a>. In your case, the bug shows up because of both <code>G[1,1]=diff(f(R),R)</code> and the square root in <code>S[1,1]=R^(0.5)</code>.</p>
<p>A fix is under preparation; hopefully it will be included in Sage 7.6.</p>
<p>EDIT: the fix is ready, cf. the comment below</p>
https://ask.sagemath.org/question/36777/covariant-derivative-gives-error-why-sage-751/?comment=36794#post-id-36794The fix is ready, as [Trac ticket 22503](https://trac.sagemath.org/ticket/22503). Without waiting for Sage 7.6, you can already use it in Sage 7.5.1 by running the following commands from your Sage root directory:
git remote add trac git://trac.sagemath.org/sage.git -t master
git pull trac public/manifolds/bug-22503
./sage -bThu, 02 Mar 2017 22:25:03 +0100https://ask.sagemath.org/question/36777/covariant-derivative-gives-error-why-sage-751/?comment=36794#post-id-36794Comment by Claudia for <p>This is a known bug, related to some recent change in the treatment of derivatives of symbolic functions, cf. <a href="https://groups.google.com/d/msg/sage-support/lZ4AjbmvvQE/4ZZddjLTBAAJ">this discussion</a>. In your case, the bug shows up because of both <code>G[1,1]=diff(f(R),R)</code> and the square root in <code>S[1,1]=R^(0.5)</code>.</p>
<p>A fix is under preparation; hopefully it will be included in Sage 7.6.</p>
<p>EDIT: the fix is ready, cf. the comment below</p>
https://ask.sagemath.org/question/36777/covariant-derivative-gives-error-why-sage-751/?comment=36804#post-id-36804Great, I did, it works.Fri, 03 Mar 2017 14:39:05 +0100https://ask.sagemath.org/question/36777/covariant-derivative-gives-error-why-sage-751/?comment=36804#post-id-36804Comment by eric_g for <p>This is a known bug, related to some recent change in the treatment of derivatives of symbolic functions, cf. <a href="https://groups.google.com/d/msg/sage-support/lZ4AjbmvvQE/4ZZddjLTBAAJ">this discussion</a>. In your case, the bug shows up because of both <code>G[1,1]=diff(f(R),R)</code> and the square root in <code>S[1,1]=R^(0.5)</code>.</p>
<p>A fix is under preparation; hopefully it will be included in Sage 7.6.</p>
<p>EDIT: the fix is ready, cf. the comment below</p>
https://ask.sagemath.org/question/36777/covariant-derivative-gives-error-why-sage-751/?comment=37104#post-id-37104The fix is now available in the just released [Sage 7.6](http://www.sagemath.org/).Tue, 28 Mar 2017 14:51:15 +0200https://ask.sagemath.org/question/36777/covariant-derivative-gives-error-why-sage-751/?comment=37104#post-id-37104