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.Sat, 26 Sep 2020 20:05:34 +0200metric to christoffel symbols yielding overflowhttps://ask.sagemath.org/question/53558/metric-to-christoffel-symbols-yielding-overflow/In a Sage 9.1 Jupyter notebook I tried the following SageManifolds commands
M = Manifold(4, 'M', structure='Lorentzian')
Mani.<t,X,rh,ph> = M.chart(r"t X:(-oo,+oo) rh:(0,+oo):\rho ph:(0,2*pi):\phi")
B = function('B')(X,rh,ph)
d_Ph_X = function('d_Ph_X')(X,rh,ph)
d_Ph_rh = function('d_Ph_rh')(X,rh,ph)
d_Ph_ph = function('d_Ph_ph')(X,rh,ph)
g = M.metric()
g[0,0] = (-1+B**2* ((d_Ph_X/B**2)**2 +(d_Ph_rh/B**2)**2 +((1/rh*d_Ph_ph/B**2)**2 )))
g[1,1] = B**2
g[2,2] = B**2
g[3,3] = rh**2*B**2
g[0,1] = B**2*(d_Ph_X/B**2)
g[0,2] = B**2*( d_Ph_rh/B**2)
g[0,3] = B**2*( d_Ph_ph/B**2)
g.christoffel_symbols_display()
The last line makes the notebook overflow... i really don't understand why.
the computation, even if it is rather tedious, seems straightforward to me...
Any idea? Any help would be greatly appreciated.Wed, 23 Sep 2020 21:56:09 +0200https://ask.sagemath.org/question/53558/metric-to-christoffel-symbols-yielding-overflow/Answer by eric_g for <p>In a Sage 9.1 Jupyter notebook I tried the following SageManifolds commands</p>
<pre><code>M = Manifold(4, 'M', structure='Lorentzian')
Mani.<t,X,rh,ph> = M.chart(r"t X:(-oo,+oo) rh:(0,+oo):\rho ph:(0,2*pi):\phi")
B = function('B')(X,rh,ph)
d_Ph_X = function('d_Ph_X')(X,rh,ph)
d_Ph_rh = function('d_Ph_rh')(X,rh,ph)
d_Ph_ph = function('d_Ph_ph')(X,rh,ph)
g = M.metric()
g[0,0] = (-1+B**2* ((d_Ph_X/B**2)**2 +(d_Ph_rh/B**2)**2 +((1/rh*d_Ph_ph/B**2)**2 )))
g[1,1] = B**2
g[2,2] = B**2
g[3,3] = rh**2*B**2
g[0,1] = B**2*(d_Ph_X/B**2)
g[0,2] = B**2*( d_Ph_rh/B**2)
g[0,3] = B**2*( d_Ph_ph/B**2)
g.christoffel_symbols_display()
</code></pre>
<p>The last line makes the notebook overflow... i really don't understand why.</p>
<p>the computation, even if it is rather tedious, seems straightforward to me...</p>
<p>Any idea? Any help would be greatly appreciated.</p>
https://ask.sagemath.org/question/53558/metric-to-christoffel-symbols-yielding-overflow/?answer=53564#post-id-53564You should simplify $g_{00}$ in the input, via
g[0,0] = (-1+B**2* ((d_Ph_X/B**2)**2 +(d_Ph_rh/B**2)**2 +((1/rh*d_Ph_ph/B**2)**2 ))).simplify_full()
Then it works: the Christoffel symbols are displayed in 2 min on my computer. Thu, 24 Sep 2020 11:25:59 +0200https://ask.sagemath.org/question/53558/metric-to-christoffel-symbols-yielding-overflow/?answer=53564#post-id-53564Comment by drwbia for <p>You should simplify $g_{00}$ in the input, via</p>
<pre><code>g[0,0] = (-1+B**2* ((d_Ph_X/B**2)**2 +(d_Ph_rh/B**2)**2 +((1/rh*d_Ph_ph/B**2)**2 ))).simplify_full()
</code></pre>
<p>Then it works: the Christoffel symbols are displayed in 2 min on my computer. </p>
https://ask.sagemath.org/question/53558/metric-to-christoffel-symbols-yielding-overflow/?comment=53598#post-id-53598thx a lot for your time/insight! actually it did not work on my computer with sage 9.1 and it did work on the 1st attempt with sage 8.9, something really is different with 9.1 i guess... by the way using sage 8.9 also enabled me to retrieve all my .sws which were completely impossible to load on sage 9.1... life is strange sometimes ;) --> i now am a happy sage 8.9 userFri, 25 Sep 2020 19:54:26 +0200https://ask.sagemath.org/question/53558/metric-to-christoffel-symbols-yielding-overflow/?comment=53598#post-id-53598Comment by eric_g for <p>You should simplify $g_{00}$ in the input, via</p>
<pre><code>g[0,0] = (-1+B**2* ((d_Ph_X/B**2)**2 +(d_Ph_rh/B**2)**2 +((1/rh*d_Ph_ph/B**2)**2 ))).simplify_full()
</code></pre>
<p>Then it works: the Christoffel symbols are displayed in 2 min on my computer. </p>
https://ask.sagemath.org/question/53558/metric-to-christoffel-symbols-yielding-overflow/?comment=53599#post-id-53599For me, it works well with Sage 9.1. Maybe something is weird with your Sage 9.1 install? How did you install it?Fri, 25 Sep 2020 21:41:05 +0200https://ask.sagemath.org/question/53558/metric-to-christoffel-symbols-yielding-overflow/?comment=53599#post-id-53599Comment by eric_g for <p>You should simplify $g_{00}$ in the input, via</p>
<pre><code>g[0,0] = (-1+B**2* ((d_Ph_X/B**2)**2 +(d_Ph_rh/B**2)**2 +((1/rh*d_Ph_ph/B**2)**2 ))).simplify_full()
</code></pre>
<p>Then it works: the Christoffel symbols are displayed in 2 min on my computer. </p>
https://ask.sagemath.org/question/53558/metric-to-christoffel-symbols-yielding-overflow/?comment=53600#post-id-53600Regarding the .sws issue: you should take the opportunity of having a running Sage 8.9 to convert all your *.sws files to *.ipynb (Jupyter format). See this [post](https://ask.sagemath.org/question/53463/how-to-move-from-notebook-to-jupyter/).Fri, 25 Sep 2020 21:45:39 +0200https://ask.sagemath.org/question/53558/metric-to-christoffel-symbols-yielding-overflow/?comment=53600#post-id-53600Comment by drwbia for <p>You should simplify $g_{00}$ in the input, via</p>
<pre><code>g[0,0] = (-1+B**2* ((d_Ph_X/B**2)**2 +(d_Ph_rh/B**2)**2 +((1/rh*d_Ph_ph/B**2)**2 ))).simplify_full()
</code></pre>
<p>Then it works: the Christoffel symbols are displayed in 2 min on my computer. </p>
https://ask.sagemath.org/question/53558/metric-to-christoffel-symbols-yielding-overflow/?comment=53613#post-id-53613@eric_g --> I installed it via conda
---------------------
conda install mamba -c conda-forge # installs mamba
---------------------
mamba create -n sage sage -c conda-forge # replaces "conda create..."
---------------------
indeed you're right about the converting process that i should follow, thx
I just found out that doing what you said indeed enabled the computation on my computer. without any modification of the memory available for sage.
However a rather small modification of this metric does not work even with simplify_full, whereas it does with sage 8.9 (yielding "unreasonably" long expressions ^^)Sat, 26 Sep 2020 18:22:41 +0200https://ask.sagemath.org/question/53558/metric-to-christoffel-symbols-yielding-overflow/?comment=53613#post-id-53613Comment by drwbia for <p>You should simplify $g_{00}$ in the input, via</p>
<pre><code>g[0,0] = (-1+B**2* ((d_Ph_X/B**2)**2 +(d_Ph_rh/B**2)**2 +((1/rh*d_Ph_ph/B**2)**2 ))).simplify_full()
</code></pre>
<p>Then it works: the Christoffel symbols are displayed in 2 min on my computer. </p>
https://ask.sagemath.org/question/53558/metric-to-christoffel-symbols-yielding-overflow/?comment=53614#post-id-53614B = function('B')(X,rh)
--
d_Ph_X = function('d_Ph_X')(X,rh,ph)
--
d_Ph_rh = function('d_Ph_rh')(X,rh,ph)
--
d_Ph_ph = function('d_Ph_ph')(X,rh,ph)
--
P = function('P')(t)
--
g = M.metric()
--
g[0,0] = (-1+B**2* ((P+d_Ph_X/B**2)**2 +(d_Ph_rh/B**2)**2 +((1/rh*d_Ph_ph/B**2)**2 ))).simplify_full()
--
g[1,1] = (B**2).simplify_full()
--
g[2,2] = (B**2).simplify_full()
--
g[3,3] = (rh**2*B**2).simplify_full()
--
g[0,1] = (B**2*(P+d_Ph_X/B**2)).simplify_full()
--
g[0,2] = (B**2*( d_Ph_rh/B**2)).simplify_full
--
g[0,2] = (B**2*( d_Ph_rh/B**2)).simplify_full()
--
g[0,3] = (B**2*( d_Ph_ph/B**2)).simplify_full()
--
g.display()
--
g.christoffel_symbols_display()Sat, 26 Sep 2020 20:05:34 +0200https://ask.sagemath.org/question/53558/metric-to-christoffel-symbols-yielding-overflow/?comment=53614#post-id-53614