[sage-support] Re: Memory efficient calculation of the Kretschmann scalar
Well, if memory is really an issue, you can avoid the creation of the intermediate tensor fields uR and dR by writing gc = g.components() igc = g.inverse().components() Rc = R.components() kr = 0 for a in M.irange(): for b in M.irange(): for c in M.irange(): for d in M.irange(): for i in M.irange(): for j in M.irange(): for k in M.irange(): for l in M.irange(): kr += gc[[a, i]]*igc[[b, j]]*igc[[c, k]]*igc [[d, l]] \ *Rc[[i, b, c, d]]*Rc[[a, j, k, l]] kr.expr() It is certainly more efficient in term of memory, but less efficient in term of CPU time, since the symmetries of the Riemann tensor are not taken into account in the above writing. Best wishes, Eric. -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/9b401de7-166e-4471-9aa3-362c94cae3af%40googlegroups.com.
Re: [sage-support] Jupyter nootbook not work
Dear Jan; Le dimanche 29 décembre 2019 15:26:13 UTC+1, Jan Groenewald a écrit : > > Hi > > On Sun, 29 Dec 2019 at 15:54, Szabolcs Sződi > wrote: > There is something simply step by step instruction for simply, ordinary > mortals? Couldn't find anything. > > In SageMath Cell type > > notebook() > Didn't wokfor me : Dagecell's interpreter complains it cant find the (pld) (deprecated)Sage notebook: ---ModuleNotFoundError Traceback (most recent call last) in ()> 1 notebook() /home/sc_serv/sage/local/lib/python3.7/site-packages/sage/misc/lazy_import.pyx in sage.misc.lazy_import.LazyImport.__call__ (build/cythonized/sage/misc/lazy_import.c:3684)()351 True 352 """--> 353 return self.get_object()(*args, **kwds)354 355 def __repr__(self): /home/sc_serv/sage/local/lib/python3.7/site-packages/sage/misc/lazy_import.pyx in sage.misc.lazy_import.LazyImport.get_object (build/cythonized/sage/misc/lazy_import.c:2347)()186 if likely(self._object is not None):187 return self._object--> 188 return self._get_object()189 190 cpdef _get_object(self): /home/sc_serv/sage/local/lib/python3.7/site-packages/sage/misc/lazy_import.pyx in sage.misc.lazy_import.LazyImport._get_object (build/cythonized/sage/misc/lazy_import.c:2586)()218 elif self._at_startup and not startup_guard:219 print('Option ``at_startup=True`` for lazy import {0} not needed anymore'.format(self._name))--> 220 self._object = getattr(__import__(self._module, {}, {}, [self._name]), self._name)221 name = self._as_name222 if self._deprecation is not None: ModuleNotFoundError: No module named 'sagenb' Aren't we supposed to tell it (how ?) to use Jupyter ? > > Regards, > Jan > > > > -- > .~. > /V\ Jan Groenewald > /( )\www.aims.ac.za > ^^-^^ > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/1bee2464-0f61-4ed3-9e6f-b1ebe72456cd%40googlegroups.com.