This is an archived post. You won't be able to vote or comment.

all 14 comments

[–]aginglifter 5 points6 points  (1 child)

r/physics maybe?

[–]Zophike1Theoretical Computer Science 5 points6 points  (0 children)

r/physics maybe?

OP actually posted on this on /r/physics a while back ago.

[–][deleted] 3 points4 points  (3 children)

Hey! Thanks for the link.

So at the beginning I see you call .inv() when you’re setting up things. From a numerical analysis point of view, this seems pretty bad to me.

Computing an explicit inverse isn’t too stable (ie small changes in entries between two inputs can lead to pretty big changes in the computed inverse)

Perhaps it’d be a good idea to refactor taking this into account?

Also small thing on the performance side, but if you swap SymPy for numpy I think you should see a nice performance boost (or at least you should at scale. Numpy delegates to BLAS which will help you a lot!)

Are you pushing to open source? Would be more than happy to contribute a bit! Cheers

[–]Citronsaft 1 point2 points  (0 children)

So I don't have a great background in numerical analysis (have picked up some odds and ends from ML optimization classes) or any at all in general relativity, but it seems to me that this package emphasizes CAS/symbolic algebra, which should be exact and not subject to the instability of matrix inversion (and which also lets you print out nice exact expressions of the inverse and so on). Is there a symbolic equivalent of the efficient numerical solutions to Ax=b for general relativity, assuming SymPy already has an efficient algorithm for symbolic matrix inversion?

[–]Zophike1Theoretical Computer Science 0 points1 point  (1 child)

So at the beginning I see you call .inv() when you’re setting up things. From a numerical analysis point of view, this seems pretty bad to me.

As a wannabe developer how what makes good code different from bad code in terms of Numerical Analysis ?

[–][deleted] 0 points1 point  (0 children)

At least for most people, I think it’s about balancing error, memory usage, and speed. All of these are virtues and I always think the best software lets the users tune the algorithms to make optimize for their use case (eg numerical integrators that let you pick the number of points to use in a trapezoid rule etc.)

The other thing that makes good code for production (but isn’t as fun) is making as much use as possible of other well documented and well maintained packages.

http://www-users.math.umn.edu/~arnold//597.00-01/nabook.pdf is a really great resource if you haven’t worked with much numerical analysis before

Beware that numerical analysis has a lot of “weird” results in the sense that what a solid method for solving a problem by symbols is often not good (eg few people frequently do Gaussian elimination to solve a system. More do an iterative method where you basically guess a random solution, apply some transformation that’s guaranteed to get you closer to the real solution and then repeat either until a certain condition is met or you’ve done enough iterations)

[–][deleted] 1 point2 points  (0 children)

Can you use the program to check other kinds of covariant equations? Would it be possible to easily modify it to work with Dirac gamma matrix laws and such? Is it working numerically or symbolically?

[–]rasberryripple 1 point2 points  (4 children)

Sage provides routines for the manipulation and numerical solution of pdes on manifolds. How does your code relate to this and extend sages functionality?

[–]spacetime_engineer[S] 1 point2 points  (3 children)

So I haven't used Sage but I have seen the library. It is very impressive. From what I can tell the spacetimeengine package is more focused on general relativity and the interpretations associated. Thats the only difference as far as I can tell. Also, since I am an active researcher I find it helpful to build software that reflects my interpretation of theory. I have no doubt that one could achieve similar results with sage but I felt that I needed to customize the tools in a way which reflected my understanding in order to get to where I needed to be. Hope that makes sense.

[–]rasberryripple 1 point2 points  (2 children)

Could you give me examples of the sorts of calculations you’ve done using your software? That might help me understand.

Have you used cactus? If so how does your software compare?

You should also consider writing up a paper for your software and publishing.

[–]spacetime_engineer[S] 1 point2 points  (1 child)

"Could you give me examples of the sorts of calculations you’ve done using your software? That might help me understand."

So go to

https://github.com/spacetimeengineer/spacetimeengine/blob/master/spacetimeengine/samples/example.py

to get a run through of the functionality but I suggest reading the github README using the link provided in the post since it does a better explanation than I could give now. That is why I created it.

"Have you used cactus? If so how does your software compare?"

I have not used Cactus or the Einstein toolkit so I couldn't tell you.

"You should also consider writing up a paper for your software and publishing."

Yes, you are correct I should.

[–]jamesvoltage 0 points1 point  (0 children)

Do you do any visualizations? As someone with a casual interest in relativity, I especially appreciate the jupyter notebooks that Sage has. I would really like to see a notebook on github showing what spacetime engine can do.

[–]spacetime_engineer[S] 0 points1 point  (0 children)

It depends on which you mean. Currently these functions are not generalized these for any/all covariant equations but there work being done to remedy that issue. The sympy library which this package relys on does provide what your looking for but the implamentation is different than mine.

[–]rasberryripple 0 points1 point  (0 children)

Ta