ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 01 Dec 2016 08:33:14 -0600Error with metrichttp://ask.sagemath.org/question/35814/error-with-metric/ Hi,
I am learning Sage Math and Sage Manifolds. As in the reference manual, I just used the command:
**M = Manifold(4, 'M')**
**g = M.lorentz_metric('g')**
Running the second line gave me the following message:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_sage_input_10.py", line 10, in <module>
exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("ZyA9IE0ubG9yZW50el9tZXRyaWMoJ2cnKQ=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
File "", line 1, in <module>
File "/private/var/folders/hw/dshmtl910nb4nk8_pc8f7ldr0000gn/T/tmptEzTup/___code___.py", line 2, in <module>
exec compile(u"g = M.lorentz_metric('g')" + '\n', '', 'single')
File "", line 1, in <module>
File "sage/structure/category_object.pyx", line 834, in sage.structure.category_object.CategoryObject.__getattr__ (/Applications/SageMath-7.4.app/Contents/Resources/sage/src/build/cythonized/sage/structure/category_object.c:7515)
File "sage/structure/category_object.pyx", line 849, in sage.structure.category_object.CategoryObject.getattr_from_category (/Applications/SageMath-7.4.app/Contents/Resources/sage/src/build/cythonized/sage/structure/category_object.c:7679)
File "sage/structure/misc.pyx", line 295, in sage.structure.misc.getattr_from_other_class (/Applications/SageMath-7.4.app/Contents/Resources/sage/src/build/cythonized/sage/structure/misc.c:1697)
AttributeError: 'DifferentiableManifold_with_category' object has no attribute 'lorentz_metric'
I appreciate it if somebody would give me some advice. Thanks.Wed, 30 Nov 2016 02:23:31 -0600http://ask.sagemath.org/question/35814/error-with-metric/Answer by eric_g for <p>Hi,</p>
<p>I am learning Sage Math and Sage Manifolds. As in the reference manual, I just used the command:</p>
<p><strong>M = Manifold(4, 'M')</strong></p>
<p><strong>g = M.lorentz_metric('g')</strong></p>
<p>Running the second line gave me the following message:</p>
<p>Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_sage_input_10.py", line 10, in <module>
exec compile(u'open("___code___.py","w").write("# -<em>- coding: utf-8 -</em>-\n" + _support_.preparse_worksheet_cell(base64.b64decode("ZyA9IE0ubG9yZW50el9tZXRyaWMoJ2cnKQ=="),globals())+"\n"); execfile(os.path.abspath("___code___.py"))
File "", line 1, in <module></p>
<p>File "/private/var/folders/hw/dshmtl910nb4nk8_pc8f7ldr0000gn/T/tmptEzTup/___code___.py", line 2, in <module>
exec compile(u"g = M.lorentz_metric('g')" + '\n', '', 'single')
File "", line 1, in <module></p>
<p>File "sage/structure/category_object.pyx", line 834, in sage.structure.category_object.CategoryObject.__getattr__ (/Applications/SageMath-7.4.app/Contents/Resources/sage/src/build/cythonized/sage/structure/category_object.c:7515)
File "sage/structure/category_object.pyx", line 849, in sage.structure.category_object.CategoryObject.getattr_from_category (/Applications/SageMath-7.4.app/Contents/Resources/sage/src/build/cythonized/sage/structure/category_object.c:7679)
File "sage/structure/misc.pyx", line 295, in sage.structure.misc.getattr_from_other_class (/Applications/SageMath-7.4.app/Contents/Resources/sage/src/build/cythonized/sage/structure/misc.c:1697)
AttributeError: 'DifferentiableManifold_with_category' object has no attribute 'lorentz_metric'</p>
<p>I appreciate it if somebody would give me some advice. Thanks.</p>
http://ask.sagemath.org/question/35814/error-with-metric/?answer=35817#post-id-35817It's because SageManifolds is not fully installed on your computer. Probably, you are using the limited version of SageManifolds which is included in SageMath 7.4. This version does not contain the metrics (nor any tensor field calculus). The next release of SageMath (i.e. 7.5) will contain the totality of SageManifolds. Meanwhile, you have to install SageManifolds atop SageMath 7.4 by following
[these instructions](http://sagemanifolds.obspm.fr/download.html).
Another option is to use the SageMathCloud, where SageManifolds is installed system-wide in the SageMath 7.4 kernels of Jupyter notebooks.Wed, 30 Nov 2016 07:50:38 -0600http://ask.sagemath.org/question/35814/error-with-metric/?answer=35817#post-id-35817Comment by eric_g for <p>It's because SageManifolds is not fully installed on your computer. Probably, you are using the limited version of SageManifolds which is included in SageMath 7.4. This version does not contain the metrics (nor any tensor field calculus). The next release of SageMath (i.e. 7.5) will contain the totality of SageManifolds. Meanwhile, you have to install SageManifolds atop SageMath 7.4 by following
<a href="http://sagemanifolds.obspm.fr/download.html">these instructions</a>.</p>
<p>Another option is to use the SageMathCloud, where SageManifolds is installed system-wide in the SageMath 7.4 kernels of Jupyter notebooks.</p>
http://ask.sagemath.org/question/35814/error-with-metric/?comment=35858#post-id-35858It looks that SageManifolds is not correctly installed on your MacOSX computer. Are you sure you have run the install script from the Sage root directory?
Regarding the SageMathCloud, you have to open a Jupyter notebook, go to the `Kernel` menu, then to `Change kernel` and select `SageMath 7.4`. It should work, cf. [this example](https://cloud.sagemath.com/projects/03203022-c9ed-49e0-89bd-1525699640ab/files/test_SageManifolds.ipynb).Thu, 01 Dec 2016 08:33:14 -0600http://ask.sagemath.org/question/35814/error-with-metric/?comment=35858#post-id-35858Comment by gucheuta for <p>It's because SageManifolds is not fully installed on your computer. Probably, you are using the limited version of SageManifolds which is included in SageMath 7.4. This version does not contain the metrics (nor any tensor field calculus). The next release of SageMath (i.e. 7.5) will contain the totality of SageManifolds. Meanwhile, you have to install SageManifolds atop SageMath 7.4 by following
<a href="http://sagemanifolds.obspm.fr/download.html">these instructions</a>.</p>
<p>Another option is to use the SageMathCloud, where SageManifolds is installed system-wide in the SageMath 7.4 kernels of Jupyter notebooks.</p>
http://ask.sagemath.org/question/35814/error-with-metric/?comment=35830#post-id-35830It is strange. I got the same error after following the installation instructions, too.
In fact, g = M.lorentz_metric('g') (or g = M.metric('g') ) did not work even in SageMathCloud...
P.S. I installed SageMath-7.4.app and SageManigolds on MacOSX.Wed, 30 Nov 2016 15:10:09 -0600http://ask.sagemath.org/question/35814/error-with-metric/?comment=35830#post-id-35830