ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 27 Aug 2019 20:29:09 -0500How to set a metric tensor inverse?http://ask.sagemath.org/question/47633/how-to-set-a-metric-tensor-inverse/ I have a complicated metric tensor. In order to compute the Laplacian in this metric, I need the metric tensor inverse. But this exceeds my memory capacity after ~36 hours of computing.
I would like instead to set the inverse with what I believe to be the correct entries. Is that possible? Reviewing the documentation and the source code, I see no indication of such an operation.
I wonder if `g.inverse().comp(XI.frame())[:] = Ginv[:] ` would work, where `g` denotes the metric tensor, and `Ginv` the matrix of expressions which should be correct.
BTW, I have the metric and its inverse in one frame. It is after mapping into a second frame [XI] that the problem arises.Richard_LTue, 27 Aug 2019 20:29:09 -0500http://ask.sagemath.org/question/47633/Error 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.gucheutaWed, 30 Nov 2016 02:23:31 -0600http://ask.sagemath.org/question/35814/