Message Boards Message Boards

[WWS21] Checking the preservation of the Schwarzschild metric

Posted 11 months ago
3 Replies
8 Total Likes

3 Replies

enter image description here -- you have earned Featured Contributor Badge enter image description here Your exceptional post has been selected for our editorial column Staff Picks and Your Profile is now distinguished by a Featured Contributor Badge and is displayed on the Featured Contributor Board. Thank you!

Posted 10 months ago

I am yet to dive in WPP but I want to help you live a For-free life :) hope you don't mind. Those are nothing but side notes.

a) Since matr is a sparse binary array you can do:

hyperlist = matr["NonzeroPositions"]

And if it weren't sparse and binary you could use Position[matr, 1]. For sparse non binary: Position[ Normal @ matr, 1]


shortestmaxradius = assoc // Map[Length] // Min

c) Dataplot, not exactly shorter but more idiomatic:

Dataplot = assoc[[All, 2 ;; shortestmaxradius]] // Values //
   MapIndexed[{#2[[2]], #} &, #, {2}] & // 
   Apply[Join] // 
   Prepend[{0, 0}]

Notice those lines lack of assoc length, 10, which was hardcoded.

d) Don't use sym := something unless you know you need :=, = is enough. If something is time intensive and sym is called multiple times this can make a difference.

Again, nothing but side notes. Good luck.

Posted 10 months ago

Thank you for the great Input!

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract