question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Organize and reorder utils for Kerr, Kerr-Newman and Schwarzschild metrics

See original GitHub issue

🐞 Problem As of now, various useful functions used by metric/schwarzschild.py are in utils/schwarzschild_utils.py. Same goes for metric/kerr.py and metric/kerrnewman.py. We need to move these functions out of utils and make them a core part of library as they are quite-useful even when used stand-alone.

🎯 Goal

  • Migrate them somewhere, so as to make them look like a core part of library.
  • Reorder the parameters inside the functions, so as parameters like c, G etc are made to be optional with default values can be taken in SI units from constant.py.
  • Many functions take Rs as parameters which is Schwarzschild Radius. However, there is no sense to keep parameters Rs as it can be calculated from more fundamental things like mass, speed of light(c), gravitational constant(G). Rs = 2*M*G/square(c).
  • These changes would break the API, and therefore requires updation of tests and example notebooks.

Progress

The tasks to be taken up in separate PRs

  • Reorder parameters within functions
  • Move the functions somewhere more suitable

💡 Possible solutions

  • Firstly, wherever the functions take Rs, i.e schwarzschild radius as an input, replace them with M,G, and c and calculate Rs = 2*G*M/(c**2) inside the function itself. We can’t expect the user to supply schwarzschild radius. While implementing it, leave out function delta() in both kerr_utils.py and kerrnewman_utils.py.

  • Currently functions are like func(c, G, Cc, r, theta.....). Here the fundamental constants need to be optional arguments and therefore, should be last few parameters like func(r, theta, ..... , c=default_value, G=default_value, Cc=default_value). Leave out G and Cc whenever not required.

    • c is Speed of light. Default value : einsteinpy.constant.c.value
    • G is gravitational constant. Default value : einsteinpy.constant.G.value
    • Cc is coulomb’s constant. Default value : einsteinpy.constant.coulombs_const.value
  • After the changes, the API would break, therefore, update the example notebooks.

  • Update the user guide

  • Update the tests

📋 Steps to solve the problem

  • Comment below about what you’ve started working on.
  • Add, commit, push your changes
  • Submit a pull request and add this in comments - Addresses #141
  • Ask for a review in comments section of pull request
  • Celebrate your contribution to this project 🎉

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
ritzvikcommented, Apr 20, 2019

i thought of making a module “core.py” and putting the functions in there. is it fine? or can you suggest something better?

@alpeshjamgade Reorganizations is also being undertaken in the core metric modules in PR #203 . We have to wait for a while to work on this. I’ll notify when the time is right 😃 . BTW thanks for taking this up.

0reactions
JeS24commented, Jun 24, 2020

Almost all of the utilities have been moved into metric itself, in #512.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Kerr-Newman metric - Scholarpedia
The Kerr-Newman metric describes a very special rotating, charged mass and is the most general of the asymptotically flat stationary `black ...
Read more >
Schwarzschild and Kerr Solutions of Einstein's Field Equation
The Schwarzschild solution is unique and its metric can be interpreted as the exterior gravitational field of a spherically symmetric mass. The ...
Read more >
A radiating Kerr black hole and Hawking radiation
This study proposes an axisymmetric generalization of the Vaidya metric, namely the Vaidya–Kerr metric, to describe a radiating rotating black hole, ...
Read more >
Near Horizon Extreme Kerr Geometry - IOPscience
This metric can be applied to the more general black holes, Kerr-Newman black holes, so by assuming some cases it will reduce to...
Read more >
Scalar invariants of the radiating Kerr–Newman metric
derstanding of the Schwarzschild “singularity,“” an explicit demonstration of the true singularity of the Kerr metric is central to its study.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found