Ask Your Question
1

Error with metric

asked 2016-11-30 09:23:31 +0100

gucheuta gravatar image

updated 2016-11-30 14:52:38 +0100

eric_g gravatar image

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-11-30 14:50:38 +0100

eric_g gravatar image

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 these instructions.

Another option is to use the SageMathCloud, where SageManifolds is installed system-wide in the SageMath 7.4 kernels of Jupyter notebooks.

edit flag offensive delete link more

Comments

It 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.

gucheuta gravatar imagegucheuta ( 2016-11-30 22:10:09 +0100 )edit

It 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.

eric_g gravatar imageeric_g ( 2016-12-01 15:33:14 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-11-30 09:23:31 +0100

Seen: 353 times

Last updated: Nov 30 '16