From 90ed0580638e7e3dbad3d8836d52cf691a88add2 Mon Sep 17 00:00:00 2001 From: cjayross Date: Wed, 3 Jul 2019 19:46:10 -0500 Subject: [PATCH 01/34] added source files --- docs/Makefile | 177 ++++++++++++++++++++++ src/riccipy/__init__.py | 1 - src/test_symbolic/ipy_test_environment.py | 30 ++++ src/test_symbolic/test_metric.py | 100 ++++++++++++ src/test_symbolic/test_partial.py | 34 +++++ src/test_symbolic/test_tensor.py | 149 ++++++++++++++++++ 6 files changed, 490 insertions(+), 1 deletion(-) create mode 100644 docs/Makefile create mode 100644 src/test_symbolic/ipy_test_environment.py create mode 100644 src/test_symbolic/test_metric.py create mode 100644 src/test_symbolic/test_partial.py create mode 100644 src/test_symbolic/test_tensor.py diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..0f83864 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,177 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = build + +# User-friendly check for sphinx-build +ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) +$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) +endif + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source +# the i18n builder cannot share the environment and doctrees with the others +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source + +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext + +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" + @echo " gettext to make PO message catalogs" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " xml to make Docutils-native XML files" + @echo " pseudoxml to make pseudoxml-XML files for display purposes" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + +clean: + rm -rf $(BUILDDIR)/* + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/einsteinpy.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/einsteinpy.qhc" + +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/einsteinpy" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/einsteinpy" + @echo "# devhelp" + +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +latexpdfja: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through platex and dvipdfmx..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +texinfo: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +info: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." + +gettext: + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale + @echo + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." + +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." + +xml: + $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml + @echo + @echo "Build finished. The XML files are in $(BUILDDIR)/xml." + +pseudoxml: + $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml + @echo + @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." diff --git a/src/riccipy/__init__.py b/src/riccipy/__init__.py index 589f1e6..19b1913 100644 --- a/src/riccipy/__init__.py +++ b/src/riccipy/__init__.py @@ -1,5 +1,4 @@ """ -======= RicciPy ======= diff --git a/src/test_symbolic/ipy_test_environment.py b/src/test_symbolic/ipy_test_environment.py new file mode 100644 index 0000000..445354a --- /dev/null +++ b/src/test_symbolic/ipy_test_environment.py @@ -0,0 +1,30 @@ +from sympy import * + +from riccipy.metric import * +from riccipy.partial import * +from riccipy.tensor import * + +init_printing() + +t, r, th, ph, x, y, z = symbols("t r theta phi x y z", real=True) +momentum = symbols("E p_1:4", positive=True) +E, p1, p2, p3 = momentum +# schw = diag(1-1/r, -1/(1-1/r), -r**2, -r**2*sin(th)**2) +alpha, beta = symbols("alpha beta", cls=Function) +schw = diag(-exp(2 * alpha(r)), exp(2 * beta(r)), r ** 2, r ** 2 * sin(th) ** 2) +g = Metric("g", [t, r, th, ph], schw) +x = Tensor("x", [t, r, th, ph], g) +p = Tensor("p", momentum, g) +mu, nu, si, rh, la = indices("mu nu sigma rho lambda", g) +d = g.partial +Gamma = g.christoffel +R = g.riemann +G = g.einstein +C = g.weyl + +# mink = diag(1, -1, -1, -1) +# eta = Metric('eta', [t, x, y, z], mink) +# al, be, ga = indices('alpha beta gamma', eta) +# E1, E2, E3, B1, B2, B3 = symbols('E_1:4 B_1:4', real=True) +# matrix = [[0, -E1, -E2, -E3], [E1, 0, -B3, B2], [E2, B3, 0, -B1], [E3, -B2, B1, 0]] +# F = Tensor('F', matrix, eta, symmetry=[[2]]) diff --git a/src/test_symbolic/test_metric.py b/src/test_symbolic/test_metric.py new file mode 100644 index 0000000..93ba727 --- /dev/null +++ b/src/test_symbolic/test_metric.py @@ -0,0 +1,100 @@ +from sympy import Expr, diag, sin, symbols, zeros + +from riccipy.metric import * +from riccipy.partial import * +from riccipy.tensor import * + + +def _generate_schwarzschild(): + coords = symbols("t r theta phi", real=True) + t, r, th, ph = coords + schw = diag(1 - 1 / r, -1 / (1 - 1 / r), -r ** 2, -r ** 2 * sin(th) ** 2) + g = SpacetimeMetric("g", coords, schw, timelike=True) + mu, nu = indices("mu nu", g) + return (coords, t, r, th, ph, schw, g, mu, nu) + + +def test_Metric(): + (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() + assert isinstance(g, AbstractTensor) + assert isinstance(g, TensorIndexType) + assert isinstance(g(mu, nu), IndexedTensor) + assert isinstance(g.metric, Tensor) + assert isinstance(g.partial, PartialDerivative) + assert g.metric.covar == (-1, -1) + + +def test_SpacetimeMetric(): + (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() + array1 = g.as_array() + assert g.signature == (1, -1, -1, -1) + rev_sig = g.reverse_signature() + array2 = g.as_array() + assert rev_sig == (-1, 1, 1, 1) + assert array1 == -1 * array2 + + +def test_Metric_christoffel(): + (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() + gamma = g.christoffel.simplify() + assert ( + str(gamma) + == "[[[0, 0.5/(r*(r - 1)), 0, 0], [0.5/(r*(r - 1)), 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]], [[0.5*(r - 1)/r**3, 0, 0, 0], [0, -0.5/(r*(r - 1)), 0, 0], [0, 0, 1.0 - 1.0*r, 0], [0, 0, 0, (1.0 - 1.0*r)*sin(theta)**2]], [[0, 0, 0, 0], [0, 0, 1.0/r, 0], [0, 1.0/r, 0, 0], [0, 0, 0, -0.5*sin(2*theta)]], [[0, 0, 0, 0], [0, 0, 0, 1.0/r], [0, 0, 0, 1.0/tan(theta)], [0, 1.0/r, 1.0/tan(theta), 0]]]" + ) + + +def test_Metric_riemann(): + (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() + rh, si = indices("rho sigma", g) + R = g.riemann + + def is_zero(arr): + for comp in arr: + yield comp.equals(0) + + expr = R(-rh, -si, -mu, -nu) + R(-si, -rh, -mu, -nu) + assert all(is_zero(expand_tensor(expr))) + expr = R(-rh, -si, -mu, -nu) + R(-rh, -si, -nu, -mu) + assert all(is_zero(expand_tensor(expr))) + expr = R(-rh, -si, -mu, -nu) - R(-mu, -nu, -rh, -si) + assert all(is_zero(expand_tensor(expr))) + expr = R(-rh, -si, -mu, -nu) + R(-rh, -mu, -nu, -si) + R(-rh, -nu, -si, -mu) + assert all(is_zero(expand_tensor(expr))) + + +def test_Metric_ricci_tensor(): + (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() + R = g.ricci_tensor + assert zeros(4).equals(R.as_array()) + + +def test_Metric_ricci_scalar(): + (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() + R = g.ricci_scalar + assert isinstance(R, Expr) + assert R.equals(0) + + +def test_Metric_einstein(): + (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() + G = g.einstein + assert zeros(4).equals(G.as_array()) + + +def test_Metric_weyl(): + (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() + rh, si = indices("rho sigma", g) + C = g.weyl + + def is_zero(arr): + for comp in arr: + yield comp.equals(0) + + expr = C(-rh, -si, -mu, -nu) + C(-si, -rh, -mu, -nu) + assert all(is_zero(expand_tensor(expr))) + expr = C(-rh, -si, -mu, -nu) + C(-rh, -si, -nu, -mu) + assert all(is_zero(expand_tensor(expr))) + expr = C(-rh, -si, -mu, -nu) - C(-mu, -nu, -rh, -si) + assert all(is_zero(expand_tensor(expr))) + expr = C(-rh, -si, -mu, -nu) + C(-rh, -mu, -nu, -si) + C(-rh, -nu, -si, -mu) + assert all(is_zero(expand_tensor(expr))) diff --git a/src/test_symbolic/test_partial.py b/src/test_symbolic/test_partial.py new file mode 100644 index 0000000..5b8ee4d --- /dev/null +++ b/src/test_symbolic/test_partial.py @@ -0,0 +1,34 @@ +from sympy import diag, sin, symbols + +from riccipy.metric import * +from riccipy.partial import * +from riccipy.tensor import * + + +def _generate_schwarzschild(): + coords = symbols("t r theta phi", real=True) + t, r, th, ph = coords + schw = diag(1 - 1 / r, -1 / (1 - 1 / r), -r ** 2, -r ** 2 * sin(th) ** 2) + g = SpacetimeMetric("g", coords, schw, timelike=True) + mu, nu = indices("mu nu", g) + return (coords, t, r, th, ph, schw, g, mu, nu) + + +def test_DiffOperator(): + r = Symbol("r") + dr = DiffOperator(r) + expr = dr * (1 - 1 / r) + assert expr == 1 / r ** 2 + expr = (1 - 1 / r) * dr + assert isinstance(expr, DiffOperator) + assert (expr * (r ** 3 / 3)).equals(r * (r - 1)) + + +def test_PartialDerivative(): + (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() + d = g.partial + assert isinstance(d, PartialDerivative) + assert isinstance(d, Tensor) + assert d.commutes_with(d) == 0 + assert d.covar == (-1,) + assert all([isinstance(dx, DiffOperator) for dx in d.as_array()]) diff --git a/src/test_symbolic/test_tensor.py b/src/test_symbolic/test_tensor.py new file mode 100644 index 0000000..ab68c7e --- /dev/null +++ b/src/test_symbolic/test_tensor.py @@ -0,0 +1,149 @@ +from sympy import Array, diag, eye, simplify, sin, symbols +from sympy.tensor.tensor import TensExpr, TensMul + +from riccipy.metric import * +from riccipy.tensor import * + + +def _generate_simple(): + coords = symbols("x y z", real=True) + metric = Metric("metric", coords, eye(3)) + return (coords, metric) + + +def _generate_schwarzschild(): + coords = symbols("t r theta phi", real=True) + t, r, th, ph = coords + schw = diag(1 - 1 / r, -1 / (1 - 1 / r), -r ** 2, -r ** 2 * sin(th) ** 2) + g = Metric("g", coords, schw) + mu, nu = indices("mu nu", g) + return (coords, t, r, th, ph, schw, g, mu, nu) + + +def _generate_minkowski(): + coords = symbols("t x y z", real=True) + t, x, y, z = coords + mink = diag(1, -1, -1, -1) + eta = Metric("eta", coords, mink) + mu, nu = indices("mu nu", eta) + return (coords, t, x, y, z, mink, eta, mu, nu) + + +def test_Index(): + (coords, metric) = _generate_simple() + mu = Index("mu", metric) + assert isinstance(mu, TensorIndex) + assert mu.is_up + assert not (-mu).is_up + + +def test_indices(): + (coords, metric) = _generate_simple() + idxs = indices("i0:4", metric) + assert len(idxs) == 4 + assert all([isinstance(i, Index) for i in idxs]) + + +def test_Tensor(): + from sympy.tensor.tensor import tensorsymmetry + + (coords, metric) = _generate_simple() + T = Tensor("T", coords, metric) + assert isinstance(T, TensorHead) + assert T.as_array() == Array(coords) + assert T.covar == (1,) + assert T.symmetry == tensorsymmetry([1]) + + +def test_Tensor_comm(): + (coords, metric) = _generate_simple() + T = Tensor("T", coords, metric) + assert T.commutes_with(T) == 0 + assert T.commutes_with(metric) == 0 + assert T.commutes_with(metric.partial) is None + + +def test_Tensor_simplify(): + (coords, metric) = _generate_simple() + x, y, z = coords + expr = -(1 - x) ** 2 / (x - 1) + expr_simplified = 1 - x + T = Tensor("T", 3 * [expr], metric) + assert str(T.simplify()[0]) == str(expr_simplified) + + +def test_Tensor_covariance_transform(): + (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() + E, p1, p2, p3 = symbols("E p_1:4", positive=True) + p = Tensor("p", [E, p1, p2, p3], g) + res = p.covariance_transform(-mu) + expect = Array( + [E * (1 - 1 / r), -p1 / (1 - 1 / r), -p2 * r ** 2, -p3 * r ** 2 * sin(th) ** 2] + ) + assert res[0].equals(expect[0]) + assert res[1].equals(expect[1]) + assert res[2].equals(expect[2]) + assert res[3].equals(expect[3]) + + +def test_AbstractTensor(): + (coords, metric) = _generate_simple() + T = Tensor("T", coords, metric) + assert isinstance(T, AbstractTensor) + assert isinstance(T.as_array(), Array) + assert T.is_Tensor + assert not T.is_Metric + assert not T.is_Spacetime + + +def test_IndexedTensor(): + (coords, metric) = _generate_simple() + T = Tensor("T", coords, metric) + mu = Index("mu", metric) + assert isinstance(T(mu), IndexedTensor) + + +def test_ReplacementManager(): + pass + + +def test_expand_tensor(): + (coords, t, r, th, ph, mink, eta, mu, nu) = _generate_minkowski() + E1, E2, E3, B1, B2, B3 = symbols("E_1:4 B_1:4", real=True) + matrix = [[0, -E1, -E2, -E3], [E1, 0, -B3, B2], [E2, B3, 0, -B1], [E3, -B2, B1, 0]] + F = Tensor("F", matrix, eta, symmetry=[[2]]) + assert expand_tensor(eta(mu, nu) * eta(-mu, -nu)) == 4 + assert expand_tensor(F(mu, -mu)) == 0 + assert ( + expand_tensor(F(mu, nu) * F(-mu, -nu)) + == 2 * B1 ** 2 + + 2 * B2 ** 2 + + 2 * B3 ** 2 + - 2 * E1 ** 2 + - 2 * E2 ** 2 + - 2 * E3 ** 2 + ) + (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() + x = Tensor("x", [t, r, th, ph], g) + res = expand_tensor(g(mu, nu)) + assert schw.inv().equals(res) + res1 = expand_tensor(g(mu, nu) * g(-mu, -nu)) + res2 = expand_tensor(g(-mu, -nu) * g(mu, nu)) + assert res1 == res2 + assert simplify(res1) == 4 + res1 = expand_tensor(g(-mu, -nu) * x(nu)) + res2 = expand_tensor(x(-mu)) + res3 = x.covariance_transform(-mu) + assert res1 == res2 + assert res2 == res3 + res1 = expand_tensor(g(mu, nu) * x(-nu)) + res2 = expand_tensor(x(mu)) + assert simplify(res1) == res2 + res = expand_tensor(x(mu) * x(-mu)) + assert ( + res + == t ** 2 * (1 - 1 / r) + - r ** 2 / (1 - 1 / r) + - th ** 2 * r ** 2 + - ph ** 2 * r ** 2 * sin(th) ** 2 + ) From f22376a7cba69438d029068cdbd153ed25c558bf Mon Sep 17 00:00:00 2001 From: cjayross Date: Wed, 3 Jul 2019 20:09:54 -0500 Subject: [PATCH 02/34] added .gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index a9f548a..1224cdc 100644 --- a/.gitignore +++ b/.gitignore @@ -66,6 +66,9 @@ pip-wheel-metadata # VS Code .vscode +# Emacs - projectile +TAGS + # default pytest cache directory */.pytest_cache .pytest_cache/ From 3dcca53593450e002665c17dbac1b9c6a633ffa6 Mon Sep 17 00:00:00 2001 From: cjayross Date: Wed, 3 Jul 2019 20:12:28 -0500 Subject: [PATCH 03/34] added myself as an author --- AUTHORS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS b/AUTHORS index 8412821..0c81213 100644 --- a/AUTHORS +++ b/AUTHORS @@ -9,3 +9,6 @@ * Priyanshu Khandelwal Primary Author + +* Calvin Jay Ross + Primary Author From e495709132b3d2db68ef7587e5ed3829d0eff1fe Mon Sep 17 00:00:00 2001 From: cjayross Date: Wed, 3 Jul 2019 20:14:14 -0500 Subject: [PATCH 04/34] reorganized test files --- .../tests}/ipy_test_environment.py | 0 src/test_symbolic/test_metric.py | 100 ------------ src/test_symbolic/test_partial.py | 34 ---- src/test_symbolic/test_tensor.py | 149 ------------------ 4 files changed, 283 deletions(-) rename src/{test_symbolic => riccipy/tests}/ipy_test_environment.py (100%) delete mode 100644 src/test_symbolic/test_metric.py delete mode 100644 src/test_symbolic/test_partial.py delete mode 100644 src/test_symbolic/test_tensor.py diff --git a/src/test_symbolic/ipy_test_environment.py b/src/riccipy/tests/ipy_test_environment.py similarity index 100% rename from src/test_symbolic/ipy_test_environment.py rename to src/riccipy/tests/ipy_test_environment.py diff --git a/src/test_symbolic/test_metric.py b/src/test_symbolic/test_metric.py deleted file mode 100644 index 93ba727..0000000 --- a/src/test_symbolic/test_metric.py +++ /dev/null @@ -1,100 +0,0 @@ -from sympy import Expr, diag, sin, symbols, zeros - -from riccipy.metric import * -from riccipy.partial import * -from riccipy.tensor import * - - -def _generate_schwarzschild(): - coords = symbols("t r theta phi", real=True) - t, r, th, ph = coords - schw = diag(1 - 1 / r, -1 / (1 - 1 / r), -r ** 2, -r ** 2 * sin(th) ** 2) - g = SpacetimeMetric("g", coords, schw, timelike=True) - mu, nu = indices("mu nu", g) - return (coords, t, r, th, ph, schw, g, mu, nu) - - -def test_Metric(): - (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() - assert isinstance(g, AbstractTensor) - assert isinstance(g, TensorIndexType) - assert isinstance(g(mu, nu), IndexedTensor) - assert isinstance(g.metric, Tensor) - assert isinstance(g.partial, PartialDerivative) - assert g.metric.covar == (-1, -1) - - -def test_SpacetimeMetric(): - (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() - array1 = g.as_array() - assert g.signature == (1, -1, -1, -1) - rev_sig = g.reverse_signature() - array2 = g.as_array() - assert rev_sig == (-1, 1, 1, 1) - assert array1 == -1 * array2 - - -def test_Metric_christoffel(): - (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() - gamma = g.christoffel.simplify() - assert ( - str(gamma) - == "[[[0, 0.5/(r*(r - 1)), 0, 0], [0.5/(r*(r - 1)), 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]], [[0.5*(r - 1)/r**3, 0, 0, 0], [0, -0.5/(r*(r - 1)), 0, 0], [0, 0, 1.0 - 1.0*r, 0], [0, 0, 0, (1.0 - 1.0*r)*sin(theta)**2]], [[0, 0, 0, 0], [0, 0, 1.0/r, 0], [0, 1.0/r, 0, 0], [0, 0, 0, -0.5*sin(2*theta)]], [[0, 0, 0, 0], [0, 0, 0, 1.0/r], [0, 0, 0, 1.0/tan(theta)], [0, 1.0/r, 1.0/tan(theta), 0]]]" - ) - - -def test_Metric_riemann(): - (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() - rh, si = indices("rho sigma", g) - R = g.riemann - - def is_zero(arr): - for comp in arr: - yield comp.equals(0) - - expr = R(-rh, -si, -mu, -nu) + R(-si, -rh, -mu, -nu) - assert all(is_zero(expand_tensor(expr))) - expr = R(-rh, -si, -mu, -nu) + R(-rh, -si, -nu, -mu) - assert all(is_zero(expand_tensor(expr))) - expr = R(-rh, -si, -mu, -nu) - R(-mu, -nu, -rh, -si) - assert all(is_zero(expand_tensor(expr))) - expr = R(-rh, -si, -mu, -nu) + R(-rh, -mu, -nu, -si) + R(-rh, -nu, -si, -mu) - assert all(is_zero(expand_tensor(expr))) - - -def test_Metric_ricci_tensor(): - (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() - R = g.ricci_tensor - assert zeros(4).equals(R.as_array()) - - -def test_Metric_ricci_scalar(): - (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() - R = g.ricci_scalar - assert isinstance(R, Expr) - assert R.equals(0) - - -def test_Metric_einstein(): - (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() - G = g.einstein - assert zeros(4).equals(G.as_array()) - - -def test_Metric_weyl(): - (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() - rh, si = indices("rho sigma", g) - C = g.weyl - - def is_zero(arr): - for comp in arr: - yield comp.equals(0) - - expr = C(-rh, -si, -mu, -nu) + C(-si, -rh, -mu, -nu) - assert all(is_zero(expand_tensor(expr))) - expr = C(-rh, -si, -mu, -nu) + C(-rh, -si, -nu, -mu) - assert all(is_zero(expand_tensor(expr))) - expr = C(-rh, -si, -mu, -nu) - C(-mu, -nu, -rh, -si) - assert all(is_zero(expand_tensor(expr))) - expr = C(-rh, -si, -mu, -nu) + C(-rh, -mu, -nu, -si) + C(-rh, -nu, -si, -mu) - assert all(is_zero(expand_tensor(expr))) diff --git a/src/test_symbolic/test_partial.py b/src/test_symbolic/test_partial.py deleted file mode 100644 index 5b8ee4d..0000000 --- a/src/test_symbolic/test_partial.py +++ /dev/null @@ -1,34 +0,0 @@ -from sympy import diag, sin, symbols - -from riccipy.metric import * -from riccipy.partial import * -from riccipy.tensor import * - - -def _generate_schwarzschild(): - coords = symbols("t r theta phi", real=True) - t, r, th, ph = coords - schw = diag(1 - 1 / r, -1 / (1 - 1 / r), -r ** 2, -r ** 2 * sin(th) ** 2) - g = SpacetimeMetric("g", coords, schw, timelike=True) - mu, nu = indices("mu nu", g) - return (coords, t, r, th, ph, schw, g, mu, nu) - - -def test_DiffOperator(): - r = Symbol("r") - dr = DiffOperator(r) - expr = dr * (1 - 1 / r) - assert expr == 1 / r ** 2 - expr = (1 - 1 / r) * dr - assert isinstance(expr, DiffOperator) - assert (expr * (r ** 3 / 3)).equals(r * (r - 1)) - - -def test_PartialDerivative(): - (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() - d = g.partial - assert isinstance(d, PartialDerivative) - assert isinstance(d, Tensor) - assert d.commutes_with(d) == 0 - assert d.covar == (-1,) - assert all([isinstance(dx, DiffOperator) for dx in d.as_array()]) diff --git a/src/test_symbolic/test_tensor.py b/src/test_symbolic/test_tensor.py deleted file mode 100644 index ab68c7e..0000000 --- a/src/test_symbolic/test_tensor.py +++ /dev/null @@ -1,149 +0,0 @@ -from sympy import Array, diag, eye, simplify, sin, symbols -from sympy.tensor.tensor import TensExpr, TensMul - -from riccipy.metric import * -from riccipy.tensor import * - - -def _generate_simple(): - coords = symbols("x y z", real=True) - metric = Metric("metric", coords, eye(3)) - return (coords, metric) - - -def _generate_schwarzschild(): - coords = symbols("t r theta phi", real=True) - t, r, th, ph = coords - schw = diag(1 - 1 / r, -1 / (1 - 1 / r), -r ** 2, -r ** 2 * sin(th) ** 2) - g = Metric("g", coords, schw) - mu, nu = indices("mu nu", g) - return (coords, t, r, th, ph, schw, g, mu, nu) - - -def _generate_minkowski(): - coords = symbols("t x y z", real=True) - t, x, y, z = coords - mink = diag(1, -1, -1, -1) - eta = Metric("eta", coords, mink) - mu, nu = indices("mu nu", eta) - return (coords, t, x, y, z, mink, eta, mu, nu) - - -def test_Index(): - (coords, metric) = _generate_simple() - mu = Index("mu", metric) - assert isinstance(mu, TensorIndex) - assert mu.is_up - assert not (-mu).is_up - - -def test_indices(): - (coords, metric) = _generate_simple() - idxs = indices("i0:4", metric) - assert len(idxs) == 4 - assert all([isinstance(i, Index) for i in idxs]) - - -def test_Tensor(): - from sympy.tensor.tensor import tensorsymmetry - - (coords, metric) = _generate_simple() - T = Tensor("T", coords, metric) - assert isinstance(T, TensorHead) - assert T.as_array() == Array(coords) - assert T.covar == (1,) - assert T.symmetry == tensorsymmetry([1]) - - -def test_Tensor_comm(): - (coords, metric) = _generate_simple() - T = Tensor("T", coords, metric) - assert T.commutes_with(T) == 0 - assert T.commutes_with(metric) == 0 - assert T.commutes_with(metric.partial) is None - - -def test_Tensor_simplify(): - (coords, metric) = _generate_simple() - x, y, z = coords - expr = -(1 - x) ** 2 / (x - 1) - expr_simplified = 1 - x - T = Tensor("T", 3 * [expr], metric) - assert str(T.simplify()[0]) == str(expr_simplified) - - -def test_Tensor_covariance_transform(): - (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() - E, p1, p2, p3 = symbols("E p_1:4", positive=True) - p = Tensor("p", [E, p1, p2, p3], g) - res = p.covariance_transform(-mu) - expect = Array( - [E * (1 - 1 / r), -p1 / (1 - 1 / r), -p2 * r ** 2, -p3 * r ** 2 * sin(th) ** 2] - ) - assert res[0].equals(expect[0]) - assert res[1].equals(expect[1]) - assert res[2].equals(expect[2]) - assert res[3].equals(expect[3]) - - -def test_AbstractTensor(): - (coords, metric) = _generate_simple() - T = Tensor("T", coords, metric) - assert isinstance(T, AbstractTensor) - assert isinstance(T.as_array(), Array) - assert T.is_Tensor - assert not T.is_Metric - assert not T.is_Spacetime - - -def test_IndexedTensor(): - (coords, metric) = _generate_simple() - T = Tensor("T", coords, metric) - mu = Index("mu", metric) - assert isinstance(T(mu), IndexedTensor) - - -def test_ReplacementManager(): - pass - - -def test_expand_tensor(): - (coords, t, r, th, ph, mink, eta, mu, nu) = _generate_minkowski() - E1, E2, E3, B1, B2, B3 = symbols("E_1:4 B_1:4", real=True) - matrix = [[0, -E1, -E2, -E3], [E1, 0, -B3, B2], [E2, B3, 0, -B1], [E3, -B2, B1, 0]] - F = Tensor("F", matrix, eta, symmetry=[[2]]) - assert expand_tensor(eta(mu, nu) * eta(-mu, -nu)) == 4 - assert expand_tensor(F(mu, -mu)) == 0 - assert ( - expand_tensor(F(mu, nu) * F(-mu, -nu)) - == 2 * B1 ** 2 - + 2 * B2 ** 2 - + 2 * B3 ** 2 - - 2 * E1 ** 2 - - 2 * E2 ** 2 - - 2 * E3 ** 2 - ) - (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() - x = Tensor("x", [t, r, th, ph], g) - res = expand_tensor(g(mu, nu)) - assert schw.inv().equals(res) - res1 = expand_tensor(g(mu, nu) * g(-mu, -nu)) - res2 = expand_tensor(g(-mu, -nu) * g(mu, nu)) - assert res1 == res2 - assert simplify(res1) == 4 - res1 = expand_tensor(g(-mu, -nu) * x(nu)) - res2 = expand_tensor(x(-mu)) - res3 = x.covariance_transform(-mu) - assert res1 == res2 - assert res2 == res3 - res1 = expand_tensor(g(mu, nu) * x(-nu)) - res2 = expand_tensor(x(mu)) - assert simplify(res1) == res2 - res = expand_tensor(x(mu) * x(-mu)) - assert ( - res - == t ** 2 * (1 - 1 / r) - - r ** 2 / (1 - 1 / r) - - th ** 2 * r ** 2 - - ph ** 2 * r ** 2 * sin(th) ** 2 - ) From 4030936896eb886df66bb8cc533bd4f35f87bc4a Mon Sep 17 00:00:00 2001 From: cjayross Date: Wed, 3 Jul 2019 21:54:27 -0500 Subject: [PATCH 05/34] removed metric commutation group, added tox.ini, reformatted --- src/riccipy/tensor.py | 4 +- src/riccipy/tests/ipy_test_environment.py | 3 +- src/riccipy/tests/test_metric.py | 1 + src/riccipy/tests/test_partial.py | 3 +- src/riccipy/tests/test_tensor.py | 5 +- tox.ini | 73 +++++++++++++++++++++++ 6 files changed, 80 insertions(+), 9 deletions(-) create mode 100644 tox.ini diff --git a/src/riccipy/tensor.py b/src/riccipy/tensor.py index 53a4473..5df7294 100644 --- a/src/riccipy/tensor.py +++ b/src/riccipy/tensor.py @@ -3,9 +3,9 @@ from sympy import Array, simplify, symbols from sympy.core.compatibility import string_types from sympy.tensor.array import permutedims, tensorcontraction, tensorproduct +from sympy.tensor.tensor import TensMul +from sympy.tensor.tensor import Tensor as SympyTensor from sympy.tensor.tensor import ( - TensMul, - Tensor as SympyTensor, TensorHead, TensorIndex, TensorManager, diff --git a/src/riccipy/tests/ipy_test_environment.py b/src/riccipy/tests/ipy_test_environment.py index 445354a..57d4936 100644 --- a/src/riccipy/tests/ipy_test_environment.py +++ b/src/riccipy/tests/ipy_test_environment.py @@ -1,8 +1,7 @@ -from sympy import * - from riccipy.metric import * from riccipy.partial import * from riccipy.tensor import * +from sympy import * init_printing() diff --git a/src/riccipy/tests/test_metric.py b/src/riccipy/tests/test_metric.py index 0e243bd..c67a754 100644 --- a/src/riccipy/tests/test_metric.py +++ b/src/riccipy/tests/test_metric.py @@ -3,6 +3,7 @@ from riccipy.metric import * from riccipy.partial import * from riccipy.tensor import * +from sympy import Expr, diag, sin, symbols, zeros def _generate_schwarzschild(): diff --git a/src/riccipy/tests/test_partial.py b/src/riccipy/tests/test_partial.py index 6b1402b..31b2149 100644 --- a/src/riccipy/tests/test_partial.py +++ b/src/riccipy/tests/test_partial.py @@ -1,8 +1,7 @@ -from sympy import diag, sin, symbols - from riccipy.metric import * from riccipy.partial import * from riccipy.tensor import * +from sympy import diag, sin, symbols def _generate_schwarzschild(): diff --git a/src/riccipy/tests/test_tensor.py b/src/riccipy/tests/test_tensor.py index ab68c7e..27623e4 100644 --- a/src/riccipy/tests/test_tensor.py +++ b/src/riccipy/tests/test_tensor.py @@ -1,8 +1,7 @@ -from sympy import Array, diag, eye, simplify, sin, symbols -from sympy.tensor.tensor import TensExpr, TensMul - from riccipy.metric import * from riccipy.tensor import * +from sympy import Array, diag, eye, simplify, sin, symbols +from sympy.tensor.tensor import TensExpr, TensMul def _generate_simple(): diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..43fc3f0 --- /dev/null +++ b/tox.ini @@ -0,0 +1,73 @@ +[tox] +description = list of environments againts tox runs the tests +envlist = + clean, + check, + docs, + py35, + py36 + py37 + pypy, + pypy3 + +[testenv] +basepython = + pypy: {env:PYTHON:pypy} + pypy3: {env:PYTHON:pypy3} + py35: {env:PYTHON:python3.5} + {py36,docs}: {env:PYTHON:python3.6} + py37: {env:PYTHON:python3.7} + {clean,check,reformat}: {env:PYTHON:python3} +setenv = + PYTHONPATH={toxinidir}/tests + PYTHONUNBUFFERED=yes +passenv = + * +usedevelop = false +deps = + pytest-cov + ipywidgets +skip_install = false +commands = + {posargs:pytest --cov --cov-report=term-missing -vv src/einsteinpy/tests} + + +[testenv:check] +description = this environments checks for flake8, black, isort and einsteinpy code style +deps = + black + docutils + isort + flake8 + mypy + pygments +skip_install = true +commands = + python setup.py check --strict --metadata --restructuredtext + flake8 src setup.py + isort --check-only --diff --recursive --project einsteinpy --section-default THIRDPARTY src setup.py + black --check src setup.py + mypy --ignore-missing-imports --check-untyped-defs --no-strict-optional src + + +[testenv:reformat] +description = reformats the code using black and isort +deps = + black + isort +skip_install = true +commands = + isort --recursive --project einsteinpy --section-default THIRDPARTY src setup.py + black src setup.py + + +[testenv:docs] +description = invoke sphinx-build to build the HTML docs +extras = docs +whitelist_externals = sphinx-build +commands = sphinx-build -d "{toxworkdir}/docs_doctree" docs/source "{toxworkdir}/docs_out" --color -W -bhtml + +[testenv:clean] +commands = coverage erase +skip_install = true +deps = coverage From d2bf9b1b2f133e9a8886aa30bda496f88f5c64ca Mon Sep 17 00:00:00 2001 From: cjayross Date: Wed, 3 Jul 2019 21:56:03 -0500 Subject: [PATCH 06/34] Revert "added myself as an author" This reverts commit 014c284369d69d04c7626ac213339d6a69878969. --- AUTHORS | 3 --- 1 file changed, 3 deletions(-) diff --git a/AUTHORS b/AUTHORS index 0c81213..8412821 100644 --- a/AUTHORS +++ b/AUTHORS @@ -9,6 +9,3 @@ * Priyanshu Khandelwal Primary Author - -* Calvin Jay Ross - Primary Author From 84efb1cf18ccdc3f0e30c4a849fe3353ae9ec353 Mon Sep 17 00:00:00 2001 From: cjayross Date: Thu, 4 Jul 2019 05:04:48 -0500 Subject: [PATCH 07/34] removed ipy_test_environment and added more strict checks in ReplacementManager --- src/riccipy/tensor.py | 2 +- src/riccipy/tests/ipy_test_environment.py | 29 ----------------------- 2 files changed, 1 insertion(+), 30 deletions(-) delete mode 100644 src/riccipy/tests/ipy_test_environment.py diff --git a/src/riccipy/tensor.py b/src/riccipy/tensor.py index 5df7294..41a9ef9 100644 --- a/src/riccipy/tensor.py +++ b/src/riccipy/tensor.py @@ -29,7 +29,7 @@ class _ReplacementManager(dict): def get_key(self, tensor): item = tensor if (tensor.is_TensorHead or tensor.is_Metric) else tensor.args[0] for key in self.keys(): - if (key == item) or (key.args[0] == item): + if (key is item) or (key.args[0] is item): return key return None diff --git a/src/riccipy/tests/ipy_test_environment.py b/src/riccipy/tests/ipy_test_environment.py deleted file mode 100644 index 57d4936..0000000 --- a/src/riccipy/tests/ipy_test_environment.py +++ /dev/null @@ -1,29 +0,0 @@ -from riccipy.metric import * -from riccipy.partial import * -from riccipy.tensor import * -from sympy import * - -init_printing() - -t, r, th, ph, x, y, z = symbols("t r theta phi x y z", real=True) -momentum = symbols("E p_1:4", positive=True) -E, p1, p2, p3 = momentum -# schw = diag(1-1/r, -1/(1-1/r), -r**2, -r**2*sin(th)**2) -alpha, beta = symbols("alpha beta", cls=Function) -schw = diag(-exp(2 * alpha(r)), exp(2 * beta(r)), r ** 2, r ** 2 * sin(th) ** 2) -g = Metric("g", [t, r, th, ph], schw) -x = Tensor("x", [t, r, th, ph], g) -p = Tensor("p", momentum, g) -mu, nu, si, rh, la = indices("mu nu sigma rho lambda", g) -d = g.partial -Gamma = g.christoffel -R = g.riemann -G = g.einstein -C = g.weyl - -# mink = diag(1, -1, -1, -1) -# eta = Metric('eta', [t, x, y, z], mink) -# al, be, ga = indices('alpha beta gamma', eta) -# E1, E2, E3, B1, B2, B3 = symbols('E_1:4 B_1:4', real=True) -# matrix = [[0, -E1, -E2, -E3], [E1, 0, -B3, B2], [E2, B3, 0, -B1], [E3, -B2, B1, 0]] -# F = Tensor('F', matrix, eta, symmetry=[[2]]) From a3bd7d9433886f6d7d31c25415208a1ad01be243 Mon Sep 17 00:00:00 2001 From: cjayross Date: Fri, 5 Jul 2019 05:39:11 -0500 Subject: [PATCH 08/34] fixed test cases, loosened comparisons in ReplacementManager --- src/riccipy/tensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/riccipy/tensor.py b/src/riccipy/tensor.py index 41a9ef9..5df7294 100644 --- a/src/riccipy/tensor.py +++ b/src/riccipy/tensor.py @@ -29,7 +29,7 @@ class _ReplacementManager(dict): def get_key(self, tensor): item = tensor if (tensor.is_TensorHead or tensor.is_Metric) else tensor.args[0] for key in self.keys(): - if (key is item) or (key.args[0] is item): + if (key == item) or (key.args[0] == item): return key return None From 5f342a053c0614d5b099eafe7374ea5ecdf59d6e Mon Sep 17 00:00:00 2001 From: cjayross Date: Sat, 6 Jul 2019 19:36:31 -0500 Subject: [PATCH 09/34] reformatted --- src/riccipy/tensor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/riccipy/tensor.py b/src/riccipy/tensor.py index 5df7294..53a4473 100644 --- a/src/riccipy/tensor.py +++ b/src/riccipy/tensor.py @@ -3,9 +3,9 @@ from sympy import Array, simplify, symbols from sympy.core.compatibility import string_types from sympy.tensor.array import permutedims, tensorcontraction, tensorproduct -from sympy.tensor.tensor import TensMul -from sympy.tensor.tensor import Tensor as SympyTensor from sympy.tensor.tensor import ( + TensMul, + Tensor as SympyTensor, TensorHead, TensorIndex, TensorManager, From 9a77b33359b602c4c6387d5fb1637e0fcc9a6f88 Mon Sep 17 00:00:00 2001 From: cjayross Date: Sat, 6 Jul 2019 19:38:32 -0500 Subject: [PATCH 10/34] ran isort --- src/riccipy/tests/test_metric.py | 1 - src/riccipy/tests/test_partial.py | 3 ++- src/riccipy/tests/test_tensor.py | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/riccipy/tests/test_metric.py b/src/riccipy/tests/test_metric.py index c67a754..0e243bd 100644 --- a/src/riccipy/tests/test_metric.py +++ b/src/riccipy/tests/test_metric.py @@ -3,7 +3,6 @@ from riccipy.metric import * from riccipy.partial import * from riccipy.tensor import * -from sympy import Expr, diag, sin, symbols, zeros def _generate_schwarzschild(): diff --git a/src/riccipy/tests/test_partial.py b/src/riccipy/tests/test_partial.py index 31b2149..6b1402b 100644 --- a/src/riccipy/tests/test_partial.py +++ b/src/riccipy/tests/test_partial.py @@ -1,7 +1,8 @@ +from sympy import diag, sin, symbols + from riccipy.metric import * from riccipy.partial import * from riccipy.tensor import * -from sympy import diag, sin, symbols def _generate_schwarzschild(): diff --git a/src/riccipy/tests/test_tensor.py b/src/riccipy/tests/test_tensor.py index 27623e4..ab68c7e 100644 --- a/src/riccipy/tests/test_tensor.py +++ b/src/riccipy/tests/test_tensor.py @@ -1,8 +1,9 @@ -from riccipy.metric import * -from riccipy.tensor import * from sympy import Array, diag, eye, simplify, sin, symbols from sympy.tensor.tensor import TensExpr, TensMul +from riccipy.metric import * +from riccipy.tensor import * + def _generate_simple(): coords = symbols("x y z", real=True) From bc228f551b5de7fdd43cac8e436c8a049516e763 Mon Sep 17 00:00:00 2001 From: cjayross Date: Wed, 3 Jul 2019 19:46:10 -0500 Subject: [PATCH 11/34] added source files --- src/test_symbolic/ipy_test_environment.py | 30 +++++ src/test_symbolic/test_metric.py | 100 +++++++++++++++ src/test_symbolic/test_partial.py | 34 +++++ src/test_symbolic/test_tensor.py | 149 ++++++++++++++++++++++ 4 files changed, 313 insertions(+) create mode 100644 src/test_symbolic/ipy_test_environment.py create mode 100644 src/test_symbolic/test_metric.py create mode 100644 src/test_symbolic/test_partial.py create mode 100644 src/test_symbolic/test_tensor.py diff --git a/src/test_symbolic/ipy_test_environment.py b/src/test_symbolic/ipy_test_environment.py new file mode 100644 index 0000000..445354a --- /dev/null +++ b/src/test_symbolic/ipy_test_environment.py @@ -0,0 +1,30 @@ +from sympy import * + +from riccipy.metric import * +from riccipy.partial import * +from riccipy.tensor import * + +init_printing() + +t, r, th, ph, x, y, z = symbols("t r theta phi x y z", real=True) +momentum = symbols("E p_1:4", positive=True) +E, p1, p2, p3 = momentum +# schw = diag(1-1/r, -1/(1-1/r), -r**2, -r**2*sin(th)**2) +alpha, beta = symbols("alpha beta", cls=Function) +schw = diag(-exp(2 * alpha(r)), exp(2 * beta(r)), r ** 2, r ** 2 * sin(th) ** 2) +g = Metric("g", [t, r, th, ph], schw) +x = Tensor("x", [t, r, th, ph], g) +p = Tensor("p", momentum, g) +mu, nu, si, rh, la = indices("mu nu sigma rho lambda", g) +d = g.partial +Gamma = g.christoffel +R = g.riemann +G = g.einstein +C = g.weyl + +# mink = diag(1, -1, -1, -1) +# eta = Metric('eta', [t, x, y, z], mink) +# al, be, ga = indices('alpha beta gamma', eta) +# E1, E2, E3, B1, B2, B3 = symbols('E_1:4 B_1:4', real=True) +# matrix = [[0, -E1, -E2, -E3], [E1, 0, -B3, B2], [E2, B3, 0, -B1], [E3, -B2, B1, 0]] +# F = Tensor('F', matrix, eta, symmetry=[[2]]) diff --git a/src/test_symbolic/test_metric.py b/src/test_symbolic/test_metric.py new file mode 100644 index 0000000..93ba727 --- /dev/null +++ b/src/test_symbolic/test_metric.py @@ -0,0 +1,100 @@ +from sympy import Expr, diag, sin, symbols, zeros + +from riccipy.metric import * +from riccipy.partial import * +from riccipy.tensor import * + + +def _generate_schwarzschild(): + coords = symbols("t r theta phi", real=True) + t, r, th, ph = coords + schw = diag(1 - 1 / r, -1 / (1 - 1 / r), -r ** 2, -r ** 2 * sin(th) ** 2) + g = SpacetimeMetric("g", coords, schw, timelike=True) + mu, nu = indices("mu nu", g) + return (coords, t, r, th, ph, schw, g, mu, nu) + + +def test_Metric(): + (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() + assert isinstance(g, AbstractTensor) + assert isinstance(g, TensorIndexType) + assert isinstance(g(mu, nu), IndexedTensor) + assert isinstance(g.metric, Tensor) + assert isinstance(g.partial, PartialDerivative) + assert g.metric.covar == (-1, -1) + + +def test_SpacetimeMetric(): + (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() + array1 = g.as_array() + assert g.signature == (1, -1, -1, -1) + rev_sig = g.reverse_signature() + array2 = g.as_array() + assert rev_sig == (-1, 1, 1, 1) + assert array1 == -1 * array2 + + +def test_Metric_christoffel(): + (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() + gamma = g.christoffel.simplify() + assert ( + str(gamma) + == "[[[0, 0.5/(r*(r - 1)), 0, 0], [0.5/(r*(r - 1)), 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]], [[0.5*(r - 1)/r**3, 0, 0, 0], [0, -0.5/(r*(r - 1)), 0, 0], [0, 0, 1.0 - 1.0*r, 0], [0, 0, 0, (1.0 - 1.0*r)*sin(theta)**2]], [[0, 0, 0, 0], [0, 0, 1.0/r, 0], [0, 1.0/r, 0, 0], [0, 0, 0, -0.5*sin(2*theta)]], [[0, 0, 0, 0], [0, 0, 0, 1.0/r], [0, 0, 0, 1.0/tan(theta)], [0, 1.0/r, 1.0/tan(theta), 0]]]" + ) + + +def test_Metric_riemann(): + (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() + rh, si = indices("rho sigma", g) + R = g.riemann + + def is_zero(arr): + for comp in arr: + yield comp.equals(0) + + expr = R(-rh, -si, -mu, -nu) + R(-si, -rh, -mu, -nu) + assert all(is_zero(expand_tensor(expr))) + expr = R(-rh, -si, -mu, -nu) + R(-rh, -si, -nu, -mu) + assert all(is_zero(expand_tensor(expr))) + expr = R(-rh, -si, -mu, -nu) - R(-mu, -nu, -rh, -si) + assert all(is_zero(expand_tensor(expr))) + expr = R(-rh, -si, -mu, -nu) + R(-rh, -mu, -nu, -si) + R(-rh, -nu, -si, -mu) + assert all(is_zero(expand_tensor(expr))) + + +def test_Metric_ricci_tensor(): + (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() + R = g.ricci_tensor + assert zeros(4).equals(R.as_array()) + + +def test_Metric_ricci_scalar(): + (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() + R = g.ricci_scalar + assert isinstance(R, Expr) + assert R.equals(0) + + +def test_Metric_einstein(): + (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() + G = g.einstein + assert zeros(4).equals(G.as_array()) + + +def test_Metric_weyl(): + (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() + rh, si = indices("rho sigma", g) + C = g.weyl + + def is_zero(arr): + for comp in arr: + yield comp.equals(0) + + expr = C(-rh, -si, -mu, -nu) + C(-si, -rh, -mu, -nu) + assert all(is_zero(expand_tensor(expr))) + expr = C(-rh, -si, -mu, -nu) + C(-rh, -si, -nu, -mu) + assert all(is_zero(expand_tensor(expr))) + expr = C(-rh, -si, -mu, -nu) - C(-mu, -nu, -rh, -si) + assert all(is_zero(expand_tensor(expr))) + expr = C(-rh, -si, -mu, -nu) + C(-rh, -mu, -nu, -si) + C(-rh, -nu, -si, -mu) + assert all(is_zero(expand_tensor(expr))) diff --git a/src/test_symbolic/test_partial.py b/src/test_symbolic/test_partial.py new file mode 100644 index 0000000..5b8ee4d --- /dev/null +++ b/src/test_symbolic/test_partial.py @@ -0,0 +1,34 @@ +from sympy import diag, sin, symbols + +from riccipy.metric import * +from riccipy.partial import * +from riccipy.tensor import * + + +def _generate_schwarzschild(): + coords = symbols("t r theta phi", real=True) + t, r, th, ph = coords + schw = diag(1 - 1 / r, -1 / (1 - 1 / r), -r ** 2, -r ** 2 * sin(th) ** 2) + g = SpacetimeMetric("g", coords, schw, timelike=True) + mu, nu = indices("mu nu", g) + return (coords, t, r, th, ph, schw, g, mu, nu) + + +def test_DiffOperator(): + r = Symbol("r") + dr = DiffOperator(r) + expr = dr * (1 - 1 / r) + assert expr == 1 / r ** 2 + expr = (1 - 1 / r) * dr + assert isinstance(expr, DiffOperator) + assert (expr * (r ** 3 / 3)).equals(r * (r - 1)) + + +def test_PartialDerivative(): + (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() + d = g.partial + assert isinstance(d, PartialDerivative) + assert isinstance(d, Tensor) + assert d.commutes_with(d) == 0 + assert d.covar == (-1,) + assert all([isinstance(dx, DiffOperator) for dx in d.as_array()]) diff --git a/src/test_symbolic/test_tensor.py b/src/test_symbolic/test_tensor.py new file mode 100644 index 0000000..ab68c7e --- /dev/null +++ b/src/test_symbolic/test_tensor.py @@ -0,0 +1,149 @@ +from sympy import Array, diag, eye, simplify, sin, symbols +from sympy.tensor.tensor import TensExpr, TensMul + +from riccipy.metric import * +from riccipy.tensor import * + + +def _generate_simple(): + coords = symbols("x y z", real=True) + metric = Metric("metric", coords, eye(3)) + return (coords, metric) + + +def _generate_schwarzschild(): + coords = symbols("t r theta phi", real=True) + t, r, th, ph = coords + schw = diag(1 - 1 / r, -1 / (1 - 1 / r), -r ** 2, -r ** 2 * sin(th) ** 2) + g = Metric("g", coords, schw) + mu, nu = indices("mu nu", g) + return (coords, t, r, th, ph, schw, g, mu, nu) + + +def _generate_minkowski(): + coords = symbols("t x y z", real=True) + t, x, y, z = coords + mink = diag(1, -1, -1, -1) + eta = Metric("eta", coords, mink) + mu, nu = indices("mu nu", eta) + return (coords, t, x, y, z, mink, eta, mu, nu) + + +def test_Index(): + (coords, metric) = _generate_simple() + mu = Index("mu", metric) + assert isinstance(mu, TensorIndex) + assert mu.is_up + assert not (-mu).is_up + + +def test_indices(): + (coords, metric) = _generate_simple() + idxs = indices("i0:4", metric) + assert len(idxs) == 4 + assert all([isinstance(i, Index) for i in idxs]) + + +def test_Tensor(): + from sympy.tensor.tensor import tensorsymmetry + + (coords, metric) = _generate_simple() + T = Tensor("T", coords, metric) + assert isinstance(T, TensorHead) + assert T.as_array() == Array(coords) + assert T.covar == (1,) + assert T.symmetry == tensorsymmetry([1]) + + +def test_Tensor_comm(): + (coords, metric) = _generate_simple() + T = Tensor("T", coords, metric) + assert T.commutes_with(T) == 0 + assert T.commutes_with(metric) == 0 + assert T.commutes_with(metric.partial) is None + + +def test_Tensor_simplify(): + (coords, metric) = _generate_simple() + x, y, z = coords + expr = -(1 - x) ** 2 / (x - 1) + expr_simplified = 1 - x + T = Tensor("T", 3 * [expr], metric) + assert str(T.simplify()[0]) == str(expr_simplified) + + +def test_Tensor_covariance_transform(): + (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() + E, p1, p2, p3 = symbols("E p_1:4", positive=True) + p = Tensor("p", [E, p1, p2, p3], g) + res = p.covariance_transform(-mu) + expect = Array( + [E * (1 - 1 / r), -p1 / (1 - 1 / r), -p2 * r ** 2, -p3 * r ** 2 * sin(th) ** 2] + ) + assert res[0].equals(expect[0]) + assert res[1].equals(expect[1]) + assert res[2].equals(expect[2]) + assert res[3].equals(expect[3]) + + +def test_AbstractTensor(): + (coords, metric) = _generate_simple() + T = Tensor("T", coords, metric) + assert isinstance(T, AbstractTensor) + assert isinstance(T.as_array(), Array) + assert T.is_Tensor + assert not T.is_Metric + assert not T.is_Spacetime + + +def test_IndexedTensor(): + (coords, metric) = _generate_simple() + T = Tensor("T", coords, metric) + mu = Index("mu", metric) + assert isinstance(T(mu), IndexedTensor) + + +def test_ReplacementManager(): + pass + + +def test_expand_tensor(): + (coords, t, r, th, ph, mink, eta, mu, nu) = _generate_minkowski() + E1, E2, E3, B1, B2, B3 = symbols("E_1:4 B_1:4", real=True) + matrix = [[0, -E1, -E2, -E3], [E1, 0, -B3, B2], [E2, B3, 0, -B1], [E3, -B2, B1, 0]] + F = Tensor("F", matrix, eta, symmetry=[[2]]) + assert expand_tensor(eta(mu, nu) * eta(-mu, -nu)) == 4 + assert expand_tensor(F(mu, -mu)) == 0 + assert ( + expand_tensor(F(mu, nu) * F(-mu, -nu)) + == 2 * B1 ** 2 + + 2 * B2 ** 2 + + 2 * B3 ** 2 + - 2 * E1 ** 2 + - 2 * E2 ** 2 + - 2 * E3 ** 2 + ) + (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() + x = Tensor("x", [t, r, th, ph], g) + res = expand_tensor(g(mu, nu)) + assert schw.inv().equals(res) + res1 = expand_tensor(g(mu, nu) * g(-mu, -nu)) + res2 = expand_tensor(g(-mu, -nu) * g(mu, nu)) + assert res1 == res2 + assert simplify(res1) == 4 + res1 = expand_tensor(g(-mu, -nu) * x(nu)) + res2 = expand_tensor(x(-mu)) + res3 = x.covariance_transform(-mu) + assert res1 == res2 + assert res2 == res3 + res1 = expand_tensor(g(mu, nu) * x(-nu)) + res2 = expand_tensor(x(mu)) + assert simplify(res1) == res2 + res = expand_tensor(x(mu) * x(-mu)) + assert ( + res + == t ** 2 * (1 - 1 / r) + - r ** 2 / (1 - 1 / r) + - th ** 2 * r ** 2 + - ph ** 2 * r ** 2 * sin(th) ** 2 + ) From 5c61856ff8cb04f64aa03ade5eb51ec08a80994c Mon Sep 17 00:00:00 2001 From: cjayross Date: Wed, 3 Jul 2019 20:12:28 -0500 Subject: [PATCH 12/34] added myself as an author --- AUTHORS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS b/AUTHORS index 8412821..0c81213 100644 --- a/AUTHORS +++ b/AUTHORS @@ -9,3 +9,6 @@ * Priyanshu Khandelwal Primary Author + +* Calvin Jay Ross + Primary Author From 6bd731d3f3bd0f64713b0f20526e48817553fed4 Mon Sep 17 00:00:00 2001 From: cjayross Date: Wed, 3 Jul 2019 20:14:14 -0500 Subject: [PATCH 13/34] reorganized test files --- .../tests}/ipy_test_environment.py | 0 src/test_symbolic/test_metric.py | 100 ------------ src/test_symbolic/test_partial.py | 34 ---- src/test_symbolic/test_tensor.py | 149 ------------------ 4 files changed, 283 deletions(-) rename src/{test_symbolic => riccipy/tests}/ipy_test_environment.py (100%) delete mode 100644 src/test_symbolic/test_metric.py delete mode 100644 src/test_symbolic/test_partial.py delete mode 100644 src/test_symbolic/test_tensor.py diff --git a/src/test_symbolic/ipy_test_environment.py b/src/riccipy/tests/ipy_test_environment.py similarity index 100% rename from src/test_symbolic/ipy_test_environment.py rename to src/riccipy/tests/ipy_test_environment.py diff --git a/src/test_symbolic/test_metric.py b/src/test_symbolic/test_metric.py deleted file mode 100644 index 93ba727..0000000 --- a/src/test_symbolic/test_metric.py +++ /dev/null @@ -1,100 +0,0 @@ -from sympy import Expr, diag, sin, symbols, zeros - -from riccipy.metric import * -from riccipy.partial import * -from riccipy.tensor import * - - -def _generate_schwarzschild(): - coords = symbols("t r theta phi", real=True) - t, r, th, ph = coords - schw = diag(1 - 1 / r, -1 / (1 - 1 / r), -r ** 2, -r ** 2 * sin(th) ** 2) - g = SpacetimeMetric("g", coords, schw, timelike=True) - mu, nu = indices("mu nu", g) - return (coords, t, r, th, ph, schw, g, mu, nu) - - -def test_Metric(): - (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() - assert isinstance(g, AbstractTensor) - assert isinstance(g, TensorIndexType) - assert isinstance(g(mu, nu), IndexedTensor) - assert isinstance(g.metric, Tensor) - assert isinstance(g.partial, PartialDerivative) - assert g.metric.covar == (-1, -1) - - -def test_SpacetimeMetric(): - (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() - array1 = g.as_array() - assert g.signature == (1, -1, -1, -1) - rev_sig = g.reverse_signature() - array2 = g.as_array() - assert rev_sig == (-1, 1, 1, 1) - assert array1 == -1 * array2 - - -def test_Metric_christoffel(): - (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() - gamma = g.christoffel.simplify() - assert ( - str(gamma) - == "[[[0, 0.5/(r*(r - 1)), 0, 0], [0.5/(r*(r - 1)), 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]], [[0.5*(r - 1)/r**3, 0, 0, 0], [0, -0.5/(r*(r - 1)), 0, 0], [0, 0, 1.0 - 1.0*r, 0], [0, 0, 0, (1.0 - 1.0*r)*sin(theta)**2]], [[0, 0, 0, 0], [0, 0, 1.0/r, 0], [0, 1.0/r, 0, 0], [0, 0, 0, -0.5*sin(2*theta)]], [[0, 0, 0, 0], [0, 0, 0, 1.0/r], [0, 0, 0, 1.0/tan(theta)], [0, 1.0/r, 1.0/tan(theta), 0]]]" - ) - - -def test_Metric_riemann(): - (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() - rh, si = indices("rho sigma", g) - R = g.riemann - - def is_zero(arr): - for comp in arr: - yield comp.equals(0) - - expr = R(-rh, -si, -mu, -nu) + R(-si, -rh, -mu, -nu) - assert all(is_zero(expand_tensor(expr))) - expr = R(-rh, -si, -mu, -nu) + R(-rh, -si, -nu, -mu) - assert all(is_zero(expand_tensor(expr))) - expr = R(-rh, -si, -mu, -nu) - R(-mu, -nu, -rh, -si) - assert all(is_zero(expand_tensor(expr))) - expr = R(-rh, -si, -mu, -nu) + R(-rh, -mu, -nu, -si) + R(-rh, -nu, -si, -mu) - assert all(is_zero(expand_tensor(expr))) - - -def test_Metric_ricci_tensor(): - (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() - R = g.ricci_tensor - assert zeros(4).equals(R.as_array()) - - -def test_Metric_ricci_scalar(): - (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() - R = g.ricci_scalar - assert isinstance(R, Expr) - assert R.equals(0) - - -def test_Metric_einstein(): - (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() - G = g.einstein - assert zeros(4).equals(G.as_array()) - - -def test_Metric_weyl(): - (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() - rh, si = indices("rho sigma", g) - C = g.weyl - - def is_zero(arr): - for comp in arr: - yield comp.equals(0) - - expr = C(-rh, -si, -mu, -nu) + C(-si, -rh, -mu, -nu) - assert all(is_zero(expand_tensor(expr))) - expr = C(-rh, -si, -mu, -nu) + C(-rh, -si, -nu, -mu) - assert all(is_zero(expand_tensor(expr))) - expr = C(-rh, -si, -mu, -nu) - C(-mu, -nu, -rh, -si) - assert all(is_zero(expand_tensor(expr))) - expr = C(-rh, -si, -mu, -nu) + C(-rh, -mu, -nu, -si) + C(-rh, -nu, -si, -mu) - assert all(is_zero(expand_tensor(expr))) diff --git a/src/test_symbolic/test_partial.py b/src/test_symbolic/test_partial.py deleted file mode 100644 index 5b8ee4d..0000000 --- a/src/test_symbolic/test_partial.py +++ /dev/null @@ -1,34 +0,0 @@ -from sympy import diag, sin, symbols - -from riccipy.metric import * -from riccipy.partial import * -from riccipy.tensor import * - - -def _generate_schwarzschild(): - coords = symbols("t r theta phi", real=True) - t, r, th, ph = coords - schw = diag(1 - 1 / r, -1 / (1 - 1 / r), -r ** 2, -r ** 2 * sin(th) ** 2) - g = SpacetimeMetric("g", coords, schw, timelike=True) - mu, nu = indices("mu nu", g) - return (coords, t, r, th, ph, schw, g, mu, nu) - - -def test_DiffOperator(): - r = Symbol("r") - dr = DiffOperator(r) - expr = dr * (1 - 1 / r) - assert expr == 1 / r ** 2 - expr = (1 - 1 / r) * dr - assert isinstance(expr, DiffOperator) - assert (expr * (r ** 3 / 3)).equals(r * (r - 1)) - - -def test_PartialDerivative(): - (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() - d = g.partial - assert isinstance(d, PartialDerivative) - assert isinstance(d, Tensor) - assert d.commutes_with(d) == 0 - assert d.covar == (-1,) - assert all([isinstance(dx, DiffOperator) for dx in d.as_array()]) diff --git a/src/test_symbolic/test_tensor.py b/src/test_symbolic/test_tensor.py deleted file mode 100644 index ab68c7e..0000000 --- a/src/test_symbolic/test_tensor.py +++ /dev/null @@ -1,149 +0,0 @@ -from sympy import Array, diag, eye, simplify, sin, symbols -from sympy.tensor.tensor import TensExpr, TensMul - -from riccipy.metric import * -from riccipy.tensor import * - - -def _generate_simple(): - coords = symbols("x y z", real=True) - metric = Metric("metric", coords, eye(3)) - return (coords, metric) - - -def _generate_schwarzschild(): - coords = symbols("t r theta phi", real=True) - t, r, th, ph = coords - schw = diag(1 - 1 / r, -1 / (1 - 1 / r), -r ** 2, -r ** 2 * sin(th) ** 2) - g = Metric("g", coords, schw) - mu, nu = indices("mu nu", g) - return (coords, t, r, th, ph, schw, g, mu, nu) - - -def _generate_minkowski(): - coords = symbols("t x y z", real=True) - t, x, y, z = coords - mink = diag(1, -1, -1, -1) - eta = Metric("eta", coords, mink) - mu, nu = indices("mu nu", eta) - return (coords, t, x, y, z, mink, eta, mu, nu) - - -def test_Index(): - (coords, metric) = _generate_simple() - mu = Index("mu", metric) - assert isinstance(mu, TensorIndex) - assert mu.is_up - assert not (-mu).is_up - - -def test_indices(): - (coords, metric) = _generate_simple() - idxs = indices("i0:4", metric) - assert len(idxs) == 4 - assert all([isinstance(i, Index) for i in idxs]) - - -def test_Tensor(): - from sympy.tensor.tensor import tensorsymmetry - - (coords, metric) = _generate_simple() - T = Tensor("T", coords, metric) - assert isinstance(T, TensorHead) - assert T.as_array() == Array(coords) - assert T.covar == (1,) - assert T.symmetry == tensorsymmetry([1]) - - -def test_Tensor_comm(): - (coords, metric) = _generate_simple() - T = Tensor("T", coords, metric) - assert T.commutes_with(T) == 0 - assert T.commutes_with(metric) == 0 - assert T.commutes_with(metric.partial) is None - - -def test_Tensor_simplify(): - (coords, metric) = _generate_simple() - x, y, z = coords - expr = -(1 - x) ** 2 / (x - 1) - expr_simplified = 1 - x - T = Tensor("T", 3 * [expr], metric) - assert str(T.simplify()[0]) == str(expr_simplified) - - -def test_Tensor_covariance_transform(): - (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() - E, p1, p2, p3 = symbols("E p_1:4", positive=True) - p = Tensor("p", [E, p1, p2, p3], g) - res = p.covariance_transform(-mu) - expect = Array( - [E * (1 - 1 / r), -p1 / (1 - 1 / r), -p2 * r ** 2, -p3 * r ** 2 * sin(th) ** 2] - ) - assert res[0].equals(expect[0]) - assert res[1].equals(expect[1]) - assert res[2].equals(expect[2]) - assert res[3].equals(expect[3]) - - -def test_AbstractTensor(): - (coords, metric) = _generate_simple() - T = Tensor("T", coords, metric) - assert isinstance(T, AbstractTensor) - assert isinstance(T.as_array(), Array) - assert T.is_Tensor - assert not T.is_Metric - assert not T.is_Spacetime - - -def test_IndexedTensor(): - (coords, metric) = _generate_simple() - T = Tensor("T", coords, metric) - mu = Index("mu", metric) - assert isinstance(T(mu), IndexedTensor) - - -def test_ReplacementManager(): - pass - - -def test_expand_tensor(): - (coords, t, r, th, ph, mink, eta, mu, nu) = _generate_minkowski() - E1, E2, E3, B1, B2, B3 = symbols("E_1:4 B_1:4", real=True) - matrix = [[0, -E1, -E2, -E3], [E1, 0, -B3, B2], [E2, B3, 0, -B1], [E3, -B2, B1, 0]] - F = Tensor("F", matrix, eta, symmetry=[[2]]) - assert expand_tensor(eta(mu, nu) * eta(-mu, -nu)) == 4 - assert expand_tensor(F(mu, -mu)) == 0 - assert ( - expand_tensor(F(mu, nu) * F(-mu, -nu)) - == 2 * B1 ** 2 - + 2 * B2 ** 2 - + 2 * B3 ** 2 - - 2 * E1 ** 2 - - 2 * E2 ** 2 - - 2 * E3 ** 2 - ) - (coords, t, r, th, ph, schw, g, mu, nu) = _generate_schwarzschild() - x = Tensor("x", [t, r, th, ph], g) - res = expand_tensor(g(mu, nu)) - assert schw.inv().equals(res) - res1 = expand_tensor(g(mu, nu) * g(-mu, -nu)) - res2 = expand_tensor(g(-mu, -nu) * g(mu, nu)) - assert res1 == res2 - assert simplify(res1) == 4 - res1 = expand_tensor(g(-mu, -nu) * x(nu)) - res2 = expand_tensor(x(-mu)) - res3 = x.covariance_transform(-mu) - assert res1 == res2 - assert res2 == res3 - res1 = expand_tensor(g(mu, nu) * x(-nu)) - res2 = expand_tensor(x(mu)) - assert simplify(res1) == res2 - res = expand_tensor(x(mu) * x(-mu)) - assert ( - res - == t ** 2 * (1 - 1 / r) - - r ** 2 / (1 - 1 / r) - - th ** 2 * r ** 2 - - ph ** 2 * r ** 2 * sin(th) ** 2 - ) From 099f048896152941f3730a58add514e9bc68aa5f Mon Sep 17 00:00:00 2001 From: cjayross Date: Wed, 3 Jul 2019 21:54:27 -0500 Subject: [PATCH 14/34] removed metric commutation group, added tox.ini, reformatted --- src/riccipy/tensor.py | 4 ++-- src/riccipy/tests/ipy_test_environment.py | 3 +-- src/riccipy/tests/test_metric.py | 1 + src/riccipy/tests/test_partial.py | 3 +-- src/riccipy/tests/test_tensor.py | 5 ++--- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/riccipy/tensor.py b/src/riccipy/tensor.py index 53a4473..5df7294 100644 --- a/src/riccipy/tensor.py +++ b/src/riccipy/tensor.py @@ -3,9 +3,9 @@ from sympy import Array, simplify, symbols from sympy.core.compatibility import string_types from sympy.tensor.array import permutedims, tensorcontraction, tensorproduct +from sympy.tensor.tensor import TensMul +from sympy.tensor.tensor import Tensor as SympyTensor from sympy.tensor.tensor import ( - TensMul, - Tensor as SympyTensor, TensorHead, TensorIndex, TensorManager, diff --git a/src/riccipy/tests/ipy_test_environment.py b/src/riccipy/tests/ipy_test_environment.py index 445354a..57d4936 100644 --- a/src/riccipy/tests/ipy_test_environment.py +++ b/src/riccipy/tests/ipy_test_environment.py @@ -1,8 +1,7 @@ -from sympy import * - from riccipy.metric import * from riccipy.partial import * from riccipy.tensor import * +from sympy import * init_printing() diff --git a/src/riccipy/tests/test_metric.py b/src/riccipy/tests/test_metric.py index 0e243bd..c67a754 100644 --- a/src/riccipy/tests/test_metric.py +++ b/src/riccipy/tests/test_metric.py @@ -3,6 +3,7 @@ from riccipy.metric import * from riccipy.partial import * from riccipy.tensor import * +from sympy import Expr, diag, sin, symbols, zeros def _generate_schwarzschild(): diff --git a/src/riccipy/tests/test_partial.py b/src/riccipy/tests/test_partial.py index 6b1402b..31b2149 100644 --- a/src/riccipy/tests/test_partial.py +++ b/src/riccipy/tests/test_partial.py @@ -1,8 +1,7 @@ -from sympy import diag, sin, symbols - from riccipy.metric import * from riccipy.partial import * from riccipy.tensor import * +from sympy import diag, sin, symbols def _generate_schwarzschild(): diff --git a/src/riccipy/tests/test_tensor.py b/src/riccipy/tests/test_tensor.py index ab68c7e..27623e4 100644 --- a/src/riccipy/tests/test_tensor.py +++ b/src/riccipy/tests/test_tensor.py @@ -1,8 +1,7 @@ -from sympy import Array, diag, eye, simplify, sin, symbols -from sympy.tensor.tensor import TensExpr, TensMul - from riccipy.metric import * from riccipy.tensor import * +from sympy import Array, diag, eye, simplify, sin, symbols +from sympy.tensor.tensor import TensExpr, TensMul def _generate_simple(): From 83767bbd6b38a9f75b29b573dfeab5a4dc12fe1c Mon Sep 17 00:00:00 2001 From: cjayross Date: Wed, 3 Jul 2019 21:56:03 -0500 Subject: [PATCH 15/34] Revert "added myself as an author" This reverts commit 014c284369d69d04c7626ac213339d6a69878969. --- AUTHORS | 3 --- 1 file changed, 3 deletions(-) diff --git a/AUTHORS b/AUTHORS index 0c81213..8412821 100644 --- a/AUTHORS +++ b/AUTHORS @@ -9,6 +9,3 @@ * Priyanshu Khandelwal Primary Author - -* Calvin Jay Ross - Primary Author From ac1fd2105539b9414eff30d21d91321fcf972536 Mon Sep 17 00:00:00 2001 From: cjayross Date: Thu, 4 Jul 2019 05:04:48 -0500 Subject: [PATCH 16/34] removed ipy_test_environment and added more strict checks in ReplacementManager --- src/riccipy/tensor.py | 2 +- src/riccipy/tests/ipy_test_environment.py | 29 ----------------------- 2 files changed, 1 insertion(+), 30 deletions(-) delete mode 100644 src/riccipy/tests/ipy_test_environment.py diff --git a/src/riccipy/tensor.py b/src/riccipy/tensor.py index 5df7294..41a9ef9 100644 --- a/src/riccipy/tensor.py +++ b/src/riccipy/tensor.py @@ -29,7 +29,7 @@ class _ReplacementManager(dict): def get_key(self, tensor): item = tensor if (tensor.is_TensorHead or tensor.is_Metric) else tensor.args[0] for key in self.keys(): - if (key == item) or (key.args[0] == item): + if (key is item) or (key.args[0] is item): return key return None diff --git a/src/riccipy/tests/ipy_test_environment.py b/src/riccipy/tests/ipy_test_environment.py deleted file mode 100644 index 57d4936..0000000 --- a/src/riccipy/tests/ipy_test_environment.py +++ /dev/null @@ -1,29 +0,0 @@ -from riccipy.metric import * -from riccipy.partial import * -from riccipy.tensor import * -from sympy import * - -init_printing() - -t, r, th, ph, x, y, z = symbols("t r theta phi x y z", real=True) -momentum = symbols("E p_1:4", positive=True) -E, p1, p2, p3 = momentum -# schw = diag(1-1/r, -1/(1-1/r), -r**2, -r**2*sin(th)**2) -alpha, beta = symbols("alpha beta", cls=Function) -schw = diag(-exp(2 * alpha(r)), exp(2 * beta(r)), r ** 2, r ** 2 * sin(th) ** 2) -g = Metric("g", [t, r, th, ph], schw) -x = Tensor("x", [t, r, th, ph], g) -p = Tensor("p", momentum, g) -mu, nu, si, rh, la = indices("mu nu sigma rho lambda", g) -d = g.partial -Gamma = g.christoffel -R = g.riemann -G = g.einstein -C = g.weyl - -# mink = diag(1, -1, -1, -1) -# eta = Metric('eta', [t, x, y, z], mink) -# al, be, ga = indices('alpha beta gamma', eta) -# E1, E2, E3, B1, B2, B3 = symbols('E_1:4 B_1:4', real=True) -# matrix = [[0, -E1, -E2, -E3], [E1, 0, -B3, B2], [E2, B3, 0, -B1], [E3, -B2, B1, 0]] -# F = Tensor('F', matrix, eta, symmetry=[[2]]) From d2464d8f3e447bbcf94b003cc0dd6f7392383ea3 Mon Sep 17 00:00:00 2001 From: cjayross Date: Fri, 5 Jul 2019 05:39:11 -0500 Subject: [PATCH 17/34] fixed test cases, loosened comparisons in ReplacementManager --- src/riccipy/tensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/riccipy/tensor.py b/src/riccipy/tensor.py index 41a9ef9..5df7294 100644 --- a/src/riccipy/tensor.py +++ b/src/riccipy/tensor.py @@ -29,7 +29,7 @@ class _ReplacementManager(dict): def get_key(self, tensor): item = tensor if (tensor.is_TensorHead or tensor.is_Metric) else tensor.args[0] for key in self.keys(): - if (key is item) or (key.args[0] is item): + if (key == item) or (key.args[0] == item): return key return None From 7af7f8354bfd9ad56884e24b7f3498071d618ddf Mon Sep 17 00:00:00 2001 From: cjayross Date: Sat, 6 Jul 2019 19:36:31 -0500 Subject: [PATCH 18/34] reformatted --- src/riccipy/tensor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/riccipy/tensor.py b/src/riccipy/tensor.py index 5df7294..53a4473 100644 --- a/src/riccipy/tensor.py +++ b/src/riccipy/tensor.py @@ -3,9 +3,9 @@ from sympy import Array, simplify, symbols from sympy.core.compatibility import string_types from sympy.tensor.array import permutedims, tensorcontraction, tensorproduct -from sympy.tensor.tensor import TensMul -from sympy.tensor.tensor import Tensor as SympyTensor from sympy.tensor.tensor import ( + TensMul, + Tensor as SympyTensor, TensorHead, TensorIndex, TensorManager, From 2088f3ff1516af25fed69c17ecded7cdb8b0d840 Mon Sep 17 00:00:00 2001 From: cjayross Date: Sat, 6 Jul 2019 19:38:32 -0500 Subject: [PATCH 19/34] ran isort --- src/riccipy/tests/test_metric.py | 1 - src/riccipy/tests/test_partial.py | 3 ++- src/riccipy/tests/test_tensor.py | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/riccipy/tests/test_metric.py b/src/riccipy/tests/test_metric.py index c67a754..0e243bd 100644 --- a/src/riccipy/tests/test_metric.py +++ b/src/riccipy/tests/test_metric.py @@ -3,7 +3,6 @@ from riccipy.metric import * from riccipy.partial import * from riccipy.tensor import * -from sympy import Expr, diag, sin, symbols, zeros def _generate_schwarzschild(): diff --git a/src/riccipy/tests/test_partial.py b/src/riccipy/tests/test_partial.py index 31b2149..6b1402b 100644 --- a/src/riccipy/tests/test_partial.py +++ b/src/riccipy/tests/test_partial.py @@ -1,7 +1,8 @@ +from sympy import diag, sin, symbols + from riccipy.metric import * from riccipy.partial import * from riccipy.tensor import * -from sympy import diag, sin, symbols def _generate_schwarzschild(): diff --git a/src/riccipy/tests/test_tensor.py b/src/riccipy/tests/test_tensor.py index 27623e4..ab68c7e 100644 --- a/src/riccipy/tests/test_tensor.py +++ b/src/riccipy/tests/test_tensor.py @@ -1,8 +1,9 @@ -from riccipy.metric import * -from riccipy.tensor import * from sympy import Array, diag, eye, simplify, sin, symbols from sympy.tensor.tensor import TensExpr, TensMul +from riccipy.metric import * +from riccipy.tensor import * + def _generate_simple(): coords = symbols("x y z", real=True) From 2bc1ba2e2e59f0278b5f5c65a0a87f893435f185 Mon Sep 17 00:00:00 2001 From: cjayross Date: Sat, 6 Jul 2019 19:35:50 -0500 Subject: [PATCH 20/34] added first metrics --- src/riccipy/metrics/anti_de_sitter_1.py | 7 +++++++ src/riccipy/metrics/anti_de_sitter_2.py | 6 ++++++ src/riccipy/metrics/bayin.py | 12 ++++++++++++ .../metrics/beckers_sinzinkayo_demaret_1.py | 9 +++++++++ .../metrics/beckers_sinzinkayo_demaret_2.py | 9 +++++++++ src/riccipy/metrics/bertotti_robinson_1.py | 7 +++++++ src/riccipy/metrics/bertotti_robinson_2.py | 8 ++++++++ src/riccipy/metrics/bertotti_robinson_3.py | 8 ++++++++ src/riccipy/metrics/bertotti_robinson_4.py | 8 ++++++++ src/riccipy/metrics/bianchi_1.py | 8 ++++++++ src/riccipy/metrics/bianchi_2.py | 8 ++++++++ src/riccipy/metrics/bondi_1.py | 9 +++++++++ src/riccipy/metrics/bondi_2.py | 8 ++++++++ src/riccipy/metrics/bondi_3.py | 13 +++++++++++++ src/riccipy/metrics/boost_1.py | 8 ++++++++ src/riccipy/metrics/boost_2.py | 8 ++++++++ src/riccipy/metrics/boost_3.py | 8 ++++++++ src/riccipy/metrics/buchdahl_land.py | 7 +++++++ src/riccipy/metrics/cmetric.py | 8 ++++++++ src/riccipy/metrics/cross_const_curvature_1.py | 8 ++++++++ src/riccipy/metrics/cross_const_curvature_2.py | 8 ++++++++ src/riccipy/metrics/cross_const_curvature_3.py | 8 ++++++++ src/riccipy/metrics/cross_const_curvature_4.py | 8 ++++++++ src/riccipy/metrics/datta_1.py | 8 ++++++++ src/riccipy/metrics/datta_2.py | 9 +++++++++ src/riccipy/metrics/davidson.py | 8 ++++++++ src/riccipy/metrics/de_sitter_1.py | 9 +++++++++ src/riccipy/metrics/de_sitter_2.py | 9 +++++++++ src/riccipy/metrics/de_sitter_3.py | 9 +++++++++ src/riccipy/metrics/domain_wall.py | 10 ++++++++++ src/riccipy/metrics/dunn_tupper.py | 7 +++++++ src/riccipy/metrics/durgapal_1.py | 12 ++++++++++++ src/riccipy/metrics/durgapal_2.py | 12 ++++++++++++ src/riccipy/metrics/durgapal_3.py | 12 ++++++++++++ src/riccipy/metrics/durgapal_fuloria.py | 9 +++++++++ src/riccipy/metrics/einstein_1.py | 9 +++++++++ src/riccipy/metrics/einstein_2.py | 8 ++++++++ src/riccipy/metrics/einstein_3.py | 8 ++++++++ src/riccipy/metrics/einstein_maxwell_1.py | 10 ++++++++++ src/riccipy/metrics/einstein_maxwell_2.py | 10 ++++++++++ src/riccipy/metrics/einstein_maxwell_3.py | 11 +++++++++++ src/riccipy/metrics/ellis_maccallum_1.py | 7 +++++++ src/riccipy/metrics/ellis_maccallum_2.py | 8 ++++++++ src/riccipy/metrics/faulkes.py | 10 ++++++++++ src/riccipy/metrics/godel.py | 9 +++++++++ src/riccipy/metrics/godfrey.py | 9 +++++++++ src/riccipy/metrics/harrison_1.py | 13 +++++++++++++ src/riccipy/metrics/harrison_2.py | 7 +++++++ src/riccipy/metrics/harrison_3.py | 7 +++++++ src/riccipy/metrics/heintzmann.py | 8 ++++++++ src/riccipy/metrics/kasner_1.py | 7 +++++++ src/riccipy/metrics/kasner_2.py | 7 +++++++ src/riccipy/metrics/kerr_1.py | 14 ++++++++++++++ src/riccipy/metrics/kerr_2.py | 14 ++++++++++++++ src/riccipy/metrics/kerr_3.py | 15 +++++++++++++++ src/riccipy/metrics/kerr_newman_1.py | 14 ++++++++++++++ src/riccipy/metrics/kerr_newman_2.py | 15 +++++++++++++++ src/riccipy/metrics/klein.py | 8 ++++++++ src/riccipy/metrics/kottler.py | 9 +++++++++ src/riccipy/metrics/koutras_mcintosh.py | 14 ++++++++++++++ src/riccipy/metrics/kowalczynski_plebanski.py | 10 ++++++++++ src/riccipy/metrics/levi_civita_1.py | 8 ++++++++ src/riccipy/metrics/levi_civita_2.py | 8 ++++++++ src/riccipy/metrics/levi_civita_3.py | 7 +++++++ src/riccipy/metrics/levi_civita_4.py | 8 ++++++++ src/riccipy/metrics/levi_civita_5.py | 8 ++++++++ src/riccipy/metrics/levi_civita_6.py | 7 +++++++ src/riccipy/metrics/levi_civita_7.py | 7 +++++++ src/riccipy/metrics/levi_civita_8.py | 8 ++++++++ src/riccipy/metrics/lrs.py | 8 ++++++++ src/riccipy/metrics/plane_symmetric.py | 8 ++++++++ src/riccipy/metrics/robertson_walker_1.py | 8 ++++++++ src/riccipy/metrics/robertson_walker_2.py | 8 ++++++++ 73 files changed, 659 insertions(+) create mode 100644 src/riccipy/metrics/anti_de_sitter_1.py create mode 100644 src/riccipy/metrics/anti_de_sitter_2.py create mode 100644 src/riccipy/metrics/bayin.py create mode 100644 src/riccipy/metrics/beckers_sinzinkayo_demaret_1.py create mode 100644 src/riccipy/metrics/beckers_sinzinkayo_demaret_2.py create mode 100644 src/riccipy/metrics/bertotti_robinson_1.py create mode 100644 src/riccipy/metrics/bertotti_robinson_2.py create mode 100644 src/riccipy/metrics/bertotti_robinson_3.py create mode 100644 src/riccipy/metrics/bertotti_robinson_4.py create mode 100644 src/riccipy/metrics/bianchi_1.py create mode 100644 src/riccipy/metrics/bianchi_2.py create mode 100644 src/riccipy/metrics/bondi_1.py create mode 100644 src/riccipy/metrics/bondi_2.py create mode 100644 src/riccipy/metrics/bondi_3.py create mode 100644 src/riccipy/metrics/boost_1.py create mode 100644 src/riccipy/metrics/boost_2.py create mode 100644 src/riccipy/metrics/boost_3.py create mode 100644 src/riccipy/metrics/buchdahl_land.py create mode 100644 src/riccipy/metrics/cmetric.py create mode 100644 src/riccipy/metrics/cross_const_curvature_1.py create mode 100644 src/riccipy/metrics/cross_const_curvature_2.py create mode 100644 src/riccipy/metrics/cross_const_curvature_3.py create mode 100644 src/riccipy/metrics/cross_const_curvature_4.py create mode 100644 src/riccipy/metrics/datta_1.py create mode 100644 src/riccipy/metrics/datta_2.py create mode 100644 src/riccipy/metrics/davidson.py create mode 100644 src/riccipy/metrics/de_sitter_1.py create mode 100644 src/riccipy/metrics/de_sitter_2.py create mode 100644 src/riccipy/metrics/de_sitter_3.py create mode 100644 src/riccipy/metrics/domain_wall.py create mode 100644 src/riccipy/metrics/dunn_tupper.py create mode 100644 src/riccipy/metrics/durgapal_1.py create mode 100644 src/riccipy/metrics/durgapal_2.py create mode 100644 src/riccipy/metrics/durgapal_3.py create mode 100644 src/riccipy/metrics/durgapal_fuloria.py create mode 100644 src/riccipy/metrics/einstein_1.py create mode 100644 src/riccipy/metrics/einstein_2.py create mode 100644 src/riccipy/metrics/einstein_3.py create mode 100644 src/riccipy/metrics/einstein_maxwell_1.py create mode 100644 src/riccipy/metrics/einstein_maxwell_2.py create mode 100644 src/riccipy/metrics/einstein_maxwell_3.py create mode 100644 src/riccipy/metrics/ellis_maccallum_1.py create mode 100644 src/riccipy/metrics/ellis_maccallum_2.py create mode 100644 src/riccipy/metrics/faulkes.py create mode 100644 src/riccipy/metrics/godel.py create mode 100644 src/riccipy/metrics/godfrey.py create mode 100644 src/riccipy/metrics/harrison_1.py create mode 100644 src/riccipy/metrics/harrison_2.py create mode 100644 src/riccipy/metrics/harrison_3.py create mode 100644 src/riccipy/metrics/heintzmann.py create mode 100644 src/riccipy/metrics/kasner_1.py create mode 100644 src/riccipy/metrics/kasner_2.py create mode 100644 src/riccipy/metrics/kerr_1.py create mode 100644 src/riccipy/metrics/kerr_2.py create mode 100644 src/riccipy/metrics/kerr_3.py create mode 100644 src/riccipy/metrics/kerr_newman_1.py create mode 100644 src/riccipy/metrics/kerr_newman_2.py create mode 100644 src/riccipy/metrics/klein.py create mode 100644 src/riccipy/metrics/kottler.py create mode 100644 src/riccipy/metrics/koutras_mcintosh.py create mode 100644 src/riccipy/metrics/kowalczynski_plebanski.py create mode 100644 src/riccipy/metrics/levi_civita_1.py create mode 100644 src/riccipy/metrics/levi_civita_2.py create mode 100644 src/riccipy/metrics/levi_civita_3.py create mode 100644 src/riccipy/metrics/levi_civita_4.py create mode 100644 src/riccipy/metrics/levi_civita_5.py create mode 100644 src/riccipy/metrics/levi_civita_6.py create mode 100644 src/riccipy/metrics/levi_civita_7.py create mode 100644 src/riccipy/metrics/levi_civita_8.py create mode 100644 src/riccipy/metrics/lrs.py create mode 100644 src/riccipy/metrics/plane_symmetric.py create mode 100644 src/riccipy/metrics/robertson_walker_1.py create mode 100644 src/riccipy/metrics/robertson_walker_2.py diff --git a/src/riccipy/metrics/anti_de_sitter_1.py b/src/riccipy/metrics/anti_de_sitter_1.py new file mode 100644 index 0000000..98052a5 --- /dev/null +++ b/src/riccipy/metrics/anti_de_sitter_1.py @@ -0,0 +1,7 @@ +# anti-de Sitter space +_coords = symbols('t chi theta phi', real=True) +_vars = () +_funs = () +t, ch, th, ph = _coords +_metric = diag(-1, cos(t)**2, cos(t)**2*sinh(ch)**2, cos(t)**2*sinh(ch)**2*sin(th)**2) +del t, ch, th, ph diff --git a/src/riccipy/metrics/anti_de_sitter_2.py b/src/riccipy/metrics/anti_de_sitter_2.py new file mode 100644 index 0000000..b5133fc --- /dev/null +++ b/src/riccipy/metrics/anti_de_sitter_2.py @@ -0,0 +1,6 @@ +# Static form of anti-de Sitter space +_coords = symbols('t r theta phi', real=True) +_vars = () +_funs = () +t, r, th, ph = _coords +_metric = diag(-cosh(r)**2, 1, sinh(r)**2, sinh(r)**2*sin(th)**2) diff --git a/src/riccipy/metrics/bayin.py b/src/riccipy/metrics/bayin.py new file mode 100644 index 0000000..ede90b8 --- /dev/null +++ b/src/riccipy/metrics/bayin.py @@ -0,0 +1,12 @@ +# Bayin's spherically symmetric static perfect fluid solution II +_coords = symbols('t r theta phi', real=True) +_vars = symbols('w_0 C_0 C_1', constant=True) +_funs = () +t, r, th, ph = _coords +w_0, C_0, C_1 = _vars +_metric = zeros(4) +_metric[0,0] = -C_0**2*exp(-asin((-2*r**2 + C_1)/(C_1**2 + 4*w_0**2)**(Rational(1,2)))) +_metric[1,1] = w_0**2/(-r**4 + C_1*r**2 + w_0**2) +_metric[2,2] = r**2 +_metric[3,3] = r**2*sin(th)**2 +del t, r, th, ph, w_0, C_0, C_1 diff --git a/src/riccipy/metrics/beckers_sinzinkayo_demaret_1.py b/src/riccipy/metrics/beckers_sinzinkayo_demaret_1.py new file mode 100644 index 0000000..0b48ba7 --- /dev/null +++ b/src/riccipy/metrics/beckers_sinzinkayo_demaret_1.py @@ -0,0 +1,9 @@ +# Beckers, Sinzinkayo, and Demaret solution +_coords = symbols('t x y z', real=True) +_vars = symbols('k d m', constant=True) +_funs = () +t, x, y, z = _coords +k, d, m = _vars +expr = (k*x+d)**(2*m) +_metric = diag(-expr, expr, expr, expr) +del expr, t, x, y, z, k, d, m diff --git a/src/riccipy/metrics/beckers_sinzinkayo_demaret_2.py b/src/riccipy/metrics/beckers_sinzinkayo_demaret_2.py new file mode 100644 index 0000000..7cc3e2a --- /dev/null +++ b/src/riccipy/metrics/beckers_sinzinkayo_demaret_2.py @@ -0,0 +1,9 @@ +# Beckers, Sinzinkayo, and Demaret solution +_coords = symbols('t x y z', real=True) +_vars = symbols('m', constant=True) +_funs = () +t, x, y, z = _coords +m = _vars +expr = x**(2*m) +_metric = diag(-expr, expr, expr, expr) +del expr, t, x, y, z, m diff --git a/src/riccipy/metrics/bertotti_robinson_1.py b/src/riccipy/metrics/bertotti_robinson_1.py new file mode 100644 index 0000000..a086677 --- /dev/null +++ b/src/riccipy/metrics/bertotti_robinson_1.py @@ -0,0 +1,7 @@ +# The Bertotti-Robinson solution +_coords = symbols('t x y z') +_vars = () +_funs = () +t, x, y, z = _coords +_metric = diag(-(1+z**2), 1-y**2, 1/(1-y**2), 1/(1+z**2)) +del t, x, y, z diff --git a/src/riccipy/metrics/bertotti_robinson_2.py b/src/riccipy/metrics/bertotti_robinson_2.py new file mode 100644 index 0000000..ea4b0da --- /dev/null +++ b/src/riccipy/metrics/bertotti_robinson_2.py @@ -0,0 +1,8 @@ +# The Bertotti-Robinson solution +_coords = symbols('t r theta phi', real=True) +_vars = symbols('q', constant=True) +_funs = () +t, r, th, ph = _coords +q = _vars +_metric = diag(-q**2/r**2, q**2/r**2, q**2, q**2*sin(th)**2) +del t, r, th, ph, q diff --git a/src/riccipy/metrics/bertotti_robinson_3.py b/src/riccipy/metrics/bertotti_robinson_3.py new file mode 100644 index 0000000..09893e2 --- /dev/null +++ b/src/riccipy/metrics/bertotti_robinson_3.py @@ -0,0 +1,8 @@ +# The Bertotti-Robinson solution +_coords = symbols('t x theta phi', real=True) +_vars = symbols('k', constant=True) +_funs = () +t, x, th, ph = _coords +k = _vars +_metric = diag(-k**2*sinh(x)**2, k**2, k**2, k**2*sin(th)**2) +del t, x, th, ph, k diff --git a/src/riccipy/metrics/bertotti_robinson_4.py b/src/riccipy/metrics/bertotti_robinson_4.py new file mode 100644 index 0000000..e983bf9 --- /dev/null +++ b/src/riccipy/metrics/bertotti_robinson_4.py @@ -0,0 +1,8 @@ +# The Bertotti-Robinson solution +_coords = symbols('t z x y', real=True) +_vars = symbols('omega', constant=True) +_funs = () +t, x, y, z = _coords +om = _vars +_metric = diag(-1, 1, cos(om*x)**2, cos(om*t)**2) +del t, x, y, z, om diff --git a/src/riccipy/metrics/bianchi_1.py b/src/riccipy/metrics/bianchi_1.py new file mode 100644 index 0000000..77da0ed --- /dev/null +++ b/src/riccipy/metrics/bianchi_1.py @@ -0,0 +1,8 @@ +# General metric from Bianchi II automorphisms +_coords = symbols('t x y z', real=True) +_vars = () +_funs = symbols('alpha', cls=Function) +t, x, y, z = _coords +al = _funs +_metric = diag(1, exp(-2*al(t)), exp(al(t)), exp(al(t))) +del t, x, y, z, al diff --git a/src/riccipy/metrics/bianchi_2.py b/src/riccipy/metrics/bianchi_2.py new file mode 100644 index 0000000..10b2067 --- /dev/null +++ b/src/riccipy/metrics/bianchi_2.py @@ -0,0 +1,8 @@ +# General metric from Bianchi IV automorphisms +_coords = symbols('t x y z', real=True) +_vars = () +_funs = symbols('alpha beta gamma', cls=Function) +t, x, y, z = _coords +al, be, ga = _funs +_metric = diag(1, exp(al(t)), exp(be(t)), exp(ga(t))) +del t, x, y, z, al, be, ga diff --git a/src/riccipy/metrics/bondi_1.py b/src/riccipy/metrics/bondi_1.py new file mode 100644 index 0000000..9980662 --- /dev/null +++ b/src/riccipy/metrics/bondi_1.py @@ -0,0 +1,9 @@ +# Spherical Bondi metric in advanced (ingoing) coordinates +_coords = symbols('r v theta phi', real=True) +_vars = () +_funs = symbols('C M', cls=Function) +r, v, th, ph = _coords +C, M = _funs +_metric = diag(0,-C(r,v)**2*(1-2*M(r,v)/r),r**2,r**2*sin(th)**2) +_metric[0,1] = _metric[1,0] = C(r,v) +del r, v, th, ph, C, M diff --git a/src/riccipy/metrics/bondi_2.py b/src/riccipy/metrics/bondi_2.py new file mode 100644 index 0000000..481fbf5 --- /dev/null +++ b/src/riccipy/metrics/bondi_2.py @@ -0,0 +1,8 @@ +# Spherical Bondi metric in advanced (ingoing) coordinates +_coords = symbols('r v theta phi', real=True) +_vars = () +_funs = symbols('C M', cls=Function) +r, v, th, ph = _coords +C, M = _funs +_metric = diag(0,-C(t,v)**2*(1-2*M(t,v)/t),t**2,t**2*sin(th)**2) +_metric[0,1] = _metric[1,0] = -C(r,v) diff --git a/src/riccipy/metrics/bondi_3.py b/src/riccipy/metrics/bondi_3.py new file mode 100644 index 0000000..a95b555 --- /dev/null +++ b/src/riccipy/metrics/bondi_3.py @@ -0,0 +1,13 @@ +# The Bondi metric +_coords = symbols('r u theta phi', real=True) +_vars = () +_funs = symbols('Q U V gamma', cls=Function) +r, u, th, ph = _coords +Q, U, V, ga = _funs +_metric = zeros(4) +_metric[1,1] = -exp(2*Q(r,u,th)+2*ga(r,u,th))*(V(r,u,th)*exp(-2*ga(r,u,th))-exp(-2*Q(r,u,th))*U(r,u,th)**2*r**3)/r +_metric[2,2] = r**2*exp(2*ga(r,u,th)) +_metric[3,3] = r**2*exp(-2*ga(r,u,th))*sin(th)**2 +_metric[0,1] = _metric[1,0] = -exp(2*Q(r,u,th)) +_metric[1,2] = _metric[2,1] = -U(r,u,th)*r**2*exp(2*ga(r,u,th)) +del r, u, th, ph, Q, U, V, ga diff --git a/src/riccipy/metrics/boost_1.py b/src/riccipy/metrics/boost_1.py new file mode 100644 index 0000000..9265f89 --- /dev/null +++ b/src/riccipy/metrics/boost_1.py @@ -0,0 +1,8 @@ +# Metric with G4 on T3 and boost isotropy (flat case, k=0) +_coords = symbols('t x y w', real=True) +_vars = () +_funs = symbols('alpha beta', cls=Function) +t, x, y, w = _coords +al, be = _funs +_metric = diag(-be(w)**2*y**2, al(w)**2, be(w)**2, 1) +del t, x, y, w, al, be diff --git a/src/riccipy/metrics/boost_2.py b/src/riccipy/metrics/boost_2.py new file mode 100644 index 0000000..4e9698d --- /dev/null +++ b/src/riccipy/metrics/boost_2.py @@ -0,0 +1,8 @@ +# Metric with G4 on T3 and boost isotropy (flat case k=1) +_coords = symbols('t x y w', real=True) +_vars = () +_funs = symbols('alpha beta', cls=Function) +t, x, y, w = _coords +al, be = _funs +_metric = diag(-be(w)**2*sinh(y)**2, al(w)**2, be(w)**2, 1) +del t, x, y, w, al, be diff --git a/src/riccipy/metrics/boost_3.py b/src/riccipy/metrics/boost_3.py new file mode 100644 index 0000000..6292927 --- /dev/null +++ b/src/riccipy/metrics/boost_3.py @@ -0,0 +1,8 @@ +# Metric with G4 on T3 and boost isotropy (flat case k=1) +_coords = symbols('t x y w', real=True) +_vars = () +_funs = symbols('alpha beta', cls=Function) +t, x, y, w = _coords +al, be = _funs +_metric = diag(-be(w)**2*sin(y)**2, al(w)**2, be(w)**2, 1) +del t, x, y, w, al, be diff --git a/src/riccipy/metrics/buchdahl_land.py b/src/riccipy/metrics/buchdahl_land.py new file mode 100644 index 0000000..cae207d --- /dev/null +++ b/src/riccipy/metrics/buchdahl_land.py @@ -0,0 +1,7 @@ +# Buchdahl and Land's static spherically symmetric stiff perfect fluid with rhob=2 +_coords = symbols('t r theta phi', real=True) +_vars = () +_funs = () +t, r, th, ph = _coords +_metric = diag(-Rational(2,3)*r**2, 1/(Rational(1,2)-r**2/3), r**2, r**2*sin(th)**2) +del t, r, th, ph diff --git a/src/riccipy/metrics/cmetric.py b/src/riccipy/metrics/cmetric.py new file mode 100644 index 0000000..9a1b3f1 --- /dev/null +++ b/src/riccipy/metrics/cmetric.py @@ -0,0 +1,8 @@ +# The C-metric +_coords = symbols('t x y phi', real=True) +_vars = () +_funs = symbols('f h', cls=Function) +t, x, y, ph = _coords +f, h = _funs +_metric = diag(-h(y)/(x+y)**2, 1/((x+y)**2*f(x)), 1/((x+y)**2*h(y)), f(x)/(x+y)**2) +del t, x, y, ph, f, h diff --git a/src/riccipy/metrics/cross_const_curvature_1.py b/src/riccipy/metrics/cross_const_curvature_1.py new file mode 100644 index 0000000..b3c6a1f --- /dev/null +++ b/src/riccipy/metrics/cross_const_curvature_1.py @@ -0,0 +1,8 @@ +# Cross product of two 2-dimensional subspaces of constant curvature +_coords = symbols('t x y z', real=True) +_vars = symbols('A B', constant=True) +_funs = () +t, x, y, z = _coords +A, B = _vars +_metric = diag(-B**2*sin(z)**2, A**2, A**2*sin(x)**2, B**2) +del t, x, y, z, A, B diff --git a/src/riccipy/metrics/cross_const_curvature_2.py b/src/riccipy/metrics/cross_const_curvature_2.py new file mode 100644 index 0000000..7cfa1b9 --- /dev/null +++ b/src/riccipy/metrics/cross_const_curvature_2.py @@ -0,0 +1,8 @@ +# Cross product of two 2-dimensional subspaces of constant curvature +_coords = symbols('t x y z', real=True) +_vars = symbols('A B', constant=True) +_funs = () +t, x, y, z = _coords +A, B = _vars +_metric = diag(-B**2*sin(z)**2, A**2, A**2*sinh(x)**2, B**2) +del t, x, y, z, A, B diff --git a/src/riccipy/metrics/cross_const_curvature_3.py b/src/riccipy/metrics/cross_const_curvature_3.py new file mode 100644 index 0000000..447ce8c --- /dev/null +++ b/src/riccipy/metrics/cross_const_curvature_3.py @@ -0,0 +1,8 @@ +# Cross product of two 2-dimensional subspaces of constant curvature +_coords = symbols('t x y z', real=True) +_vars = symbols('A B', constant=True) +_funs = () +t, x, y, z = _coords +A, B = _vars +_metric = diag(-B**2*sinh(z)**2, A**2, A**2*sin(x)**2, B**2) +del t, x, y, z, A, B diff --git a/src/riccipy/metrics/cross_const_curvature_4.py b/src/riccipy/metrics/cross_const_curvature_4.py new file mode 100644 index 0000000..b275adc --- /dev/null +++ b/src/riccipy/metrics/cross_const_curvature_4.py @@ -0,0 +1,8 @@ +# Cross product of two 2-dimensional subspaces of constant curvature +_coords = symbols('t x y z', real=True) +_vars = symbols('A B', constant=True) +_funs = () +t, x, y, z = _coords +A, B = _vars +_metric = diag(-B**2*sinh(z)**2, A**2, A**2*sinh(x)**2, B**2) +del t, x, y, z, A, B diff --git a/src/riccipy/metrics/datta_1.py b/src/riccipy/metrics/datta_1.py new file mode 100644 index 0000000..c7d254a --- /dev/null +++ b/src/riccipy/metrics/datta_1.py @@ -0,0 +1,8 @@ +# Datta's Einstein-Maxwell solution +_coords = symbols('t x y z', real=True) +_vars = symbols('a b', constant=True) +_funs = () +t, x, y, z = _coords +a, b = _vars +_metric = diag(-1/(b/t - a/t**2), b/t - a/t**2, t**2, t**2) +del t, x, y, z, a, b diff --git a/src/riccipy/metrics/datta_2.py b/src/riccipy/metrics/datta_2.py new file mode 100644 index 0000000..08cf900 --- /dev/null +++ b/src/riccipy/metrics/datta_2.py @@ -0,0 +1,9 @@ +# Datta's Einstein-Maxwell solution +_coords = symbols('t x y z', real=True) +_vars = symbols('C_1 C_2 mu', constant=True) +_funs = () +t, x, y, z = _coords +C_1, C_2, mu = _vars +expr = (C_1*t**mu + C_2/t**mu)**2 +_metric = diag(-expr*t**(2*mu**2), 1/expr, expr*t**(2*mu**2), t**2*expr) +del expr, t, x, y, z, C_1, C_2, mu diff --git a/src/riccipy/metrics/davidson.py b/src/riccipy/metrics/davidson.py new file mode 100644 index 0000000..c4d5bbf --- /dev/null +++ b/src/riccipy/metrics/davidson.py @@ -0,0 +1,8 @@ +# Davidson's cylindrically symmetric radiation perfect fluid universe +_coords = symbols('t r z phi', real=True) +_vars = () +_funs = () +t, r, z, phi = _coords +expr = (1+r**2)**Rational(2,5) +_metric = diag(-expr**3, t**Rational(4,3)*expr, t**Rational(-2,3)/expr, t**Rational(4,3)*r**2/expr) +del expr, t, r, z, phi diff --git a/src/riccipy/metrics/de_sitter_1.py b/src/riccipy/metrics/de_sitter_1.py new file mode 100644 index 0000000..69f57cc --- /dev/null +++ b/src/riccipy/metrics/de_sitter_1.py @@ -0,0 +1,9 @@ +# de Sitter space +_coords = symbols('t chi theta phi', real=True) +_vars = (symbols('alpha', constant=True),) +_funs = () +t, ch, th, ph = _coords +al = _vars +expr = al**2*cosh(t/al)**2 +_metric = diag(-1, expr, expr*sin(ch)**2, expr*sin(ch)**2*sin(th)**2) +del expr, t, ch, th, ph diff --git a/src/riccipy/metrics/de_sitter_2.py b/src/riccipy/metrics/de_sitter_2.py new file mode 100644 index 0000000..e422303 --- /dev/null +++ b/src/riccipy/metrics/de_sitter_2.py @@ -0,0 +1,9 @@ +# de Sitter space +_coords = symbols('t x y z', real=True) +_vars = (symbols('alpha', constant=True),) +_funs = () +t, x, y, z = _coords +al = _vars +expr = exp(2*t/al) +_metric = diag(-1, expr, expr, expr) +del expr, t, x, y, z, al diff --git a/src/riccipy/metrics/de_sitter_3.py b/src/riccipy/metrics/de_sitter_3.py new file mode 100644 index 0000000..2ce8dcd --- /dev/null +++ b/src/riccipy/metrics/de_sitter_3.py @@ -0,0 +1,9 @@ +# de Sitter space +_coords = symbols('t r theta phi', real=True) +_vars = (symbols('lambda', constant=True),) +_funs = () +t, r, th, ph = _coords +la = _vars +expr = 1 - la*r**2/3 +_metric = diag(-expr, 1/expr, r**2, r**2*sin(th)**2) +del expr, t, r, th, ph, la diff --git a/src/riccipy/metrics/domain_wall.py b/src/riccipy/metrics/domain_wall.py new file mode 100644 index 0000000..473d206 --- /dev/null +++ b/src/riccipy/metrics/domain_wall.py @@ -0,0 +1,10 @@ +# Metric for spacetime with domain wall +_coords = symbols('t x y z', real=True) +_vars = (symbols('k', constant=True),) +_funs = () +t, x, y, z = _coords +k = _vars +expr1 = (1 - k*z)**2 +expr2 = exp(2*k*t) +_metric = diag(-expr1, expr1*expr2, expr1*expr2, 1) +del expr1, expr2, t, x, y, z, k diff --git a/src/riccipy/metrics/dunn_tupper.py b/src/riccipy/metrics/dunn_tupper.py new file mode 100644 index 0000000..bdf4a28 --- /dev/null +++ b/src/riccipy/metrics/dunn_tupper.py @@ -0,0 +1,7 @@ +# Dunn and Tupper's G3VI0 perfect fluid solution +_coords = symbols('t x y z', real=True) +_vars = (symbols('b', constant=True),) +_funs = () +t, x, y, z = _coords +_metric = diag(-1, 4*t**2/(-b*(1 + b)), t**(-2*b)*exp(-4*x), t**(-2*b)*exp(4*x)) +del t, x, y, z diff --git a/src/riccipy/metrics/durgapal_1.py b/src/riccipy/metrics/durgapal_1.py new file mode 100644 index 0000000..a34ce49 --- /dev/null +++ b/src/riccipy/metrics/durgapal_1.py @@ -0,0 +1,12 @@ +# Durgapal's static spherically symmetric perfect fluid with n=3 +_coords = symbols('t r theta phi', real=True) +_vars = symbols('A C K', constant=True) +_funs = () +t, r, th, ph = _coords +A, C, K = _vars +_metric = zeros(4) +_metric[0,0] = -A**2*(1+C*r**2)**3 +_metric[1,1] = 2*(1+C*r**2)*sqrt(1+4*C*r**2)/((2-C*r**2)*sqrt(1+4*C*r**2)+2*K*C*r**2) +_metric[2,2] = r**2 +_metric[3,3] = r**2*sin(th)**2 +del t, r, th, ph, A, C, K diff --git a/src/riccipy/metrics/durgapal_2.py b/src/riccipy/metrics/durgapal_2.py new file mode 100644 index 0000000..233de88 --- /dev/null +++ b/src/riccipy/metrics/durgapal_2.py @@ -0,0 +1,12 @@ +# Durgapal's static spherically symmetric perfect fluid with n=4 +_coords = symbols('t r theta phi', real=True) +_vars = symbols('A C K', constant=True) +_funs = () +t, r, th, ph = _coords +A, C, K = _vars +_metric = zeros(4) +_metric[0,0] = -A**2*(1+C*r**2)**4 +_metric[1,1] = 7*(1+C*r**2)**2*(1+5*C*r**2)**Rational(2,5)/((7-10*C*r**2-C**2*r**4)*(1+5*C*r**2)**Rational(2,5)+7*K*C*r**2) +_metric[2,2] = r**2 +_metric[3,3] = r**2*sin(th)**2 +del t, r, th, ph, A, C, K diff --git a/src/riccipy/metrics/durgapal_3.py b/src/riccipy/metrics/durgapal_3.py new file mode 100644 index 0000000..06bf7e7 --- /dev/null +++ b/src/riccipy/metrics/durgapal_3.py @@ -0,0 +1,12 @@ +# Durgapal's static spherically symmetric perfect fluid with n=5 +_coords = symbols('t r theta phi', real=True) +_vars = symbols('A C K', constant=True) +_funs = () +t, r, th, ph = _coords +A, C, K = _vars +_metric = zeros(4) +_metric[0,0] = -A**2*(1+C*r**2)**5 +_metric[1,1] = (1+C*r**2)**3/(1-C*r**2*(309+54*C*r**2+8*C**2*r**4)/112+K*C*r**2/(1+6*C*r**2)**Rational(1,3)) +_metric[2,2] = r**2 +_metric[3,3] = r**2*sin(th)**2 +del t, r, th, ph, A, C, K diff --git a/src/riccipy/metrics/durgapal_fuloria.py b/src/riccipy/metrics/durgapal_fuloria.py new file mode 100644 index 0000000..52bc37c --- /dev/null +++ b/src/riccipy/metrics/durgapal_fuloria.py @@ -0,0 +1,9 @@ +# Durgapal and Fuloria's static spherically symmetric perfect fluid +_coords = symbols('t r theta phi', real=True) +_vars = symbols('B C', constant=True) +_funs = () +t, r, th, ph = _coords +B, C = _vars +expr = 1 + C*r**2 +_metric = diag(-B*expr**4, 7*expr**2/(-expr**2-8*expr+16), r**2, r**2*sin(th)**2) +del expr, t, r, th, ph, B, C diff --git a/src/riccipy/metrics/einstein_1.py b/src/riccipy/metrics/einstein_1.py new file mode 100644 index 0000000..8c23b68 --- /dev/null +++ b/src/riccipy/metrics/einstein_1.py @@ -0,0 +1,9 @@ +# Einstein's static universe. Euclidean coordinates +_coords = symbols('t x y z', real=True) +_vars = symbols('K', constant=True) +_funs = () +t, x, y, z = _coords +K = _vars +expr = 1/(1+sqrt(x**2+y**2+z**2)/(4*K**2))**2 +_metric = diag(-1, expr, expr, expr) +del expr, t, x, y, z, K diff --git a/src/riccipy/metrics/einstein_2.py b/src/riccipy/metrics/einstein_2.py new file mode 100644 index 0000000..e67c686 --- /dev/null +++ b/src/riccipy/metrics/einstein_2.py @@ -0,0 +1,8 @@ +# Einstein's static universe. Polar coordinates +_coords = symbols('t chi theta phi', real=True) +_vars = symbols('Lambda', constant=True) +_funs = () +t, ch, th, ph = _coords +La = _vars +_metric = diag(-1/La, 1/La, sin(ch)**2/La, sin(ch)**2*sin(th)**2/La) +del t, ch, th, ph, La diff --git a/src/riccipy/metrics/einstein_3.py b/src/riccipy/metrics/einstein_3.py new file mode 100644 index 0000000..bf0297a --- /dev/null +++ b/src/riccipy/metrics/einstein_3.py @@ -0,0 +1,8 @@ +# Einstein's static universe. Curvature coordinates +_coords = symbols('t r theta phi', real=True) +_vars = symbols('Lambda', constant=True) +_funs = () +t, r, th, ph = _coords +La = _vars +_metric = diag(-1, 1/(1-La*r**2), r**2, r**2*sin(th)**2) +del t, r, th, ph, La diff --git a/src/riccipy/metrics/einstein_maxwell_1.py b/src/riccipy/metrics/einstein_maxwell_1.py new file mode 100644 index 0000000..3c5aac8 --- /dev/null +++ b/src/riccipy/metrics/einstein_maxwell_1.py @@ -0,0 +1,10 @@ +# Static cylindrically symmetric Einstein-Maxwell field (i) angular magnetic field (caused by an axial current) +_coords = symbols('t phi rho z', real=True) +_vars = symbols('a b m', constant=True) +_funs = () +t, ph, rh, z = _coords +a, b, m = _vars +expr1 = cosh(log(a*rh**m))**2 +expr2 = rh**(2*m**2)*b**2*expr1 +_metric = diag(-expr2, rh**2*b**2*expr1, expr2, 1/(b**2*expr1)) +del expr1, expr2, t, ph, rh, z, a, b, m diff --git a/src/riccipy/metrics/einstein_maxwell_2.py b/src/riccipy/metrics/einstein_maxwell_2.py new file mode 100644 index 0000000..0960ca1 --- /dev/null +++ b/src/riccipy/metrics/einstein_maxwell_2.py @@ -0,0 +1,10 @@ +# Static cylindrically symmetric Einstein-Maxwell field (ii) longitudinal magnetic field (caused by an angular current) +_coords = symbols('t phi rho z', real=True) +_vars = symbols('a b m', constant=True) +_funs = () +t, ph, rh, z = _coords +a, b, m = _vars +expr1 = cosh(log(a*rh**m))**2 +expr2 = rh**(2*m**2)*b**2*expr1 +_metric = diag(-expr2, 1/(b**2*expr1), expr2, rh**2*b**2*expr1) +del expr1, expr2, t, ph, rh, z, a, b, m diff --git a/src/riccipy/metrics/einstein_maxwell_3.py b/src/riccipy/metrics/einstein_maxwell_3.py new file mode 100644 index 0000000..7597c0e --- /dev/null +++ b/src/riccipy/metrics/einstein_maxwell_3.py @@ -0,0 +1,11 @@ +# Static cylindrically symmetric Einstein-Maxwell field (iii) radial electric field (caused by an axial charge distribution) +_coords = symbols('t phi rho z', real=True) +_vars = symbols('a b m', constant=True) +_funs = () +t, ph, rh, z = _coords +a, b, m = _vars +expr1 = cosh(log(a*rh**m))**2 +expr2 = rh**(2*m**2)*b**2*expr1 +_metric = diag(-1/(b**2*expr1), rh**2*b**2*expr1, expr2, expr2) +del expr1, expr2, t, ph, rh, z, a, b, m + diff --git a/src/riccipy/metrics/ellis_maccallum_1.py b/src/riccipy/metrics/ellis_maccallum_1.py new file mode 100644 index 0000000..75ee687 --- /dev/null +++ b/src/riccipy/metrics/ellis_maccallum_1.py @@ -0,0 +1,7 @@ +# Ellis and MacCallum's G3VIo dust solution +_coords = symbols('t x y z', real=True) +_vars = () +_funs = () +t, x, y, z = _coords +_metric = diag(-1, 16*t**2, t*exp(-4*x), t*exp(4*x)) +del t, x, y, z diff --git a/src/riccipy/metrics/ellis_maccallum_2.py b/src/riccipy/metrics/ellis_maccallum_2.py new file mode 100644 index 0000000..4e7a76d --- /dev/null +++ b/src/riccipy/metrics/ellis_maccallum_2.py @@ -0,0 +1,8 @@ +# Ellis and MacCallum Bianchi VIo vacuum solution +_coords = symbols('t x y z', real=True) +_vars = symbols('n', constant=True) +_funs = () +t, x, y, z = _coords +n = _vars +_metric = diag(-sqrt(t)*exp(n**2*t**2), sqrt(t)*exp(n**2*t**2), t*exp(2*n*x), t*exp(-2*n*x)) +del t, x, y, z, n diff --git a/src/riccipy/metrics/faulkes.py b/src/riccipy/metrics/faulkes.py new file mode 100644 index 0000000..8a4e0b3 --- /dev/null +++ b/src/riccipy/metrics/faulkes.py @@ -0,0 +1,10 @@ +# Faulkes' non-static spherically symmetric perfect fluid solution +_coords = symbols('t r theta phi', real=True) +_vars = symbols('k', constant=True) +_funs = symbols('E', cls=Function) +t, r, th, ph = _coords +k = _vars +E = _funs +expr = (E(t)-(r/(2*k)))**2 +_metric = diag(-E(t)**2/expr, expr**2, expr**2*r**2, expr**2*r**2*sin(th)**2) +del expr, t, r, th, ph, k, E diff --git a/src/riccipy/metrics/godel.py b/src/riccipy/metrics/godel.py new file mode 100644 index 0000000..c7d9ecc --- /dev/null +++ b/src/riccipy/metrics/godel.py @@ -0,0 +1,9 @@ +# Godel metric +_coords = symbols('t x y z', real=True) +_vars = (symbols('omega', constant=True),) +_funs = () +t, x, y, z = _coords +om = _vars +_metric = diag(-1, 1, -Rational(1,2)*exp(2*sqrt(2)*om*x), 1) +_metric[0,2] = _metric[2,0] = -exp(sqrt(2)*om*x) +del t, x, y, z, om diff --git a/src/riccipy/metrics/godfrey.py b/src/riccipy/metrics/godfrey.py new file mode 100644 index 0000000..eaccae4 --- /dev/null +++ b/src/riccipy/metrics/godfrey.py @@ -0,0 +1,9 @@ +# A vacuum metric admitting a nontrivial homothety which is non-null, not hypersurface-orthogonal, and whose homothetic bivector is null +_coords = symbols('t r z phi', real=True) +_vars = symbols('a C') +_funs = () +t, r, z, ph = _coords +a, C = _vars +expr = r**(2*a*(a-1))*exp(2*(2*a*z-z-r**2/2+C)) +_metric = diag(-r**(2*a)*exp(2*z), expr, expr, r**(2*(1-a))/exp(2*z)) +del expr, t, r, z, ph, a, C diff --git a/src/riccipy/metrics/harrison_1.py b/src/riccipy/metrics/harrison_1.py new file mode 100644 index 0000000..def5f0f --- /dev/null +++ b/src/riccipy/metrics/harrison_1.py @@ -0,0 +1,13 @@ +# Harrison III-12(b). Petrov type I +_coords = symbols('x_0:4', real=True) +_vars = symbols('a', constant=True) +_funs = () +x0, x1, x2, x3 = _coords +a = _vars +expr = x1**2*cosh(x3)**Rational(3,2) +_metric = zeros(4) +_metric[0,0] = x0**Rational(3,2)*expr +_metric[1,1] = a**2*x0**3*x1*cosh(x3)**3 +_metric[2,2] = 1/(x0*x1*cosh(x3)) +_metric[3,3] = x0**Rational(7,2)*expr +del expr, x0, x1, x2, x3, a diff --git a/src/riccipy/metrics/harrison_2.py b/src/riccipy/metrics/harrison_2.py new file mode 100644 index 0000000..4a60e7f --- /dev/null +++ b/src/riccipy/metrics/harrison_2.py @@ -0,0 +1,7 @@ +# Harrison III-3 Petrov type D, Kinnersley class IV.B (C=0) +_coords = symbols('x_0:4', real=True) +_vars = () +_funs = () +x0, x1, x2, x3 = _coords +_metric = diag(-x1*sin(x3), 1/(sqrt(x1*sin(x3))), x1*sin(x3), x1**Rational(3,2)/sqrt(sin(x3))) +del x0, x1, x2, x3 diff --git a/src/riccipy/metrics/harrison_3.py b/src/riccipy/metrics/harrison_3.py new file mode 100644 index 0000000..4bd6633 --- /dev/null +++ b/src/riccipy/metrics/harrison_3.py @@ -0,0 +1,7 @@ +# Harrison III-7(a) Petrov type D, Kinnersley class IV.B (C=1/2) +_coords = symbols('x_0:4', real=True) +_vars = () +_funs = () +x0, x1, x2, x3 = _coords +_metric = diag(-1/(1-x3**2)**2, sinh(2*x0)**2/(1-x3**2)**2, x3**2, 1/(1-x3**2)**4) +del x0, x1, x2, x3 diff --git a/src/riccipy/metrics/heintzmann.py b/src/riccipy/metrics/heintzmann.py new file mode 100644 index 0000000..c679610 --- /dev/null +++ b/src/riccipy/metrics/heintzmann.py @@ -0,0 +1,8 @@ +# Heintzmann's static spherically symmetric perfect fluid solution +_coords = symbols('t r theta phi', real=True) +_vars = symbols('A a K', constant=True) +_funs = () +t, r, th, ph = _coords +A, a, K = _vars +_metric = diag(-A**2*(1+a*r**2)**3, (1+a*r**2)/K, r**2, r**2*sin(th)**2) +del t, r, th, ph, A, a, K diff --git a/src/riccipy/metrics/kasner_1.py b/src/riccipy/metrics/kasner_1.py new file mode 100644 index 0000000..885feed --- /dev/null +++ b/src/riccipy/metrics/kasner_1.py @@ -0,0 +1,7 @@ +# Kasner power-law vacuum solution. Axisymmetric case +_coords = symbols('t x y z', real=True) +_vars = () +_funs = () +t, x, y, z = _coords +_metric = diag(-1, t**Rational(4,3), t**Rational(4,3), t**Rational(-2,3)) +del t, x, y, z diff --git a/src/riccipy/metrics/kasner_2.py b/src/riccipy/metrics/kasner_2.py new file mode 100644 index 0000000..416a88f --- /dev/null +++ b/src/riccipy/metrics/kasner_2.py @@ -0,0 +1,7 @@ +# Kasner power-law vacuum solution. Axisymmetric flat case +_coords = symbols('t x y z', real=True) +_vars = () +_funs = () +t, x, y, z = _coords +_metric = diag(-1, t**2, 1, 1) +del t, x, y, z diff --git a/src/riccipy/metrics/kerr_1.py b/src/riccipy/metrics/kerr_1.py new file mode 100644 index 0000000..5677f5a --- /dev/null +++ b/src/riccipy/metrics/kerr_1.py @@ -0,0 +1,14 @@ +# Kerr metric in Cartesian coordinates +_coords = symbols('t x y z', real=True) +_vars = symbols('a M', constant=True) +_funs = () +expr = _coords[1]**2+_vars[0]**2*_coords[2]**2 +t, x, y, z = _coords +a, M = _vars +_metric = zeros(4) +_metric[0,0] = -(a**2*y**2+x**2-2*M*x)/expr +_metric[1,1] = expr/(x**2-2*M*x+a**2) +_metric[2,2] = -expr/(y**2-1) +_metric[3,3] = -(x**4+x**2*a**2+2*a**2*M*x+a**2*y**2*x**2-2*a*y**2*M*x+a**4*y**2)*(y**2-1)/expr +_metric[0,3] = _metric[3,0] = 2*a*M*x*(y**2-1)/expr +del expr, t, x, y, z, a, M diff --git a/src/riccipy/metrics/kerr_2.py b/src/riccipy/metrics/kerr_2.py new file mode 100644 index 0000000..b383835 --- /dev/null +++ b/src/riccipy/metrics/kerr_2.py @@ -0,0 +1,14 @@ +# Kerr metric in Boyer Lindquist coordinates +_coords = symbols('t r theta phi', real=True) +_vars = symbols('a M', constant=True) +_funs = () +t, r, th, ph = _coords +a, M = _vars +expr = a**2*cos(th)**2+r**2 +_metric = zeros(4) +_metric[0,0] = -(a**2-sin(th)**2*a**2+r**2-2*M*r)/expr +_metric[1,1] = expr/(r**2-2*M*r+a**2) +_metric[2,2] = expr +_metric[3,3] = (-a**4*sin(th)**2+a**4+2*r**2*a**2-a**2*sin(th)**2*r**2+2*a**2*sin(th)**2*M*r+r**4)*sin(th)**2/expr +_metric[0,3] = _metric[3,0] = -2*M*r*a*sin(th)**2/expr +del expr, t, r, th, ph, a, M diff --git a/src/riccipy/metrics/kerr_3.py b/src/riccipy/metrics/kerr_3.py new file mode 100644 index 0000000..581b726 --- /dev/null +++ b/src/riccipy/metrics/kerr_3.py @@ -0,0 +1,15 @@ +# Kerr metric in outgoing Eddington Finkelstein form +_coords = symbols('u r theta phi', real=True) +_vars = symbols('a M', constant=True) +_funs = () +u, r, th, ph = _coords +a, M = _vars +expr = r**2 + a**2*cos(th)**2 +_metric = zeros(4) +_metric[0,0] = -(a**2-sin(th)**2*a**2+r**2-2*M*r)/expr +_metric[2,2] = expr +_metric[3,3] = sin(th)**2*(2*a**2*M*r*sin(th)**2+a**4-a**4*sin(th)**2+2*r**2*a**2-a**2*sin(th)**2*r**2+r**4)/expr +_metric[0,1] = _metric[1,0] = -1 +_metric[0,3] = _metric[3,0] = -2*a*sin(th)**2*M*r/expr +_metric[1,3] = _metric[3,1] = a*sin(th)**2 +del expr, u, r, th, ph, a, M diff --git a/src/riccipy/metrics/kerr_newman_1.py b/src/riccipy/metrics/kerr_newman_1.py new file mode 100644 index 0000000..1ed2a57 --- /dev/null +++ b/src/riccipy/metrics/kerr_newman_1.py @@ -0,0 +1,14 @@ +# Kerr metric in Cartesian coordinates +_coords = symbols('t x y z', real=True) +_vars = symbols('a M Q', constant=True) +_funs = () +t, x, y, z = _coords +a, M, Q = _vars +expr = x**2+a**2*y**2 +_metric = zeros(4) +_metric[0,0] = -(a**2*y**2+x**2-2*M*x+Q**2)/expr +_metric[1,1] = expr/(x**2-2*M*x+a**2+Q**2) +_metric[2,2] = -expr/(x**2-1) +_metric[3,3] = -(x**4+x**2*a**2+2*a**2*M*x-a**2*Q**2+a**2*y**2*x**2-2*a**2*y**2*M*x+a**4*y**2+a**2*y**2*Q**2)*(y**2-1)/expr +_metric[0,3] = _metric[3,0] = a*(2*M*x-Q**2)*(y**2-1)/expr +del expr, t, x, y, z, a, M, Q diff --git a/src/riccipy/metrics/kerr_newman_2.py b/src/riccipy/metrics/kerr_newman_2.py new file mode 100644 index 0000000..b9494d3 --- /dev/null +++ b/src/riccipy/metrics/kerr_newman_2.py @@ -0,0 +1,15 @@ +# Kerr metric in Boyer Lindquist coordinates +_coords = symbols('t r theta phi', real=True) +_vars = symbols('a M Q', constant=True) +_funs = () +t, r, th, ph = _coords +a, M, Q = _vars +expr = a**2*cos(th)**2+r**2 +_metric = diag(-(a**2-sin(th)**2*a**2+r**2-(2*M*r-Q**2))/expr, expr/(r**2-2*M*r+Q**2+a**2), expr, (-a**4*sin(th)**2+a**4+2*r**2*a**2-a**2*sin(th)**2*r**2+2*a**2*sin(th)**2*M*r-a**2*sin(th)**2*Q**2+r**4)*sin(th)**2/expr) +_metric = zeros(4) +_metric[0,0] = -(a**2-sin(th)**2*a**2+r**2-(2*M*r-Q**2))/expr +_metric[1,1] = expr/(r**2-2*M*r+Q**2+a**2) +_metric[2,2] = expr +_metric[3,3] = (-a**4*sin(th)**2+a**4+2*r**2*a**2-a**2*sin(th)**2*r**2+2*a**2*sin(th)**2*M*r-a**2*sin(th)**2*Q**2+r**4)*sin(th)**2/expr +_metric[0,3] = _metric[3,0] = -(2*a*sin(th)**2*M*r-a*sin(th)**2*Q**2)/expr +del expr, t, r, th, ph, a, M, Q diff --git a/src/riccipy/metrics/klein.py b/src/riccipy/metrics/klein.py new file mode 100644 index 0000000..1d8c1f9 --- /dev/null +++ b/src/riccipy/metrics/klein.py @@ -0,0 +1,8 @@ +# Klein's static spherically symmetric radiation perfect fluid solution +_coords = symbols('t r theta phi', real=True) +_vars = symbols('p_0', constant=True) +_funs = () +t, r, th, ph = _coords +p_0 = _vars +_metric = diag(-sqrt(7*p_0)*r, Rational(7,4), r**2, r**2*sin(th)**2) +del t, r, th, ph, p_0 diff --git a/src/riccipy/metrics/kottler.py b/src/riccipy/metrics/kottler.py new file mode 100644 index 0000000..c765255 --- /dev/null +++ b/src/riccipy/metrics/kottler.py @@ -0,0 +1,9 @@ +# Kottler's generalization of the Schwarzschild metric with non-zero cosmological constant. Aka Schwarzschild-de Sitter. +_coords = symbols('t r theta phi', real=True) +_vars = symbols('M Lambda', constant=True) +_funs = () +t, r, th, ph = _coords +M, La = _vars +expr = 1-2*M/r-La*r**2/3 +_metric = diag(-expr, 1/expr, r**2, r**2*sin(th)**2) +del t, r, th, ph, M, La, expr diff --git a/src/riccipy/metrics/koutras_mcintosh.py b/src/riccipy/metrics/koutras_mcintosh.py new file mode 100644 index 0000000..2d9213c --- /dev/null +++ b/src/riccipy/metrics/koutras_mcintosh.py @@ -0,0 +1,14 @@ +# Koutras-McIntosh metric (no symmetries or invariants) +_coords = symbols('w u x y', real=True) +_vars = symbols('a b', constant=True) +_funs = symbols('f', cls=Function) +w, u, x, y = _coords +a, b = _vars +f = _funs +_metric = zeros(4) +_metric[1,1] = -(2*f(u)*(a*x+b)*(x**2+y**2)-a**2*w**2) +_metric[2,2] = 1 +_metric[3,3] = 1 +_metric[0,1] = _metric[1,0] = -(a*x+b) +_metric[1,2] = _metric[2,1] = a*w +del w, u, x, y, a, b, f diff --git a/src/riccipy/metrics/kowalczynski_plebanski.py b/src/riccipy/metrics/kowalczynski_plebanski.py new file mode 100644 index 0000000..d2f42c2 --- /dev/null +++ b/src/riccipy/metrics/kowalczynski_plebanski.py @@ -0,0 +1,10 @@ +# Kowalczynski and Plebanski metric +_coords = symbols('t x y z', real=True) +_vars = symbols('a b c d', constant=True) +_funs = () +t, x, y, z = _coords +a, b, c, d = _vars +expr1 = a*z**2+b +expr2 = -2*d**2*x**2+c*x-a +_metric = diag(-2*expr1/x**2, 2/(expr2*x**4), 2*expr2, 2/(expr1*x**2)) +del t, x, y, z, a, b, c, d, expr1, expr2 diff --git a/src/riccipy/metrics/levi_civita_1.py b/src/riccipy/metrics/levi_civita_1.py new file mode 100644 index 0000000..163e113 --- /dev/null +++ b/src/riccipy/metrics/levi_civita_1.py @@ -0,0 +1,8 @@ +# Levi-Civita solution, Class AI. Aka the exterior Schwarzschild metric. +_coords = symbols('t r theta phi', real=True) +_vars = symbols('M', constant=True) +_funs = () +t, r, th, ph = _coords +M = _vars +_metric = diag(-(1-2*M/r), 1/(1-2*M/r), r**2, r**2*sin(th)**2) +del t, r, th, ph, M diff --git a/src/riccipy/metrics/levi_civita_2.py b/src/riccipy/metrics/levi_civita_2.py new file mode 100644 index 0000000..b440321 --- /dev/null +++ b/src/riccipy/metrics/levi_civita_2.py @@ -0,0 +1,8 @@ +# Levi-Civita solution, Class AII +_coords = symbols('t z r phi', real=True) +_vars = symbols('M', constant=True) +_funs = () +t, z, r, ph = _coords +M = _vars +_metric = diag(-(2*M/z-1), 1/(2*M/z-1), z**2, z**2*sinh(r)**2) +del t, z, r, ph, M diff --git a/src/riccipy/metrics/levi_civita_3.py b/src/riccipy/metrics/levi_civita_3.py new file mode 100644 index 0000000..0af4b2d --- /dev/null +++ b/src/riccipy/metrics/levi_civita_3.py @@ -0,0 +1,7 @@ +# Levi-Civita solution, Class AIII +_coords = symbols('t z r phi', real=True) +_vars = () +_funs = () +t, z, r, ph = _coords +_metric = diag(-1/z, z, z**2, z**2*r**2) +del t, z, r, ph diff --git a/src/riccipy/metrics/levi_civita_4.py b/src/riccipy/metrics/levi_civita_4.py new file mode 100644 index 0000000..fee66bc --- /dev/null +++ b/src/riccipy/metrics/levi_civita_4.py @@ -0,0 +1,8 @@ +# Levi-Civita solution, Class BI +_coords = symbols('t r theta phi', real=True) +_vars = symbols('M', constant=True) +_funs = () +t, r, th, ph = _coords +M = _vars +_metric = diag(-r**2*sin(th)**2, 1/(1-2*M/r), r**2, 1-2*M/r) +del t, r, th, ph, M diff --git a/src/riccipy/metrics/levi_civita_5.py b/src/riccipy/metrics/levi_civita_5.py new file mode 100644 index 0000000..ea33aa0 --- /dev/null +++ b/src/riccipy/metrics/levi_civita_5.py @@ -0,0 +1,8 @@ +# Levi-Civita solution, Class BII +_coords = symbols('t z r phi', real=True) +_vars = symbols('M', constant=True) +_funs = () +t, z, r, ph = _coords +M = _vars +_metric = diag(-z**2*sinh(r)**2, 1/(2*M/z-1), z**2, 2*M/z-1) +del t, z, r, ph, M diff --git a/src/riccipy/metrics/levi_civita_6.py b/src/riccipy/metrics/levi_civita_6.py new file mode 100644 index 0000000..a9e7904 --- /dev/null +++ b/src/riccipy/metrics/levi_civita_6.py @@ -0,0 +1,7 @@ +# Levi-Civita solution, Class BIII +_coords = symbols('t z r phi', real=True) +_vars = () +_funs = () +t, z, r, ph = _coords +_metric = diag(-r**2*z**2, z, z**2, 1/z) +del t, z, r, ph diff --git a/src/riccipy/metrics/levi_civita_7.py b/src/riccipy/metrics/levi_civita_7.py new file mode 100644 index 0000000..2dac456 --- /dev/null +++ b/src/riccipy/metrics/levi_civita_7.py @@ -0,0 +1,7 @@ +# Levi-Civita static vacuum solution. Special case m=2, Petrov D +_coords = symbols('t rho z phi', real=True) +_vars = () +_funs = () +t, rh, z, ph = _coords +_metric = diag(-rh**4, rh**4, rh**4, 1/rh**2) +del t, rh, z, ph diff --git a/src/riccipy/metrics/levi_civita_8.py b/src/riccipy/metrics/levi_civita_8.py new file mode 100644 index 0000000..66ab1fb --- /dev/null +++ b/src/riccipy/metrics/levi_civita_8.py @@ -0,0 +1,8 @@ +# Levi-Civita static vacuum solution +_coords = symbols('t rho z phi', real=True) +_vars = symbols('m', constant=True) +_funs = () +t, rh, z, ph = _coords +m = _vars +_metric = diag(-rh**(2*m), rh**(2*(m**2-m)), rh**(2*(m**2-m)), rh**(2*(1-m))) +del t, rh, z, ph, m diff --git a/src/riccipy/metrics/lrs.py b/src/riccipy/metrics/lrs.py new file mode 100644 index 0000000..6696040 --- /dev/null +++ b/src/riccipy/metrics/lrs.py @@ -0,0 +1,8 @@ +# LRS stiff perfect fluid cosmological solution with G4 on S3 +_coords = symbols('t x y z', real=True) +_vars = symbols('k', constant=True) +_funs = () +t, x, y, z = _coords +k = _vars +_metric = diag(-1, t**(2/k), t**(1-1/k), t**(1-1/k)) +del t, x, y, z, k diff --git a/src/riccipy/metrics/plane_symmetric.py b/src/riccipy/metrics/plane_symmetric.py new file mode 100644 index 0000000..67afbc2 --- /dev/null +++ b/src/riccipy/metrics/plane_symmetric.py @@ -0,0 +1,8 @@ +# Bianchi I plane symmetric model +_coords = symbols('t x y z', real=True) +_vars = () +_funs = symbols('alpha beta', cls=Function) +t, x, y, z = _coords +al, be = _funs +_metric = diag(-1, exp(2*be(t)), exp(2*be(t)), exp(2*al(t))) +del t, x, y, z, al, be diff --git a/src/riccipy/metrics/robertson_walker_1.py b/src/riccipy/metrics/robertson_walker_1.py new file mode 100644 index 0000000..a9eafd7 --- /dev/null +++ b/src/riccipy/metrics/robertson_walker_1.py @@ -0,0 +1,8 @@ +# Closed Friedman-Robertson-Walker metric. Perfect fluid +_coords = symbols('t r theta phi', real=True) +_vars = () +_funs = symbols('a', cls=Function) +t, r, th, ph = _coords +a = _funs +_metric = diag(-1, a(t)**2, a(t)**2*sin(r)**2, a(t)**2*sin(r)**2*sin(th)**2) +del t, r, th, ph, a diff --git a/src/riccipy/metrics/robertson_walker_2.py b/src/riccipy/metrics/robertson_walker_2.py new file mode 100644 index 0000000..78087f2 --- /dev/null +++ b/src/riccipy/metrics/robertson_walker_2.py @@ -0,0 +1,8 @@ +# Spatially flat Friedman-Robertson-Walker metric. Perfect fluid +_coords = symbols('t r theta phi', real=True) +_vars = () +_funs = symbols('a', cls=Function) +t, r, th, ph = _coords +a = _funs +_metric = diag(-1, a(t)**2, a(t)**2*r**2, a(t)**2*r**2*sin(th)**2) +del t, r, th, ph, a From 2971a0a646a35906610baa55122ba048b465106b Mon Sep 17 00:00:00 2001 From: cjayross Date: Sun, 7 Jul 2019 00:27:03 -0500 Subject: [PATCH 21/34] added the remaining metrics --- src/riccipy/metrics/bondi_2.py | 1 + src/riccipy/metrics/einstein_1.py | 2 +- src/riccipy/metrics/harrison_4.py | 7 +++++++ src/riccipy/metrics/harrison_5.py | 7 +++++++ src/riccipy/metrics/harrison_6.py | 7 +++++++ src/riccipy/metrics/harrison_7.py | 7 +++++++ src/riccipy/metrics/harrison_8.py | 7 +++++++ src/riccipy/metrics/lewis_papapetrou.py | 12 ++++++++++++ src/riccipy/metrics/mclenaghan_tariq_tupper.py | 8 ++++++++ src/riccipy/metrics/mcvittie.py | 8 ++++++++ src/riccipy/metrics/melvin.py | 9 +++++++++ src/riccipy/metrics/minkowski_1.py | 5 +++++ src/riccipy/metrics/minkowski_2.py | 7 +++++++ src/riccipy/metrics/minkowski_3.py | 11 +++++++++++ src/riccipy/metrics/nariai.py | 11 +++++++++++ src/riccipy/metrics/novotny_horsky.py | 8 ++++++++ src/riccipy/metrics/pant_sah.py | 8 ++++++++ src/riccipy/metrics/reissner_nordstrom_1.py | 9 +++++++++ src/riccipy/metrics/reissner_nordstrom_2.py | 9 +++++++++ src/riccipy/metrics/robertson_walker_3.py | 9 +++++++++ src/riccipy/metrics/schwarzschild_1.py | 8 ++++++++ src/riccipy/metrics/schwarzschild_2.py | 9 +++++++++ src/riccipy/metrics/schwarzschild_3.py | 9 +++++++++ src/riccipy/metrics/schwarzschild_4.py | 9 +++++++++ src/riccipy/metrics/schwarzschild_5.py | 10 ++++++++++ src/riccipy/metrics/schwarzschild_6.py | 10 ++++++++++ src/riccipy/metrics/schwarzschild_7.py | 9 +++++++++ src/riccipy/metrics/schwarzschild_8.py | 8 ++++++++ src/riccipy/metrics/static_spherical_1.py | 8 ++++++++ src/riccipy/metrics/static_spherical_2.py | 8 ++++++++ src/riccipy/metrics/szekeres_1.py | 7 +++++++ src/riccipy/metrics/szekeres_2.py | 7 +++++++ src/riccipy/metrics/tariq_tupper.py | 7 +++++++ src/riccipy/metrics/taub_1.py | 8 ++++++++ src/riccipy/metrics/taub_2.py | 7 +++++++ src/riccipy/metrics/tolman_1.py | 8 ++++++++ src/riccipy/metrics/tolman_2.py | 8 ++++++++ src/riccipy/metrics/tolman_3.py | 10 ++++++++++ src/riccipy/metrics/vaidya_1.py | 9 +++++++++ src/riccipy/metrics/vaidya_2.py | 9 +++++++++ src/riccipy/metrics/vaidya_3.py | 9 +++++++++ src/riccipy/metrics/vaidya_4.py | 9 +++++++++ 42 files changed, 337 insertions(+), 1 deletion(-) create mode 100644 src/riccipy/metrics/harrison_4.py create mode 100644 src/riccipy/metrics/harrison_5.py create mode 100644 src/riccipy/metrics/harrison_6.py create mode 100644 src/riccipy/metrics/harrison_7.py create mode 100644 src/riccipy/metrics/harrison_8.py create mode 100644 src/riccipy/metrics/lewis_papapetrou.py create mode 100644 src/riccipy/metrics/mclenaghan_tariq_tupper.py create mode 100644 src/riccipy/metrics/mcvittie.py create mode 100644 src/riccipy/metrics/melvin.py create mode 100644 src/riccipy/metrics/minkowski_1.py create mode 100644 src/riccipy/metrics/minkowski_2.py create mode 100644 src/riccipy/metrics/minkowski_3.py create mode 100644 src/riccipy/metrics/nariai.py create mode 100644 src/riccipy/metrics/novotny_horsky.py create mode 100644 src/riccipy/metrics/pant_sah.py create mode 100644 src/riccipy/metrics/reissner_nordstrom_1.py create mode 100644 src/riccipy/metrics/reissner_nordstrom_2.py create mode 100644 src/riccipy/metrics/robertson_walker_3.py create mode 100644 src/riccipy/metrics/schwarzschild_1.py create mode 100644 src/riccipy/metrics/schwarzschild_2.py create mode 100644 src/riccipy/metrics/schwarzschild_3.py create mode 100644 src/riccipy/metrics/schwarzschild_4.py create mode 100644 src/riccipy/metrics/schwarzschild_5.py create mode 100644 src/riccipy/metrics/schwarzschild_6.py create mode 100644 src/riccipy/metrics/schwarzschild_7.py create mode 100644 src/riccipy/metrics/schwarzschild_8.py create mode 100644 src/riccipy/metrics/static_spherical_1.py create mode 100644 src/riccipy/metrics/static_spherical_2.py create mode 100644 src/riccipy/metrics/szekeres_1.py create mode 100644 src/riccipy/metrics/szekeres_2.py create mode 100644 src/riccipy/metrics/tariq_tupper.py create mode 100644 src/riccipy/metrics/taub_1.py create mode 100644 src/riccipy/metrics/taub_2.py create mode 100644 src/riccipy/metrics/tolman_1.py create mode 100644 src/riccipy/metrics/tolman_2.py create mode 100644 src/riccipy/metrics/tolman_3.py create mode 100644 src/riccipy/metrics/vaidya_1.py create mode 100644 src/riccipy/metrics/vaidya_2.py create mode 100644 src/riccipy/metrics/vaidya_3.py create mode 100644 src/riccipy/metrics/vaidya_4.py diff --git a/src/riccipy/metrics/bondi_2.py b/src/riccipy/metrics/bondi_2.py index 481fbf5..276704f 100644 --- a/src/riccipy/metrics/bondi_2.py +++ b/src/riccipy/metrics/bondi_2.py @@ -6,3 +6,4 @@ C, M = _funs _metric = diag(0,-C(t,v)**2*(1-2*M(t,v)/t),t**2,t**2*sin(th)**2) _metric[0,1] = _metric[1,0] = -C(r,v) +del r, v, th, ph, C, M diff --git a/src/riccipy/metrics/einstein_1.py b/src/riccipy/metrics/einstein_1.py index 8c23b68..b4fe684 100644 --- a/src/riccipy/metrics/einstein_1.py +++ b/src/riccipy/metrics/einstein_1.py @@ -1,4 +1,4 @@ -# Einstein's static universe. Euclidean coordinates +# Einstein's static universe. Cartesian coordinates _coords = symbols('t x y z', real=True) _vars = symbols('K', constant=True) _funs = () diff --git a/src/riccipy/metrics/harrison_4.py b/src/riccipy/metrics/harrison_4.py new file mode 100644 index 0000000..ece521b --- /dev/null +++ b/src/riccipy/metrics/harrison_4.py @@ -0,0 +1,7 @@ +# Harrison III-7(b) Petrov type D, Kinnersley class IV.B (C=1/2) +_coords = symbols('x_0:4', real=True) +_vars = () +_funs = () +x0, x1, x2, x3 = _coords +_metric = diag(-1/(1-x3**2)**2, cosh(2*x0)**2/(1-x3**2)**2, x3**2, 1/(1-x3**2)**4) +del x0, x1, x2, x3 diff --git a/src/riccipy/metrics/harrison_5.py b/src/riccipy/metrics/harrison_5.py new file mode 100644 index 0000000..984e046 --- /dev/null +++ b/src/riccipy/metrics/harrison_5.py @@ -0,0 +1,7 @@ +# Harrison III-7(a) Petrov type D, Kinnersley class IV.B (C=1/2) +_coords = symbols('x_0:4', real=True) +_vars = () +_funs = () +x0, x1, x2, x3 = _coords +_metric = diag(-1/(1-x3**2)**2, exp(4*x0)**2/(1-x3**2)**2, x3**2, 1/(1-x3**2)**4) +del x0, x1, x2, x3 diff --git a/src/riccipy/metrics/harrison_6.py b/src/riccipy/metrics/harrison_6.py new file mode 100644 index 0000000..4fcd523 --- /dev/null +++ b/src/riccipy/metrics/harrison_6.py @@ -0,0 +1,7 @@ +# Harrison III-9(a) Petrov type D, Kinnersley class II.B (a=l=0) +_coords = symbols('x_0:4', real=True) +_vars = () +_funs = () +x0, x1, x2, x3 = _coords +_metric = diag(-x3**2, sinh(2*x2)**2/(1+x3**2)**2, 1/(1+x3**2)**2, 1/(1+x3**2)**4) +del x0, x1, x2, x3 diff --git a/src/riccipy/metrics/harrison_7.py b/src/riccipy/metrics/harrison_7.py new file mode 100644 index 0000000..35056f1 --- /dev/null +++ b/src/riccipy/metrics/harrison_7.py @@ -0,0 +1,7 @@ +# Harrison III-9(b) Petrov type D, Kinnersley class II.C (a=l=0) +_coords = symbols('x_0:4', real=True) +_vars = () +_funs = () +x0, x1, x2, x3 = _coords +_metric = diag(-x3**2, cosh(2*x2)**2/(1+x3**2)**2, 1/(1+x3**2)**2, 1/(1+x3**2)**4) +del x0, x1, x2, x3 diff --git a/src/riccipy/metrics/harrison_8.py b/src/riccipy/metrics/harrison_8.py new file mode 100644 index 0000000..07850b8 --- /dev/null +++ b/src/riccipy/metrics/harrison_8.py @@ -0,0 +1,7 @@ +# Harrison III-9(c) Petrov type D, Kinnersley class II.D (a=l=0) +_coords = symbols('x_0:4', real=True) +_vars = () +_funs = () +x0, x1, x2, x3 = _coords +_metric = diag(-x3**2, exp(4*x2)**2/(1+x3**2)**2, 1/(1+x3**2)**2, 1/(1+x3**2)**4) +del x0, x1, x2, x3 diff --git a/src/riccipy/metrics/lewis_papapetrou.py b/src/riccipy/metrics/lewis_papapetrou.py new file mode 100644 index 0000000..f0a95be --- /dev/null +++ b/src/riccipy/metrics/lewis_papapetrou.py @@ -0,0 +1,12 @@ +# Lewis Papapetrou metric +_coords = symbols('t x y z', real=True) +_vars = () +_funs = symbols('k r s w', cls=Function) +t, x, y, z = _coords +k, r, s, w = _funs +_metric = zeros(4) +_metric[0,0] = -exp(2*s(x,y)) +_metric[3,3] = (exp(-s(x,y))*r(x,y)-w(x,y)*exp(s(x,y)))*(exp(-s(x,y))*r(x,y)+w(x,y)*exp(s(x,y))) +_metric[0,3] = _metric[3,0] = -w(x,y)*exp(2*s(x,y)) +_metric[1,2] = _metric[2,1] = Rational(1,2)*exp(2*k(x,y)-2*s(x,y)) +del t, x, y, z, k, r, s, w diff --git a/src/riccipy/metrics/mclenaghan_tariq_tupper.py b/src/riccipy/metrics/mclenaghan_tariq_tupper.py new file mode 100644 index 0000000..1a6576f --- /dev/null +++ b/src/riccipy/metrics/mclenaghan_tariq_tupper.py @@ -0,0 +1,8 @@ +# McLenaghan Tariq Tupper metric +_coords = symbols('t x y phi', real=True) +_vars = symbols('a', constant=True) +_funs = () +t, x, y, ph = _coords +_metric = diag(-1, a**2/x**2, a**2/x**2, x**2-4*y**2) +_metric[0,3] = _metric[3,0] = 2*y +del t, x, y, ph diff --git a/src/riccipy/metrics/mcvittie.py b/src/riccipy/metrics/mcvittie.py new file mode 100644 index 0000000..d178a9e --- /dev/null +++ b/src/riccipy/metrics/mcvittie.py @@ -0,0 +1,8 @@ +# McVittie's plane Einstein-Maxwell field with Lambda=0 +_coords = symbols('t x y z', real=True) +_vars = symbols('M Q', constant=True) +_funs = () +t, x, y, z = _coords +M, Q = _vars +_metric = diag(-(M/z+Q**2/z**2), z**2, z**2, 1/(M/z+Q**2/z**2)) +del t, x, y, z, M, Q diff --git a/src/riccipy/metrics/melvin.py b/src/riccipy/metrics/melvin.py new file mode 100644 index 0000000..647383f --- /dev/null +++ b/src/riccipy/metrics/melvin.py @@ -0,0 +1,9 @@ +# Melvin's magnetic universe +_coords = symbols('t rho z phi', real=True) +_vars = symbols('B_0', constant=True) +_funs = () +t, rh, z, ph = _coords +B0 = _vars +expr = (1+B0**2*rh**2/4)**2 +_metric = diag(-expr, expr, expr, rh**2/expr) +del expr, t, rh, z, ph, B0 diff --git a/src/riccipy/metrics/minkowski_1.py b/src/riccipy/metrics/minkowski_1.py new file mode 100644 index 0000000..3458a8d --- /dev/null +++ b/src/riccipy/metrics/minkowski_1.py @@ -0,0 +1,5 @@ +# Minkowski space in Cartesian coordinates +_coords = symbols('t x y z', real=True) +_vars = () +_funs = () +_metric = diag(-1, 1, 1, 1) diff --git a/src/riccipy/metrics/minkowski_2.py b/src/riccipy/metrics/minkowski_2.py new file mode 100644 index 0000000..c5790e3 --- /dev/null +++ b/src/riccipy/metrics/minkowski_2.py @@ -0,0 +1,7 @@ +# Minkowski space in polar coordinates +_coords = symbols('t r theta phi', real=True) +_vars = () +_funs = () +t, r, th, ph = _coords +_metric = diag(-1, 1, r**2, r**2*sin(th)**2) +del t, r, th, ph diff --git a/src/riccipy/metrics/minkowski_3.py b/src/riccipy/metrics/minkowski_3.py new file mode 100644 index 0000000..46d2c76 --- /dev/null +++ b/src/riccipy/metrics/minkowski_3.py @@ -0,0 +1,11 @@ +# Minkowski space in null coordinates +_coords = symbols('u v theta phi', real=True) +_vars = symbols('a b', constant=True) +_funs = () +u, v, th, ph = _coords +a, b = _vars +_metric = zeros(4) +_metric[2,2] = (a*u-Rational(1,2)*v/a+c)**2 +_metric[3,3] = (a*u-Rational(1,2)*v/a+c)**2*sin(th)**2 +_metric[0,1] = _metric[1,0] = -1 +del u, v, th, ph, a, b diff --git a/src/riccipy/metrics/nariai.py b/src/riccipy/metrics/nariai.py new file mode 100644 index 0000000..9125e31 --- /dev/null +++ b/src/riccipy/metrics/nariai.py @@ -0,0 +1,11 @@ +# Nariai vacuum metric +_coords = symbols('t x y z', real=True) +_vars = symbols('lambda', constant=True) +_funs = symbols('a b', cls=Function) +t, x, y, z = _coords +la = _vars +a, b = _funs +expr1 = x**2+y**2+z**2 +expr2 = a(t)*cos(log(sqrt(expr1)/la)) + b(t)*sin(log(sqrt(expr1)/la)) +_metric = diag(-expr2, la**2/expr1, la**2/expr1, la**2/expr1) +del expr1, expr2, t, x, y, z, la, a, b diff --git a/src/riccipy/metrics/novotny_horsky.py b/src/riccipy/metrics/novotny_horsky.py new file mode 100644 index 0000000..b895ab1 --- /dev/null +++ b/src/riccipy/metrics/novotny_horsky.py @@ -0,0 +1,8 @@ +# Novotny and Horsky plane symmetric vacuum metric +_coords = symbols('t x y z', real=True) +_vars = symbols('a', constant=True) +_funs = () +t, x, y, z = _coords +a = _vars +_metric = diag(-cos(z)/sin(z)**Rational(2,3), sin(z)**Rational(4,3), sin(z)**Rational(4,3), 1/a**2) +del t, x, y, z, a diff --git a/src/riccipy/metrics/pant_sah.py b/src/riccipy/metrics/pant_sah.py new file mode 100644 index 0000000..16a89df --- /dev/null +++ b/src/riccipy/metrics/pant_sah.py @@ -0,0 +1,8 @@ +# Pant and Sah charged static spherically symmetric solution +_coords = symbols('t r theta phi', real=True) +_vars = symbols('A n', constant=True) +_funs = () +t, r, th, ph = _coords +A, n = _vars +_metric = diag(-A*r**(2*n), n**2+1, r**2, r**2*sin(th)**2) +del t, r, th, ph, A, n diff --git a/src/riccipy/metrics/reissner_nordstrom_1.py b/src/riccipy/metrics/reissner_nordstrom_1.py new file mode 100644 index 0000000..df1da35 --- /dev/null +++ b/src/riccipy/metrics/reissner_nordstrom_1.py @@ -0,0 +1,9 @@ +# Reissner-Nordstrom spherically symmetric electro-vacuum solution +_coords = symbols('t r theta phi', real=True) +_vars = symbols('M Q', constant=True) +_funs = () +t, r, th, ph = _coords +M, Q = _vars +expr = 1-2*M/r+Q**2/r**2 +_metric = diag(-expr, 1/expr, r**2, r**2*sin(th)**2) +del expr, t, r, th, ph, M, Q diff --git a/src/riccipy/metrics/reissner_nordstrom_2.py b/src/riccipy/metrics/reissner_nordstrom_2.py new file mode 100644 index 0000000..33e9b16 --- /dev/null +++ b/src/riccipy/metrics/reissner_nordstrom_2.py @@ -0,0 +1,9 @@ +# Reissner-Nordstrom spherically symmetric electro-vacuum solution with non-zero cosmological constant +_coords = symbols('t r theta phi', real=True) +_vars = symbols('M Q Lambda', constant=True) +_funs = () +t, r, th, ph = _coords +M, Q, La = _vars +expr = 1-2*M/r+Q**2/r**2-La*r**2/3 +_metric = diag(-expr, 1/expr, r**2, r**2*sin(th)**2) +del expr, t, r, th, ph, M, Q diff --git a/src/riccipy/metrics/robertson_walker_3.py b/src/riccipy/metrics/robertson_walker_3.py new file mode 100644 index 0000000..09beea8 --- /dev/null +++ b/src/riccipy/metrics/robertson_walker_3.py @@ -0,0 +1,9 @@ +# Closed Friedman-Robertson-Walker metric. Dust +_coords = symbols('nu chi theta phi', real=True) +_vars = symbols('A_0', constant=True) +_funs = () +nu, ch, th, ph = _coords +A0 = _vars +expr = A0**2*(1-cos(nu))**2 +_metric = diag(-expr, expr, expr*sin(ch)**2, expr*sin(ch)**2*sin(th)**2) +del expr, nu, ch, th, ph, A0 diff --git a/src/riccipy/metrics/schwarzschild_1.py b/src/riccipy/metrics/schwarzschild_1.py new file mode 100644 index 0000000..4b865ff --- /dev/null +++ b/src/riccipy/metrics/schwarzschild_1.py @@ -0,0 +1,8 @@ +# Schwarzschild exterior metric in curvature coordinates +_coords = symbols('t r theta phi', real=True) +_vars = symbols('M', constant=True) +_funs = () +t, r, th, ph = _coords +M = _vars +_metric = diag(-(1-2*M/r), 1/(1-2*M/r), r**2, r**2*sin(th)**2) +del t, r, th, ph, M diff --git a/src/riccipy/metrics/schwarzschild_2.py b/src/riccipy/metrics/schwarzschild_2.py new file mode 100644 index 0000000..7b59ec2 --- /dev/null +++ b/src/riccipy/metrics/schwarzschild_2.py @@ -0,0 +1,9 @@ +# Schwarzschild metric in outgoing Eddington-Finkelstein coordinates +_coords = symbols('r u theta phi', real=True) +_vars = symbols('M', constant=True) +_funs = () +r, u, th, ph = _coords +M = _vars +_metric = diag(0, -(1-2*M/r), r**2, r**2*sin(th)**2) +_metric[0,1] = _metric[1,0] = -1 +del r, u, th, ph, M diff --git a/src/riccipy/metrics/schwarzschild_3.py b/src/riccipy/metrics/schwarzschild_3.py new file mode 100644 index 0000000..6b8dddf --- /dev/null +++ b/src/riccipy/metrics/schwarzschild_3.py @@ -0,0 +1,9 @@ +# Schwarzschild metric in ingoing Eddington-Finkelstein coordinates +_coords = symbols('r v theta phi', real=True) +_vars = symbols('M', constant=True) +_funs = () +r, v, th, ph = _coords +M = _vars +_metric = diag(0, -(1-2*M/r), r**2, r**2*sin(th)**2) +_metric[0,1] = _metric[1,0] = 1 +del r, v, th, ph, M diff --git a/src/riccipy/metrics/schwarzschild_4.py b/src/riccipy/metrics/schwarzschild_4.py new file mode 100644 index 0000000..2eca2ed --- /dev/null +++ b/src/riccipy/metrics/schwarzschild_4.py @@ -0,0 +1,9 @@ +# Schwarzschild exterior metric in isotropic coordinates +_coords = symbols('t r theta phi', real=True) +_vars = symbols('M', constant=True) +_funs = () +t, r, th, ph = _coords +M = _vars +expr = (1+Rational(1,2)*M/r)**4 +_metric = diag(-(1-Rational(1,2)*M/r)**2/(1+Rational(1,2)*M/r)**2, expr, expr*r**2, expr*r**2*sin(th)**2) +del expr, t, r, th, ph, M diff --git a/src/riccipy/metrics/schwarzschild_5.py b/src/riccipy/metrics/schwarzschild_5.py new file mode 100644 index 0000000..73a85da --- /dev/null +++ b/src/riccipy/metrics/schwarzschild_5.py @@ -0,0 +1,10 @@ +# Schwarzschild exterior metric in Cartesian isotropic coordinates +_coords = symbols('t x y z', real=True) +_vars = symbols('M', constant=True) +_funs = () +t, x, y, z = _coords +M = _vars +expr1 = sqrt(x**2+y**2+z**2) +expr2 = (1+Rational(1,2)*M/expr1)**4 +_metric = diag(-(1-Rational(1,2)*M/expr1)**2/(1+Rational(1,2)*M/expr1)**2, expr2, expr2, expr2) +del expr1, expr2, t, x, y, z, M diff --git a/src/riccipy/metrics/schwarzschild_6.py b/src/riccipy/metrics/schwarzschild_6.py new file mode 100644 index 0000000..99121ca --- /dev/null +++ b/src/riccipy/metrics/schwarzschild_6.py @@ -0,0 +1,10 @@ +# Schwarzschild exterior metric in Israel coordinates +_coords = symbols('u w theta phi', real=True) +_vars = symbols('M', constant=True) +_funs = () +u, w, th, ph = _coords +M = _vars +expr = 2*M+Rational(1,4)*u*w/M +_metric = diag(Rational(1,2)*w**2/(M*expr), 0, expr**2, expr**2*sin(th)**2) +_metric[0,1] = _metric[1,0] = 1 +del expr, u, w, th, ph, M diff --git a/src/riccipy/metrics/schwarzschild_7.py b/src/riccipy/metrics/schwarzschild_7.py new file mode 100644 index 0000000..4321378 --- /dev/null +++ b/src/riccipy/metrics/schwarzschild_7.py @@ -0,0 +1,9 @@ +# Schwarzschild metric as the rho->0 limit of Tolman-Bondi dust +_coords = symbols('t r theta phi', real=True) +_vars = symbols('M', constant=True) +_funs = () +t, r, th, ph = _coords +M = _vars +expr = M*(r-t)**2 +_metric = diag(-1, Rational(4,9)*M/expr**Rational(1,3), expr**Rational(2,3), expr**Rational(2,3)*sin(th)**2) +del expr, t, r, th, ph, M diff --git a/src/riccipy/metrics/schwarzschild_8.py b/src/riccipy/metrics/schwarzschild_8.py new file mode 100644 index 0000000..464da30 --- /dev/null +++ b/src/riccipy/metrics/schwarzschild_8.py @@ -0,0 +1,8 @@ +# Schwarzschild interior solution in curvature coordinates +_coords = symbols('t r theta phi', real=True) +_vars = symbols('A B R', constant=True) +_funs = () +t, r, th, ph = _coords +A, B, R = _vars +_metric = diag(-(A-B*sqrt(1-r**2/R**2))**2, 1/(1-r**2/R**2), r**2, r**2*sin(th)**2) +del t, r, th, ph, A, B, R diff --git a/src/riccipy/metrics/static_spherical_1.py b/src/riccipy/metrics/static_spherical_1.py new file mode 100644 index 0000000..3a2a63b --- /dev/null +++ b/src/riccipy/metrics/static_spherical_1.py @@ -0,0 +1,8 @@ +# General static, spherically symmetric metric in curvature coordinates +_coords = symbols('t r theta phi', real=True) +_vars = () +_funs = symbolic('alpha beta', cls=Function) +t, r, th, ph = _coords +al, be = _funs +_metric = diag(-exp(2*al(r)), exp(2*be(r)), r**2, r**2*sin(th)**2) +del t, r, th, ph, al, be diff --git a/src/riccipy/metrics/static_spherical_2.py b/src/riccipy/metrics/static_spherical_2.py new file mode 100644 index 0000000..8ffbfb8 --- /dev/null +++ b/src/riccipy/metrics/static_spherical_2.py @@ -0,0 +1,8 @@ +# General static, spherically symmetric metric in curvature coordinates +_coords = symbols('t r theta phi', real=True) +_vars = () +_funs = symbolic('alpha beta', cls=Function) +t, r, th, ph = _coords +al, be = _funs +_metric = diag(-exp(2*al(r)), exp(2*be(r)), exp(2*be(r))*r**2, exp(2*be(r))*r**2*sin(th)**2) +del t, r, th, ph, al, be diff --git a/src/riccipy/metrics/szekeres_1.py b/src/riccipy/metrics/szekeres_1.py new file mode 100644 index 0000000..2010736 --- /dev/null +++ b/src/riccipy/metrics/szekeres_1.py @@ -0,0 +1,7 @@ +# Szekeres solution for a special stiff perfect fluid +_coords = symbols('t x y z', real=True) +_vars = () +_funs = () +t, x, y, z = _coords +_metric = diag(-x**6, x**4*cos(2*t)**2, x**2/cos(2*t), x**2/cos(2*t)) +del t, x, y, z diff --git a/src/riccipy/metrics/szekeres_2.py b/src/riccipy/metrics/szekeres_2.py new file mode 100644 index 0000000..c1ad30a --- /dev/null +++ b/src/riccipy/metrics/szekeres_2.py @@ -0,0 +1,7 @@ +# Szekeres solution for a special stiff perfect fluid in Abelian type coordinates +_coords = symbols('t x y z', real=True) +_vars = () +_funs = () +t, x, y, z = _coords +_metric = diag(-exp(6*x)/cosh(2*t)**2, exp(6*x)/cosh(2*t)**2, exp(2*x)*cosh(2*t), exp(2*x)*cosh(2*t)) +del t, x, y, z diff --git a/src/riccipy/metrics/tariq_tupper.py b/src/riccipy/metrics/tariq_tupper.py new file mode 100644 index 0000000..d4c379f --- /dev/null +++ b/src/riccipy/metrics/tariq_tupper.py @@ -0,0 +1,7 @@ +# Tariq and Tupper metric admitting a G3VIo on S3 +_coords = symbols('t x y z', real=True) +_vars = () +_funs = () +t, x, y, z = _coords +_metric = diag(-1, 4*t**2/3, t/exp(2*x), t*exp(2*x)) +del t, x, y, z diff --git a/src/riccipy/metrics/taub_1.py b/src/riccipy/metrics/taub_1.py new file mode 100644 index 0000000..d207d2c --- /dev/null +++ b/src/riccipy/metrics/taub_1.py @@ -0,0 +1,8 @@ +# Taub metric for plane symmetric, static perfect fluid. +_coords = symbols('t x y z', real=True) +_vars = symbols('mu', constant=True) +_funs = () +t, x, y, z = _coords +mu = _vars +_metric = diag(-(z-3)**2, z**2, z**2, 3/(mu*z**2)) +del t, x, y, z, mu diff --git a/src/riccipy/metrics/taub_2.py b/src/riccipy/metrics/taub_2.py new file mode 100644 index 0000000..ff8e2c9 --- /dev/null +++ b/src/riccipy/metrics/taub_2.py @@ -0,0 +1,7 @@ +# Taub's plane symmetric vacuum solution +_coords = symbols('t x y z', real=True) +_vars = () +_funs = () +t, x, y, z = _coords +_metric = diag(-1/sqrt(z), z, z, 1/sqrt(z)) +del t, x, y, z diff --git a/src/riccipy/metrics/tolman_1.py b/src/riccipy/metrics/tolman_1.py new file mode 100644 index 0000000..c83e97c --- /dev/null +++ b/src/riccipy/metrics/tolman_1.py @@ -0,0 +1,8 @@ +# Tolman's type IV solution +_coords = symbols('t r theta phi', real=True) +_vars = symbols('A B R', constant=True) +_funs = () +t, r, th, ph = _coords +A, B, R = _vars +_metric = diag(-B**2*(1+r**2/A**2), (1+2*r**2/A**2)/((1+r**2/A**2)*(1-r**2/R**2)), r**2, r**2*sin(th)**2) +del t, r, th, ph, A, B, R diff --git a/src/riccipy/metrics/tolman_2.py b/src/riccipy/metrics/tolman_2.py new file mode 100644 index 0000000..5fa8b03 --- /dev/null +++ b/src/riccipy/metrics/tolman_2.py @@ -0,0 +1,8 @@ +# Tolman's type VI solution +_coords = symbols('t r theta phi', real=True) +_vars = symbols('A B n', constant=True) +_funs = () +t, r, th, ph = _coords +A, B, n = _vars +_metric = diag(-(A*r**(1-n)-B*r**(1+n))**2, 2-n**2, r**2, r**2*sin(th)**2) +del t, r, th, ph, A, B, n diff --git a/src/riccipy/metrics/tolman_3.py b/src/riccipy/metrics/tolman_3.py new file mode 100644 index 0000000..7dd1697 --- /dev/null +++ b/src/riccipy/metrics/tolman_3.py @@ -0,0 +1,10 @@ +# Tolman's type VII static spherically symmetric perfect fluid solution +_coords = symbols('t r theta phi', real=True) +_vars = symbols('A B C R', constant=True) +_funs = () +t, r, th, ph = _coords +A, B, C, R = _vars +expr1 = 1-r**2/R**2+4*r**4/A**4 +expr2 = sin(log(sqrt((sqrt(expr1)+2*r**2/A**2-Rational(1,4)*A**2/R**2)/C))) +_metric = diag(-B**2*expr2**2, 1/expr1, r**2, r**2*sin(th)**2) +del expr1, expr2, t, r, th, ph, A, B, C, R diff --git a/src/riccipy/metrics/vaidya_1.py b/src/riccipy/metrics/vaidya_1.py new file mode 100644 index 0000000..b31a2d6 --- /dev/null +++ b/src/riccipy/metrics/vaidya_1.py @@ -0,0 +1,9 @@ +# Vaidya metric in outgoing Eddington-Finkelstein coordinates +_coords = symbols('r v theta phi', real=True) +_vars = () +_funs = symbols('M', cls=Function) +r, v, th, ph = _coords +M = _funs +_metric = diag(0, -(1-2*M(v)/r), r**2, r**2*sin(th)**2) +_metric[0,1] = _metric[1,0] = -1 +del r, v, th, ph, M diff --git a/src/riccipy/metrics/vaidya_2.py b/src/riccipy/metrics/vaidya_2.py new file mode 100644 index 0000000..025051f --- /dev/null +++ b/src/riccipy/metrics/vaidya_2.py @@ -0,0 +1,9 @@ +# Vaidya metric in ingoing Eddington-Finkelstein coordinates +_coords = symbols('r v theta phi', real=True) +_vars = () +_funs = symbols('M', cls=Function) +r, v, th, ph = _coords +M = _funs +_metric = diag(0, -(1-2*M(v)/r), r**2, r**2*sin(th)**2) +_metric[0,1] = _metric[1,0] = 1 +del r, v, th, ph, M diff --git a/src/riccipy/metrics/vaidya_3.py b/src/riccipy/metrics/vaidya_3.py new file mode 100644 index 0000000..7c42e84 --- /dev/null +++ b/src/riccipy/metrics/vaidya_3.py @@ -0,0 +1,9 @@ +# Vaidya metric with non-zero cosmological constant in outgoing Eddington-Finkelstein coordinates +_coords = symbols('r v theta phi', real=True) +_vars = symbols('Lambda', constant=True) +_funs = symbols('M', cls=Function) +r, v, th, ph = _coords +M = _funs +_metric = diag(0, -(1-2*M(v)/r-Lambda*r**2/3), r**2, r**2*sin(th)**2) +_metric[0,1] = _metric[1,0] = -1 +del r, v, th, ph, M diff --git a/src/riccipy/metrics/vaidya_4.py b/src/riccipy/metrics/vaidya_4.py new file mode 100644 index 0000000..51faa33 --- /dev/null +++ b/src/riccipy/metrics/vaidya_4.py @@ -0,0 +1,9 @@ +# Vaidya metric with non-zero cosmological constant in ingoing Eddington-Finkelstein coordinates +_coords = symbols('r v theta phi', real=True) +_vars = symbols('Lambda', constant=True) +_funs = symbols('M', cls=Function) +r, v, th, ph = _coords +M = _funs +_metric = diag(0, -(1-2*M(v)/r-Lambda*r**2/3), r**2, r**2*sin(th)**2) +_metric[0,1] = _metric[1,0] = 1 +del r, v, th, ph, M From b8ff53e7a4557a0a212236b70196e98666a1a6fa Mon Sep 17 00:00:00 2001 From: cjayross Date: Sun, 7 Jul 2019 01:44:07 -0500 Subject: [PATCH 22/34] added load_metric function --- src/riccipy/metric.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/riccipy/metric.py b/src/riccipy/metric.py index 904bae6..2c82cb9 100644 --- a/src/riccipy/metric.py +++ b/src/riccipy/metric.py @@ -256,3 +256,12 @@ def signature(self): sig = sign * ones(1, self.dim) sig[0] *= -1 return tuple(sig) + +def load_metric(symbol, name): + import os + from sympy import diag, symbols, sin, sinh, cos, cosh, exp + base = os.path.join(os.path.dirname(__file__), './metrics/') + variables = dict(globals(), **locals()) + with open(os.path.join(base, name + '.py'), 'r') as file: + exec(file.read(), variables) + return SpacetimeMetric(symbol, variables['_coords'], variables['_metric'], timelike=False) From e15b2fa026c78e61ee17260b805124974a31e29a Mon Sep 17 00:00:00 2001 From: cjayross Date: Sun, 7 Jul 2019 03:11:20 -0500 Subject: [PATCH 23/34] added imports to metric scripts --- src/riccipy/metric.py | 14 +++---- src/riccipy/metrics/anti_de_sitter_1.py | 17 +++++--- src/riccipy/metrics/anti_de_sitter_2.py | 13 +++--- src/riccipy/metrics/bayin.py | 26 +++++++----- .../metrics/beckers_sinzinkayo_demaret_1.py | 16 ++++---- .../metrics/beckers_sinzinkayo_demaret_2.py | 16 ++++---- src/riccipy/metrics/bertotti_robinson_1.py | 12 +++--- src/riccipy/metrics/bertotti_robinson_2.py | 14 ++++--- src/riccipy/metrics/bertotti_robinson_3.py | 14 ++++--- src/riccipy/metrics/bertotti_robinson_4.py | 14 ++++--- src/riccipy/metrics/bianchi_1.py | 14 ++++--- src/riccipy/metrics/bianchi_2.py | 14 ++++--- src/riccipy/metrics/bondi_1.py | 16 ++++---- src/riccipy/metrics/bondi_2.py | 16 ++++---- src/riccipy/metrics/bondi_3.py | 31 +++++++++----- src/riccipy/metrics/boost_1.py | 14 ++++--- src/riccipy/metrics/boost_2.py | 14 ++++--- src/riccipy/metrics/boost_3.py | 14 ++++--- src/riccipy/metrics/buchdahl_land.py | 17 +++++--- src/riccipy/metrics/cmetric.py | 19 ++++++--- .../metrics/cross_const_curvature_1.py | 14 ++++--- .../metrics/cross_const_curvature_2.py | 14 ++++--- .../metrics/cross_const_curvature_3.py | 14 ++++--- .../metrics/cross_const_curvature_4.py | 14 ++++--- src/riccipy/metrics/datta_1.py | 14 ++++--- src/riccipy/metrics/datta_2.py | 20 +++++---- src/riccipy/metrics/davidson.py | 19 ++++++--- src/riccipy/metrics/de_sitter_1.py | 16 ++++---- src/riccipy/metrics/de_sitter_2.py | 16 ++++---- src/riccipy/metrics/de_sitter_3.py | 20 +++++---- src/riccipy/metrics/domain_wall.py | 18 ++++---- src/riccipy/metrics/dunn_tupper.py | 17 +++++--- src/riccipy/metrics/durgapal_1.py | 27 +++++++----- src/riccipy/metrics/durgapal_2.py | 30 +++++++++----- src/riccipy/metrics/durgapal_3.py | 26 +++++++----- src/riccipy/metrics/durgapal_fuloria.py | 21 ++++++---- src/riccipy/metrics/einstein_1.py | 16 ++++---- src/riccipy/metrics/einstein_2.py | 14 ++++--- src/riccipy/metrics/einstein_3.py | 14 ++++--- src/riccipy/metrics/einstein_maxwell_1.py | 18 ++++---- src/riccipy/metrics/einstein_maxwell_2.py | 18 ++++---- src/riccipy/metrics/einstein_maxwell_3.py | 19 +++++---- src/riccipy/metrics/ellis_maccallum_1.py | 12 +++--- src/riccipy/metrics/ellis_maccallum_2.py | 19 ++++++--- src/riccipy/metrics/faulkes.py | 20 +++++---- src/riccipy/metrics/godel.py | 16 ++++---- src/riccipy/metrics/godfrey.py | 16 ++++---- src/riccipy/metrics/harrison_1.py | 24 ++++++----- src/riccipy/metrics/harrison_2.py | 17 +++++--- src/riccipy/metrics/harrison_3.py | 17 +++++--- src/riccipy/metrics/harrison_4.py | 17 +++++--- src/riccipy/metrics/harrison_5.py | 17 +++++--- src/riccipy/metrics/harrison_6.py | 17 +++++--- src/riccipy/metrics/harrison_7.py | 17 +++++--- src/riccipy/metrics/harrison_8.py | 17 +++++--- src/riccipy/metrics/heintzmann.py | 16 +++++--- src/riccipy/metrics/kasner_1.py | 12 +++--- src/riccipy/metrics/kasner_2.py | 12 +++--- src/riccipy/metrics/kerr_1.py | 37 +++++++++++------ src/riccipy/metrics/kerr_2.py | 37 +++++++++++------ src/riccipy/metrics/kerr_3.py | 39 ++++++++++++------ src/riccipy/metrics/kerr_newman_1.py | 39 ++++++++++++------ src/riccipy/metrics/kerr_newman_2.py | 41 +++++++++++++------ src/riccipy/metrics/klein.py | 16 ++++---- src/riccipy/metrics/kottler.py | 16 ++++---- src/riccipy/metrics/koutras_mcintosh.py | 26 ++++++------ src/riccipy/metrics/kowalczynski_plebanski.py | 20 +++++---- src/riccipy/metrics/levi_civita_1.py | 14 ++++--- src/riccipy/metrics/levi_civita_2.py | 14 ++++--- src/riccipy/metrics/levi_civita_3.py | 12 +++--- src/riccipy/metrics/levi_civita_4.py | 14 ++++--- src/riccipy/metrics/levi_civita_5.py | 14 ++++--- src/riccipy/metrics/levi_civita_6.py | 12 +++--- src/riccipy/metrics/levi_civita_7.py | 12 +++--- src/riccipy/metrics/levi_civita_8.py | 19 ++++++--- src/riccipy/metrics/lewis_papapetrou.py | 24 ++++++----- src/riccipy/metrics/lrs.py | 14 ++++--- .../metrics/mclenaghan_tariq_tupper.py | 14 ++++--- src/riccipy/metrics/mcvittie.py | 14 ++++--- src/riccipy/metrics/melvin.py | 16 ++++---- src/riccipy/metrics/minkowski_1.py | 10 +++-- src/riccipy/metrics/minkowski_2.py | 12 +++--- src/riccipy/metrics/minkowski_3.py | 20 +++++---- src/riccipy/metrics/nariai.py | 20 +++++---- src/riccipy/metrics/novotny_horsky.py | 19 ++++++--- src/riccipy/metrics/pant_sah.py | 14 ++++--- src/riccipy/metrics/plane_symmetric.py | 14 ++++--- src/riccipy/metrics/reissner_nordstrom_1.py | 16 ++++---- src/riccipy/metrics/reissner_nordstrom_2.py | 16 ++++---- src/riccipy/metrics/robertson_walker_1.py | 16 +++++--- src/riccipy/metrics/robertson_walker_2.py | 14 ++++--- src/riccipy/metrics/robertson_walker_3.py | 16 ++++---- src/riccipy/metrics/schwarzschild_1.py | 14 ++++--- src/riccipy/metrics/schwarzschild_2.py | 16 ++++---- src/riccipy/metrics/schwarzschild_3.py | 16 ++++---- src/riccipy/metrics/schwarzschild_4.py | 21 ++++++---- src/riccipy/metrics/schwarzschild_5.py | 23 +++++++---- src/riccipy/metrics/schwarzschild_6.py | 20 +++++---- src/riccipy/metrics/schwarzschild_7.py | 21 ++++++---- src/riccipy/metrics/schwarzschild_8.py | 19 ++++++--- src/riccipy/metrics/static_spherical_1.py | 14 ++++--- src/riccipy/metrics/static_spherical_2.py | 19 ++++++--- src/riccipy/metrics/szekeres_1.py | 14 ++++--- src/riccipy/metrics/szekeres_2.py | 17 +++++--- src/riccipy/metrics/tariq_tupper.py | 12 +++--- src/riccipy/metrics/taub_1.py | 14 ++++--- src/riccipy/metrics/taub_2.py | 12 +++--- src/riccipy/metrics/tolman_1.py | 19 ++++++--- src/riccipy/metrics/tolman_2.py | 19 ++++++--- src/riccipy/metrics/tolman_3.py | 22 ++++++---- src/riccipy/metrics/vaidya_1.py | 16 ++++---- src/riccipy/metrics/vaidya_2.py | 16 ++++---- src/riccipy/metrics/vaidya_3.py | 18 ++++---- src/riccipy/metrics/vaidya_4.py | 18 ++++---- src/riccipy/tests/test_metric.py | 3 +- src/riccipy/tests/test_partial.py | 3 +- src/riccipy/tests/test_tensor.py | 5 +-- 117 files changed, 1242 insertions(+), 790 deletions(-) diff --git a/src/riccipy/metric.py b/src/riccipy/metric.py index 2c82cb9..1cf68ba 100644 --- a/src/riccipy/metric.py +++ b/src/riccipy/metric.py @@ -1,4 +1,5 @@ from collections import namedtuple +from pathlib import Path from sympy import Array, Pow, Rational, S, ones, tensorproduct, zeros from sympy.tensor.tensor import TensorIndexType @@ -257,11 +258,10 @@ def signature(self): sig[0] *= -1 return tuple(sig) + def load_metric(symbol, name): - import os - from sympy import diag, symbols, sin, sinh, cos, cosh, exp - base = os.path.join(os.path.dirname(__file__), './metrics/') - variables = dict(globals(), **locals()) - with open(os.path.join(base, name + '.py'), 'r') as file: - exec(file.read(), variables) - return SpacetimeMetric(symbol, variables['_coords'], variables['_metric'], timelike=False) + base = Path(__file__).parent + var = dict(globals(), **locals()) + with open(base / "metrics" / (name + ".py"), "r") as file: + exec(file.read(), var) + return SpacetimeMetric(symbol, var["coords"], var["metric"], timelike=False) diff --git a/src/riccipy/metrics/anti_de_sitter_1.py b/src/riccipy/metrics/anti_de_sitter_1.py index 98052a5..db0d352 100644 --- a/src/riccipy/metrics/anti_de_sitter_1.py +++ b/src/riccipy/metrics/anti_de_sitter_1.py @@ -1,7 +1,14 @@ # anti-de Sitter space -_coords = symbols('t chi theta phi', real=True) -_vars = () -_funs = () -t, ch, th, ph = _coords -_metric = diag(-1, cos(t)**2, cos(t)**2*sinh(ch)**2, cos(t)**2*sinh(ch)**2*sin(th)**2) +from sympy import cos, diag, sin, sinh, symbols + +coords = symbols("t chi theta phi", real=True) +variables = () +functions = () +t, ch, th, ph = coords +metric = diag( + -1, + cos(t) ** 2, + cos(t) ** 2 * sinh(ch) ** 2, + cos(t) ** 2 * sinh(ch) ** 2 * sin(th) ** 2, +) del t, ch, th, ph diff --git a/src/riccipy/metrics/anti_de_sitter_2.py b/src/riccipy/metrics/anti_de_sitter_2.py index b5133fc..1640dd5 100644 --- a/src/riccipy/metrics/anti_de_sitter_2.py +++ b/src/riccipy/metrics/anti_de_sitter_2.py @@ -1,6 +1,9 @@ # Static form of anti-de Sitter space -_coords = symbols('t r theta phi', real=True) -_vars = () -_funs = () -t, r, th, ph = _coords -_metric = diag(-cosh(r)**2, 1, sinh(r)**2, sinh(r)**2*sin(th)**2) +from sympy import cosh, diag, sin, sinh, symbols + +coords = symbols("t r theta phi", real=True) +variables = () +functions = () +t, r, th, ph = coords +metric = diag(-cosh(r) ** 2, 1, sinh(r) ** 2, sinh(r) ** 2 * sin(th) ** 2) +del t, r, th, ph diff --git a/src/riccipy/metrics/bayin.py b/src/riccipy/metrics/bayin.py index ede90b8..e012cb3 100644 --- a/src/riccipy/metrics/bayin.py +++ b/src/riccipy/metrics/bayin.py @@ -1,12 +1,16 @@ # Bayin's spherically symmetric static perfect fluid solution II -_coords = symbols('t r theta phi', real=True) -_vars = symbols('w_0 C_0 C_1', constant=True) -_funs = () -t, r, th, ph = _coords -w_0, C_0, C_1 = _vars -_metric = zeros(4) -_metric[0,0] = -C_0**2*exp(-asin((-2*r**2 + C_1)/(C_1**2 + 4*w_0**2)**(Rational(1,2)))) -_metric[1,1] = w_0**2/(-r**4 + C_1*r**2 + w_0**2) -_metric[2,2] = r**2 -_metric[3,3] = r**2*sin(th)**2 -del t, r, th, ph, w_0, C_0, C_1 +from sympy import Rational, asin, sin, symbols, zeros + +coords = symbols("t r theta phi", real=True) +variables = symbols("w_0 C_0 C_1", constant=True) +functions = () +t, r, th, ph = coords +w0, C0, C1 = variables +metric = zeros(4) +metric[0, 0] = -C0 ** 2 * exp( + -asin((-2 * r ** 2 + C1) / (C1 ** 2 + 4 * w0 ** 2) ** (Rational(1, 2))) +) +metric[1, 1] = w0 ** 2 / (-r ** 4 + C1 * r ** 2 + w0 ** 2) +metric[2, 2] = r ** 2 +metric[3, 3] = r ** 2 * sin(th) ** 2 +del t, r, th, ph, w0, C0, C1 diff --git a/src/riccipy/metrics/beckers_sinzinkayo_demaret_1.py b/src/riccipy/metrics/beckers_sinzinkayo_demaret_1.py index 0b48ba7..d5ed549 100644 --- a/src/riccipy/metrics/beckers_sinzinkayo_demaret_1.py +++ b/src/riccipy/metrics/beckers_sinzinkayo_demaret_1.py @@ -1,9 +1,11 @@ # Beckers, Sinzinkayo, and Demaret solution -_coords = symbols('t x y z', real=True) -_vars = symbols('k d m', constant=True) -_funs = () -t, x, y, z = _coords -k, d, m = _vars -expr = (k*x+d)**(2*m) -_metric = diag(-expr, expr, expr, expr) +from sympy import diag, symbols + +coords = symbols("t x y z", real=True) +variables = symbols("k d m", constant=True) +functions = () +t, x, y, z = coords +k, d, m = variables +expr = (k * x + d) ** (2 * m) +metric = diag(-expr, expr, expr, expr) del expr, t, x, y, z, k, d, m diff --git a/src/riccipy/metrics/beckers_sinzinkayo_demaret_2.py b/src/riccipy/metrics/beckers_sinzinkayo_demaret_2.py index 7cc3e2a..74ac55c 100644 --- a/src/riccipy/metrics/beckers_sinzinkayo_demaret_2.py +++ b/src/riccipy/metrics/beckers_sinzinkayo_demaret_2.py @@ -1,9 +1,11 @@ # Beckers, Sinzinkayo, and Demaret solution -_coords = symbols('t x y z', real=True) -_vars = symbols('m', constant=True) -_funs = () -t, x, y, z = _coords -m = _vars -expr = x**(2*m) -_metric = diag(-expr, expr, expr, expr) +from sympy import diag, symbols + +coords = symbols("t x y z", real=True) +variables = symbols("m", constant=True) +functions = () +t, x, y, z = coords +m = variables +expr = x ** (2 * m) +metric = diag(-expr, expr, expr, expr) del expr, t, x, y, z, m diff --git a/src/riccipy/metrics/bertotti_robinson_1.py b/src/riccipy/metrics/bertotti_robinson_1.py index a086677..011c9a9 100644 --- a/src/riccipy/metrics/bertotti_robinson_1.py +++ b/src/riccipy/metrics/bertotti_robinson_1.py @@ -1,7 +1,9 @@ # The Bertotti-Robinson solution -_coords = symbols('t x y z') -_vars = () -_funs = () -t, x, y, z = _coords -_metric = diag(-(1+z**2), 1-y**2, 1/(1-y**2), 1/(1+z**2)) +from sympy import diag, symbols + +coords = symbols("t x y z", real=True) +variables = () +functions = () +t, x, y, z = coords +metric = diag(-(1 + z ** 2), 1 - y ** 2, 1 / (1 - y ** 2), 1 / (1 + z ** 2)) del t, x, y, z diff --git a/src/riccipy/metrics/bertotti_robinson_2.py b/src/riccipy/metrics/bertotti_robinson_2.py index ea4b0da..48f3d8b 100644 --- a/src/riccipy/metrics/bertotti_robinson_2.py +++ b/src/riccipy/metrics/bertotti_robinson_2.py @@ -1,8 +1,10 @@ # The Bertotti-Robinson solution -_coords = symbols('t r theta phi', real=True) -_vars = symbols('q', constant=True) -_funs = () -t, r, th, ph = _coords -q = _vars -_metric = diag(-q**2/r**2, q**2/r**2, q**2, q**2*sin(th)**2) +from sympy import diag, symbols + +coords = symbols("t r theta phi", real=True) +variables = symbols("q", constant=True) +functions = () +t, r, th, ph = coords +q = variables +metric = diag(-q ** 2 / r ** 2, q ** 2 / r ** 2, q ** 2, q ** 2 * sin(th) ** 2) del t, r, th, ph, q diff --git a/src/riccipy/metrics/bertotti_robinson_3.py b/src/riccipy/metrics/bertotti_robinson_3.py index 09893e2..bdfd6f4 100644 --- a/src/riccipy/metrics/bertotti_robinson_3.py +++ b/src/riccipy/metrics/bertotti_robinson_3.py @@ -1,8 +1,10 @@ # The Bertotti-Robinson solution -_coords = symbols('t x theta phi', real=True) -_vars = symbols('k', constant=True) -_funs = () -t, x, th, ph = _coords -k = _vars -_metric = diag(-k**2*sinh(x)**2, k**2, k**2, k**2*sin(th)**2) +from sympy import diag, sin, sinh, symbols + +coords = symbols("t x theta phi", real=True) +variables = symbols("k", constant=True) +functions = () +t, x, th, ph = coords +k = variables +metric = diag(-k ** 2 * sinh(x) ** 2, k ** 2, k ** 2, k ** 2 * sin(th) ** 2) del t, x, th, ph, k diff --git a/src/riccipy/metrics/bertotti_robinson_4.py b/src/riccipy/metrics/bertotti_robinson_4.py index e983bf9..fc9665d 100644 --- a/src/riccipy/metrics/bertotti_robinson_4.py +++ b/src/riccipy/metrics/bertotti_robinson_4.py @@ -1,8 +1,10 @@ # The Bertotti-Robinson solution -_coords = symbols('t z x y', real=True) -_vars = symbols('omega', constant=True) -_funs = () -t, x, y, z = _coords -om = _vars -_metric = diag(-1, 1, cos(om*x)**2, cos(om*t)**2) +from sympy import cos, diag, symbols + +coords = symbols("t z x y", real=True) +variables = symbols("omega", constant=True) +functions = () +t, x, y, z = coords +om = variables +metric = diag(-1, 1, cos(om * x) ** 2, cos(om * t) ** 2) del t, x, y, z, om diff --git a/src/riccipy/metrics/bianchi_1.py b/src/riccipy/metrics/bianchi_1.py index 77da0ed..d5a8079 100644 --- a/src/riccipy/metrics/bianchi_1.py +++ b/src/riccipy/metrics/bianchi_1.py @@ -1,8 +1,10 @@ # General metric from Bianchi II automorphisms -_coords = symbols('t x y z', real=True) -_vars = () -_funs = symbols('alpha', cls=Function) -t, x, y, z = _coords -al = _funs -_metric = diag(1, exp(-2*al(t)), exp(al(t)), exp(al(t))) +from sympy import Function, diag, exp, symbols + +coords = symbols("t x y z", real=True) +variables = () +functions = symbols("alpha", cls=Function) +t, x, y, z = coords +al = functions +metric = diag(1, exp(-2 * al(t)), exp(al(t)), exp(al(t))) del t, x, y, z, al diff --git a/src/riccipy/metrics/bianchi_2.py b/src/riccipy/metrics/bianchi_2.py index 10b2067..648a32d 100644 --- a/src/riccipy/metrics/bianchi_2.py +++ b/src/riccipy/metrics/bianchi_2.py @@ -1,8 +1,10 @@ # General metric from Bianchi IV automorphisms -_coords = symbols('t x y z', real=True) -_vars = () -_funs = symbols('alpha beta gamma', cls=Function) -t, x, y, z = _coords -al, be, ga = _funs -_metric = diag(1, exp(al(t)), exp(be(t)), exp(ga(t))) +from sympy import Function, diag, exp, symbols + +coords = symbols("t x y z", real=True) +variables = () +functions = symbols("alpha beta gamma", cls=Function) +t, x, y, z = coords +al, be, ga = functions +metric = diag(1, exp(al(t)), exp(be(t)), exp(ga(t))) del t, x, y, z, al, be, ga diff --git a/src/riccipy/metrics/bondi_1.py b/src/riccipy/metrics/bondi_1.py index 9980662..5529606 100644 --- a/src/riccipy/metrics/bondi_1.py +++ b/src/riccipy/metrics/bondi_1.py @@ -1,9 +1,11 @@ # Spherical Bondi metric in advanced (ingoing) coordinates -_coords = symbols('r v theta phi', real=True) -_vars = () -_funs = symbols('C M', cls=Function) -r, v, th, ph = _coords -C, M = _funs -_metric = diag(0,-C(r,v)**2*(1-2*M(r,v)/r),r**2,r**2*sin(th)**2) -_metric[0,1] = _metric[1,0] = C(r,v) +from sympy import Function, diag, sin, symbols + +coords = symbols("r v theta phi", real=True) +variables = () +functions = symbols("C M", cls=Function) +r, v, th, ph = coords +C, M = functions +metric = diag(0, -C(r, v) ** 2 * (1 - 2 * M(r, v) / r), r ** 2, r ** 2 * sin(th) ** 2) +metric[0, 1] = metric[1, 0] = C(r, v) del r, v, th, ph, C, M diff --git a/src/riccipy/metrics/bondi_2.py b/src/riccipy/metrics/bondi_2.py index 276704f..b4dde00 100644 --- a/src/riccipy/metrics/bondi_2.py +++ b/src/riccipy/metrics/bondi_2.py @@ -1,9 +1,11 @@ # Spherical Bondi metric in advanced (ingoing) coordinates -_coords = symbols('r v theta phi', real=True) -_vars = () -_funs = symbols('C M', cls=Function) -r, v, th, ph = _coords -C, M = _funs -_metric = diag(0,-C(t,v)**2*(1-2*M(t,v)/t),t**2,t**2*sin(th)**2) -_metric[0,1] = _metric[1,0] = -C(r,v) +from sympy import Function, diag, sin, symbols + +coords = symbols("r v theta phi", real=True) +variables = () +functions = symbols("C M", cls=Function) +r, v, th, ph = coords +C, M = functions +metric = diag(0, -C(t, v) ** 2 * (1 - 2 * M(t, v) / t), t ** 2, t ** 2 * sin(th) ** 2) +metric[0, 1] = metric[1, 0] = -C(r, v) del r, v, th, ph, C, M diff --git a/src/riccipy/metrics/bondi_3.py b/src/riccipy/metrics/bondi_3.py index a95b555..f217cf1 100644 --- a/src/riccipy/metrics/bondi_3.py +++ b/src/riccipy/metrics/bondi_3.py @@ -1,13 +1,22 @@ # The Bondi metric -_coords = symbols('r u theta phi', real=True) -_vars = () -_funs = symbols('Q U V gamma', cls=Function) -r, u, th, ph = _coords -Q, U, V, ga = _funs -_metric = zeros(4) -_metric[1,1] = -exp(2*Q(r,u,th)+2*ga(r,u,th))*(V(r,u,th)*exp(-2*ga(r,u,th))-exp(-2*Q(r,u,th))*U(r,u,th)**2*r**3)/r -_metric[2,2] = r**2*exp(2*ga(r,u,th)) -_metric[3,3] = r**2*exp(-2*ga(r,u,th))*sin(th)**2 -_metric[0,1] = _metric[1,0] = -exp(2*Q(r,u,th)) -_metric[1,2] = _metric[2,1] = -U(r,u,th)*r**2*exp(2*ga(r,u,th)) +from sympy import Function, exp, sin, symbols, zeros + +coords = symbols("r u theta phi", real=True) +variables = () +functions = symbols("Q U V gamma", cls=Function) +r, u, th, ph = coords +Q, U, V, ga = functions +metric = zeros(4) +metric[1, 1] = ( + -exp(2 * Q(r, u, th) + 2 * ga(r, u, th)) + * ( + V(r, u, th) * exp(-2 * ga(r, u, th)) + - exp(-2 * Q(r, u, th)) * U(r, u, th) ** 2 * r ** 3 + ) + / r +) +metric[2, 2] = r ** 2 * exp(2 * ga(r, u, th)) +metric[3, 3] = r ** 2 * exp(-2 * ga(r, u, th)) * sin(th) ** 2 +metric[0, 1] = metric[1, 0] = -exp(2 * Q(r, u, th)) +metric[1, 2] = metric[2, 1] = -U(r, u, th) * r ** 2 * exp(2 * ga(r, u, th)) del r, u, th, ph, Q, U, V, ga diff --git a/src/riccipy/metrics/boost_1.py b/src/riccipy/metrics/boost_1.py index 9265f89..c38fee1 100644 --- a/src/riccipy/metrics/boost_1.py +++ b/src/riccipy/metrics/boost_1.py @@ -1,8 +1,10 @@ # Metric with G4 on T3 and boost isotropy (flat case, k=0) -_coords = symbols('t x y w', real=True) -_vars = () -_funs = symbols('alpha beta', cls=Function) -t, x, y, w = _coords -al, be = _funs -_metric = diag(-be(w)**2*y**2, al(w)**2, be(w)**2, 1) +from sympy import Function, diag, symbols + +coords = symbols("t x y w", real=True) +variables = () +functions = symbols("alpha beta", cls=Function) +t, x, y, w = coords +al, be = functions +metric = diag(-be(w) ** 2 * y ** 2, al(w) ** 2, be(w) ** 2, 1) del t, x, y, w, al, be diff --git a/src/riccipy/metrics/boost_2.py b/src/riccipy/metrics/boost_2.py index 4e9698d..ae71ad0 100644 --- a/src/riccipy/metrics/boost_2.py +++ b/src/riccipy/metrics/boost_2.py @@ -1,8 +1,10 @@ # Metric with G4 on T3 and boost isotropy (flat case k=1) -_coords = symbols('t x y w', real=True) -_vars = () -_funs = symbols('alpha beta', cls=Function) -t, x, y, w = _coords -al, be = _funs -_metric = diag(-be(w)**2*sinh(y)**2, al(w)**2, be(w)**2, 1) +from sympy import Function, diag, symbols + +coords = symbols("t x y w", real=True) +variables = () +functions = symbols("alpha beta", cls=Function) +t, x, y, w = coords +al, be = functions +metric = diag(-be(w) ** 2 * sinh(y) ** 2, al(w) ** 2, be(w) ** 2, 1) del t, x, y, w, al, be diff --git a/src/riccipy/metrics/boost_3.py b/src/riccipy/metrics/boost_3.py index 6292927..107818d 100644 --- a/src/riccipy/metrics/boost_3.py +++ b/src/riccipy/metrics/boost_3.py @@ -1,8 +1,10 @@ # Metric with G4 on T3 and boost isotropy (flat case k=1) -_coords = symbols('t x y w', real=True) -_vars = () -_funs = symbols('alpha beta', cls=Function) -t, x, y, w = _coords -al, be = _funs -_metric = diag(-be(w)**2*sin(y)**2, al(w)**2, be(w)**2, 1) +from sympy import Function, diag, symbols + +coords = symbols("t x y w", real=True) +variables = () +functions = symbols("alpha beta", cls=Function) +t, x, y, w = coords +al, be = functions +metric = diag(-be(w) ** 2 * sin(y) ** 2, al(w) ** 2, be(w) ** 2, 1) del t, x, y, w, al, be diff --git a/src/riccipy/metrics/buchdahl_land.py b/src/riccipy/metrics/buchdahl_land.py index cae207d..0a5e6c9 100644 --- a/src/riccipy/metrics/buchdahl_land.py +++ b/src/riccipy/metrics/buchdahl_land.py @@ -1,7 +1,14 @@ # Buchdahl and Land's static spherically symmetric stiff perfect fluid with rhob=2 -_coords = symbols('t r theta phi', real=True) -_vars = () -_funs = () -t, r, th, ph = _coords -_metric = diag(-Rational(2,3)*r**2, 1/(Rational(1,2)-r**2/3), r**2, r**2*sin(th)**2) +from sympy import Rational, diag, sin, symbols + +coords = symbols("t r theta phi", real=True) +variables = () +functions = () +t, r, th, ph = coords +metric = diag( + -Rational(2, 3) * r ** 2, + 1 / (Rational(1, 2) - r ** 2 / 3), + r ** 2, + r ** 2 * sin(th) ** 2, +) del t, r, th, ph diff --git a/src/riccipy/metrics/cmetric.py b/src/riccipy/metrics/cmetric.py index 9a1b3f1..70a0540 100644 --- a/src/riccipy/metrics/cmetric.py +++ b/src/riccipy/metrics/cmetric.py @@ -1,8 +1,15 @@ # The C-metric -_coords = symbols('t x y phi', real=True) -_vars = () -_funs = symbols('f h', cls=Function) -t, x, y, ph = _coords -f, h = _funs -_metric = diag(-h(y)/(x+y)**2, 1/((x+y)**2*f(x)), 1/((x+y)**2*h(y)), f(x)/(x+y)**2) +from sympy import Function, diag, symbols + +coords = symbols("t x y phi", real=True) +variables = () +functions = symbols("f h", cls=Function) +t, x, y, ph = coords +f, h = functions +metric = diag( + -h(y) / (x + y) ** 2, + 1 / ((x + y) ** 2 * f(x)), + 1 / ((x + y) ** 2 * h(y)), + f(x) / (x + y) ** 2, +) del t, x, y, ph, f, h diff --git a/src/riccipy/metrics/cross_const_curvature_1.py b/src/riccipy/metrics/cross_const_curvature_1.py index b3c6a1f..15b2322 100644 --- a/src/riccipy/metrics/cross_const_curvature_1.py +++ b/src/riccipy/metrics/cross_const_curvature_1.py @@ -1,8 +1,10 @@ # Cross product of two 2-dimensional subspaces of constant curvature -_coords = symbols('t x y z', real=True) -_vars = symbols('A B', constant=True) -_funs = () -t, x, y, z = _coords -A, B = _vars -_metric = diag(-B**2*sin(z)**2, A**2, A**2*sin(x)**2, B**2) +from sympy import diag, sin, symbols + +coords = symbols("t x y z", real=True) +variables = symbols("A B", constant=True) +functions = () +t, x, y, z = coords +A, B = variables +metric = diag(-B ** 2 * sin(z) ** 2, A ** 2, A ** 2 * sin(x) ** 2, B ** 2) del t, x, y, z, A, B diff --git a/src/riccipy/metrics/cross_const_curvature_2.py b/src/riccipy/metrics/cross_const_curvature_2.py index 7cfa1b9..7e4ab02 100644 --- a/src/riccipy/metrics/cross_const_curvature_2.py +++ b/src/riccipy/metrics/cross_const_curvature_2.py @@ -1,8 +1,10 @@ # Cross product of two 2-dimensional subspaces of constant curvature -_coords = symbols('t x y z', real=True) -_vars = symbols('A B', constant=True) -_funs = () -t, x, y, z = _coords -A, B = _vars -_metric = diag(-B**2*sin(z)**2, A**2, A**2*sinh(x)**2, B**2) +from sympy import diag, sin, sinh, symbols + +coords = symbols("t x y z", real=True) +variables = symbols("A B", constant=True) +functions = () +t, x, y, z = coords +A, B = variables +metric = diag(-B ** 2 * sin(z) ** 2, A ** 2, A ** 2 * sinh(x) ** 2, B ** 2) del t, x, y, z, A, B diff --git a/src/riccipy/metrics/cross_const_curvature_3.py b/src/riccipy/metrics/cross_const_curvature_3.py index 447ce8c..2140fd6 100644 --- a/src/riccipy/metrics/cross_const_curvature_3.py +++ b/src/riccipy/metrics/cross_const_curvature_3.py @@ -1,8 +1,10 @@ # Cross product of two 2-dimensional subspaces of constant curvature -_coords = symbols('t x y z', real=True) -_vars = symbols('A B', constant=True) -_funs = () -t, x, y, z = _coords -A, B = _vars -_metric = diag(-B**2*sinh(z)**2, A**2, A**2*sin(x)**2, B**2) +from sympy import diag, sin, sinh, symbols + +coords = symbols("t x y z", real=True) +variables = symbols("A B", constant=True) +functions = () +t, x, y, z = coords +A, B = variables +metric = diag(-B ** 2 * sinh(z) ** 2, A ** 2, A ** 2 * sin(x) ** 2, B ** 2) del t, x, y, z, A, B diff --git a/src/riccipy/metrics/cross_const_curvature_4.py b/src/riccipy/metrics/cross_const_curvature_4.py index b275adc..a26c769 100644 --- a/src/riccipy/metrics/cross_const_curvature_4.py +++ b/src/riccipy/metrics/cross_const_curvature_4.py @@ -1,8 +1,10 @@ # Cross product of two 2-dimensional subspaces of constant curvature -_coords = symbols('t x y z', real=True) -_vars = symbols('A B', constant=True) -_funs = () -t, x, y, z = _coords -A, B = _vars -_metric = diag(-B**2*sinh(z)**2, A**2, A**2*sinh(x)**2, B**2) +from sympy import diag, sinh, symbols + +coords = symbols("t x y z", real=True) +variables = symbols("A B", constant=True) +functions = () +t, x, y, z = coords +A, B = variables +metric = diag(-B ** 2 * sinh(z) ** 2, A ** 2, A ** 2 * sinh(x) ** 2, B ** 2) del t, x, y, z, A, B diff --git a/src/riccipy/metrics/datta_1.py b/src/riccipy/metrics/datta_1.py index c7d254a..1a09808 100644 --- a/src/riccipy/metrics/datta_1.py +++ b/src/riccipy/metrics/datta_1.py @@ -1,8 +1,10 @@ # Datta's Einstein-Maxwell solution -_coords = symbols('t x y z', real=True) -_vars = symbols('a b', constant=True) -_funs = () -t, x, y, z = _coords -a, b = _vars -_metric = diag(-1/(b/t - a/t**2), b/t - a/t**2, t**2, t**2) +from sympy import diag, symbols + +coords = symbols("t x y z", real=True) +variables = symbols("a b", constant=True) +functions = () +t, x, y, z = coords +a, b = variables +metric = diag(-1 / (b / t - a / t ** 2), b / t - a / t ** 2, t ** 2, t ** 2) del t, x, y, z, a, b diff --git a/src/riccipy/metrics/datta_2.py b/src/riccipy/metrics/datta_2.py index 08cf900..d55a464 100644 --- a/src/riccipy/metrics/datta_2.py +++ b/src/riccipy/metrics/datta_2.py @@ -1,9 +1,13 @@ # Datta's Einstein-Maxwell solution -_coords = symbols('t x y z', real=True) -_vars = symbols('C_1 C_2 mu', constant=True) -_funs = () -t, x, y, z = _coords -C_1, C_2, mu = _vars -expr = (C_1*t**mu + C_2/t**mu)**2 -_metric = diag(-expr*t**(2*mu**2), 1/expr, expr*t**(2*mu**2), t**2*expr) -del expr, t, x, y, z, C_1, C_2, mu +from sympy import diag, symbols + +coords = symbols("t x y z", real=True) +variables = symbols("C_1 C_2 mu", constant=True) +functions = () +t, x, y, z = coords +C1, C2, mu = variables +expr = (C1 * t ** mu + C2 / t ** mu) ** 2 +metric = diag( + -expr * t ** (2 * mu ** 2), 1 / expr, expr * t ** (2 * mu ** 2), t ** 2 * expr +) +del expr, t, x, y, z, C1, C2, mu diff --git a/src/riccipy/metrics/davidson.py b/src/riccipy/metrics/davidson.py index c4d5bbf..9cbee21 100644 --- a/src/riccipy/metrics/davidson.py +++ b/src/riccipy/metrics/davidson.py @@ -1,8 +1,15 @@ # Davidson's cylindrically symmetric radiation perfect fluid universe -_coords = symbols('t r z phi', real=True) -_vars = () -_funs = () -t, r, z, phi = _coords -expr = (1+r**2)**Rational(2,5) -_metric = diag(-expr**3, t**Rational(4,3)*expr, t**Rational(-2,3)/expr, t**Rational(4,3)*r**2/expr) +from sympy import Rational, diag, symbols + +coords = symbols("t r z phi", real=True) +variables = () +functions = () +t, r, z, phi = coords +expr = (1 + r ** 2) ** Rational(2, 5) +metric = diag( + -expr ** 3, + t ** Rational(4, 3) * expr, + t ** Rational(-2, 3) / expr, + t ** Rational(4, 3) * r ** 2 / expr, +) del expr, t, r, z, phi diff --git a/src/riccipy/metrics/de_sitter_1.py b/src/riccipy/metrics/de_sitter_1.py index 69f57cc..4c1aa55 100644 --- a/src/riccipy/metrics/de_sitter_1.py +++ b/src/riccipy/metrics/de_sitter_1.py @@ -1,9 +1,11 @@ # de Sitter space -_coords = symbols('t chi theta phi', real=True) -_vars = (symbols('alpha', constant=True),) -_funs = () -t, ch, th, ph = _coords -al = _vars -expr = al**2*cosh(t/al)**2 -_metric = diag(-1, expr, expr*sin(ch)**2, expr*sin(ch)**2*sin(th)**2) +from sympy import diag, sin, symbols + +coords = symbols("t chi theta phi", real=True) +variables = symbols("alpha", constant=True) +functions = () +t, ch, th, ph = coords +al = variables +expr = al ** 2 * cosh(t / al) ** 2 +metric = diag(-1, expr, expr * sin(ch) ** 2, expr * sin(ch) ** 2 * sin(th) ** 2) del expr, t, ch, th, ph diff --git a/src/riccipy/metrics/de_sitter_2.py b/src/riccipy/metrics/de_sitter_2.py index e422303..2660073 100644 --- a/src/riccipy/metrics/de_sitter_2.py +++ b/src/riccipy/metrics/de_sitter_2.py @@ -1,9 +1,11 @@ # de Sitter space -_coords = symbols('t x y z', real=True) -_vars = (symbols('alpha', constant=True),) -_funs = () -t, x, y, z = _coords -al = _vars -expr = exp(2*t/al) -_metric = diag(-1, expr, expr, expr) +from sympy import diag, exp, symbols + +coords = symbols("t x y z", real=True) +variables = symbols("alpha", constant=True) +functions = () +t, x, y, z = coords +al = variables +expr = exp(2 * t / al) +metric = diag(-1, expr, expr, expr) del expr, t, x, y, z, al diff --git a/src/riccipy/metrics/de_sitter_3.py b/src/riccipy/metrics/de_sitter_3.py index 2ce8dcd..7cb58ad 100644 --- a/src/riccipy/metrics/de_sitter_3.py +++ b/src/riccipy/metrics/de_sitter_3.py @@ -1,9 +1,11 @@ -# de Sitter space -_coords = symbols('t r theta phi', real=True) -_vars = (symbols('lambda', constant=True),) -_funs = () -t, r, th, ph = _coords -la = _vars -expr = 1 - la*r**2/3 -_metric = diag(-expr, 1/expr, r**2, r**2*sin(th)**2) -del expr, t, r, th, ph, la +# de Sitter space with a non-zero cosmological constant +from sympy import diag, sin, symbols + +coords = symbols("t r theta phi", real=True) +variables = symbols("Lambda", constant=True) +functions = () +t, r, th, ph = coords +La = variables +expr = 1 - La * r ** 2 / 3 +metric = diag(-expr, 1 / expr, r ** 2, r ** 2 * sin(th) ** 2) +del expr, t, r, th, ph, La diff --git a/src/riccipy/metrics/domain_wall.py b/src/riccipy/metrics/domain_wall.py index 473d206..da20009 100644 --- a/src/riccipy/metrics/domain_wall.py +++ b/src/riccipy/metrics/domain_wall.py @@ -1,10 +1,12 @@ # Metric for spacetime with domain wall -_coords = symbols('t x y z', real=True) -_vars = (symbols('k', constant=True),) -_funs = () -t, x, y, z = _coords -k = _vars -expr1 = (1 - k*z)**2 -expr2 = exp(2*k*t) -_metric = diag(-expr1, expr1*expr2, expr1*expr2, 1) +from sympy import diag, exp, symbols + +coords = symbols("t x y z", real=True) +variables = (symbols("k", constant=True),) +functions = () +t, x, y, z = coords +k = variables +expr1 = (1 - k * z) ** 2 +expr2 = exp(2 * k * t) +metric = diag(-expr1, expr1 * expr2, expr1 * expr2, 1) del expr1, expr2, t, x, y, z, k diff --git a/src/riccipy/metrics/dunn_tupper.py b/src/riccipy/metrics/dunn_tupper.py index bdf4a28..69f5173 100644 --- a/src/riccipy/metrics/dunn_tupper.py +++ b/src/riccipy/metrics/dunn_tupper.py @@ -1,7 +1,14 @@ # Dunn and Tupper's G3VI0 perfect fluid solution -_coords = symbols('t x y z', real=True) -_vars = (symbols('b', constant=True),) -_funs = () -t, x, y, z = _coords -_metric = diag(-1, 4*t**2/(-b*(1 + b)), t**(-2*b)*exp(-4*x), t**(-2*b)*exp(4*x)) +from sympy import diag, exp, symbols + +coords = symbols("t x y z", real=True) +variables = symbols("b", constant=True) +functions = () +t, x, y, z = coords +metric = diag( + -1, + 4 * t ** 2 / (-b * (1 + b)), + t ** (-2 * b) * exp(-4 * x), + t ** (-2 * b) * exp(4 * x), +) del t, x, y, z diff --git a/src/riccipy/metrics/durgapal_1.py b/src/riccipy/metrics/durgapal_1.py index a34ce49..e471f89 100644 --- a/src/riccipy/metrics/durgapal_1.py +++ b/src/riccipy/metrics/durgapal_1.py @@ -1,12 +1,19 @@ # Durgapal's static spherically symmetric perfect fluid with n=3 -_coords = symbols('t r theta phi', real=True) -_vars = symbols('A C K', constant=True) -_funs = () -t, r, th, ph = _coords -A, C, K = _vars -_metric = zeros(4) -_metric[0,0] = -A**2*(1+C*r**2)**3 -_metric[1,1] = 2*(1+C*r**2)*sqrt(1+4*C*r**2)/((2-C*r**2)*sqrt(1+4*C*r**2)+2*K*C*r**2) -_metric[2,2] = r**2 -_metric[3,3] = r**2*sin(th)**2 +from sympy import sin, sqrt, symbols, zeros + +coords = symbols("t r theta phi", real=True) +variables = symbols("A C K", constant=True) +functions = () +t, r, th, ph = coords +A, C, K = variables +metric = zeros(4) +metric[0, 0] = -A ** 2 * (1 + C * r ** 2) ** 3 +metric[1, 1] = ( + 2 + * (1 + C * r ** 2) + * sqrt(1 + 4 * C * r ** 2) + / ((2 - C * r ** 2) * sqrt(1 + 4 * C * r ** 2) + 2 * K * C * r ** 2) +) +metric[2, 2] = r ** 2 +metric[3, 3] = r ** 2 * sin(th) ** 2 del t, r, th, ph, A, C, K diff --git a/src/riccipy/metrics/durgapal_2.py b/src/riccipy/metrics/durgapal_2.py index 233de88..af10260 100644 --- a/src/riccipy/metrics/durgapal_2.py +++ b/src/riccipy/metrics/durgapal_2.py @@ -1,12 +1,22 @@ # Durgapal's static spherically symmetric perfect fluid with n=4 -_coords = symbols('t r theta phi', real=True) -_vars = symbols('A C K', constant=True) -_funs = () -t, r, th, ph = _coords -A, C, K = _vars -_metric = zeros(4) -_metric[0,0] = -A**2*(1+C*r**2)**4 -_metric[1,1] = 7*(1+C*r**2)**2*(1+5*C*r**2)**Rational(2,5)/((7-10*C*r**2-C**2*r**4)*(1+5*C*r**2)**Rational(2,5)+7*K*C*r**2) -_metric[2,2] = r**2 -_metric[3,3] = r**2*sin(th)**2 +from sympy import Rational, sin, symbols, zeros + +coords = symbols("t r theta phi", real=True) +variables = symbols("A C K", constant=True) +functions = () +t, r, th, ph = coords +A, C, K = variables +metric = zeros(4) +metric[0, 0] = -A ** 2 * (1 + C * r ** 2) ** 4 +metric[1, 1] = ( + 7 + * (1 + C * r ** 2) ** 2 + * (1 + 5 * C * r ** 2) ** Rational(2, 5) + / ( + (7 - 10 * C * r ** 2 - C ** 2 * r ** 4) * (1 + 5 * C * r ** 2) ** Rational(2, 5) + + 7 * K * C * r ** 2 + ) +) +metric[2, 2] = r ** 2 +metric[3, 3] = r ** 2 * sin(th) ** 2 del t, r, th, ph, A, C, K diff --git a/src/riccipy/metrics/durgapal_3.py b/src/riccipy/metrics/durgapal_3.py index 06bf7e7..f0d233d 100644 --- a/src/riccipy/metrics/durgapal_3.py +++ b/src/riccipy/metrics/durgapal_3.py @@ -1,12 +1,18 @@ # Durgapal's static spherically symmetric perfect fluid with n=5 -_coords = symbols('t r theta phi', real=True) -_vars = symbols('A C K', constant=True) -_funs = () -t, r, th, ph = _coords -A, C, K = _vars -_metric = zeros(4) -_metric[0,0] = -A**2*(1+C*r**2)**5 -_metric[1,1] = (1+C*r**2)**3/(1-C*r**2*(309+54*C*r**2+8*C**2*r**4)/112+K*C*r**2/(1+6*C*r**2)**Rational(1,3)) -_metric[2,2] = r**2 -_metric[3,3] = r**2*sin(th)**2 +from sympy import Rational, sin, symbols, zeros + +coords = symbols("t r theta phi", real=True) +variables = symbols("A C K", constant=True) +functions = () +t, r, th, ph = coords +A, C, K = variables +metric = zeros(4) +metric[0, 0] = -A ** 2 * (1 + C * r ** 2) ** 5 +metric[1, 1] = (1 + C * r ** 2) ** 3 / ( + 1 + - C * r ** 2 * (309 + 54 * C * r ** 2 + 8 * C ** 2 * r ** 4) / 112 + + K * C * r ** 2 / (1 + 6 * C * r ** 2) ** Rational(1, 3) +) +metric[2, 2] = r ** 2 +metric[3, 3] = r ** 2 * sin(th) ** 2 del t, r, th, ph, A, C, K diff --git a/src/riccipy/metrics/durgapal_fuloria.py b/src/riccipy/metrics/durgapal_fuloria.py index 52bc37c..c4d1c69 100644 --- a/src/riccipy/metrics/durgapal_fuloria.py +++ b/src/riccipy/metrics/durgapal_fuloria.py @@ -1,9 +1,16 @@ # Durgapal and Fuloria's static spherically symmetric perfect fluid -_coords = symbols('t r theta phi', real=True) -_vars = symbols('B C', constant=True) -_funs = () -t, r, th, ph = _coords -B, C = _vars -expr = 1 + C*r**2 -_metric = diag(-B*expr**4, 7*expr**2/(-expr**2-8*expr+16), r**2, r**2*sin(th)**2) +from sympy import diag, sin, symbols + +coords = symbols("t r theta phi", real=True) +variables = symbols("B C", constant=True) +functions = () +t, r, th, ph = coords +B, C = variables +expr = 1 + C * r ** 2 +metric = diag( + -B * expr ** 4, + 7 * expr ** 2 / (-expr ** 2 - 8 * expr + 16), + r ** 2, + r ** 2 * sin(th) ** 2, +) del expr, t, r, th, ph, B, C diff --git a/src/riccipy/metrics/einstein_1.py b/src/riccipy/metrics/einstein_1.py index b4fe684..af0aaf4 100644 --- a/src/riccipy/metrics/einstein_1.py +++ b/src/riccipy/metrics/einstein_1.py @@ -1,9 +1,11 @@ # Einstein's static universe. Cartesian coordinates -_coords = symbols('t x y z', real=True) -_vars = symbols('K', constant=True) -_funs = () -t, x, y, z = _coords -K = _vars -expr = 1/(1+sqrt(x**2+y**2+z**2)/(4*K**2))**2 -_metric = diag(-1, expr, expr, expr) +from sympy import diag, sqrt, symbols + +coords = symbols("t x y z", real=True) +variables = symbols("K", constant=True) +functions = () +t, x, y, z = coords +K = variables +expr = 1 / (1 + sqrt(x ** 2 + y ** 2 + z ** 2) / (4 * K ** 2)) ** 2 +metric = diag(-1, expr, expr, expr) del expr, t, x, y, z, K diff --git a/src/riccipy/metrics/einstein_2.py b/src/riccipy/metrics/einstein_2.py index e67c686..0b04723 100644 --- a/src/riccipy/metrics/einstein_2.py +++ b/src/riccipy/metrics/einstein_2.py @@ -1,8 +1,10 @@ # Einstein's static universe. Polar coordinates -_coords = symbols('t chi theta phi', real=True) -_vars = symbols('Lambda', constant=True) -_funs = () -t, ch, th, ph = _coords -La = _vars -_metric = diag(-1/La, 1/La, sin(ch)**2/La, sin(ch)**2*sin(th)**2/La) +from sympy import diag, sin, symbols + +coords = symbols("t chi theta phi", real=True) +variables = symbols("Lambda", constant=True) +functions = () +t, ch, th, ph = coords +La = variables +metric = diag(-1 / La, 1 / La, sin(ch) ** 2 / La, sin(ch) ** 2 * sin(th) ** 2 / La) del t, ch, th, ph, La diff --git a/src/riccipy/metrics/einstein_3.py b/src/riccipy/metrics/einstein_3.py index bf0297a..3e61c6f 100644 --- a/src/riccipy/metrics/einstein_3.py +++ b/src/riccipy/metrics/einstein_3.py @@ -1,8 +1,10 @@ # Einstein's static universe. Curvature coordinates -_coords = symbols('t r theta phi', real=True) -_vars = symbols('Lambda', constant=True) -_funs = () -t, r, th, ph = _coords -La = _vars -_metric = diag(-1, 1/(1-La*r**2), r**2, r**2*sin(th)**2) +from sympy import diag, sin, symbols + +coords = symbols("t r theta phi", real=True) +variables = symbols("Lambda", constant=True) +functions = () +t, r, th, ph = coords +La = variables +metric = diag(-1, 1 / (1 - La * r ** 2), r ** 2, r ** 2 * sin(th) ** 2) del t, r, th, ph, La diff --git a/src/riccipy/metrics/einstein_maxwell_1.py b/src/riccipy/metrics/einstein_maxwell_1.py index 3c5aac8..6652e9f 100644 --- a/src/riccipy/metrics/einstein_maxwell_1.py +++ b/src/riccipy/metrics/einstein_maxwell_1.py @@ -1,10 +1,12 @@ # Static cylindrically symmetric Einstein-Maxwell field (i) angular magnetic field (caused by an axial current) -_coords = symbols('t phi rho z', real=True) -_vars = symbols('a b m', constant=True) -_funs = () -t, ph, rh, z = _coords -a, b, m = _vars -expr1 = cosh(log(a*rh**m))**2 -expr2 = rh**(2*m**2)*b**2*expr1 -_metric = diag(-expr2, rh**2*b**2*expr1, expr2, 1/(b**2*expr1)) +from sympy import cosh, diag, log, symbols + +coords = symbols("t phi rho z", real=True) +variables = symbols("a b m", constant=True) +functions = () +t, ph, rh, z = coords +a, b, m = variables +expr1 = cosh(log(a * rh ** m)) ** 2 +expr2 = rh ** (2 * m ** 2) * b ** 2 * expr1 +metric = diag(-expr2, rh ** 2 * b ** 2 * expr1, expr2, 1 / (b ** 2 * expr1)) del expr1, expr2, t, ph, rh, z, a, b, m diff --git a/src/riccipy/metrics/einstein_maxwell_2.py b/src/riccipy/metrics/einstein_maxwell_2.py index 0960ca1..14fb881 100644 --- a/src/riccipy/metrics/einstein_maxwell_2.py +++ b/src/riccipy/metrics/einstein_maxwell_2.py @@ -1,10 +1,12 @@ # Static cylindrically symmetric Einstein-Maxwell field (ii) longitudinal magnetic field (caused by an angular current) -_coords = symbols('t phi rho z', real=True) -_vars = symbols('a b m', constant=True) -_funs = () -t, ph, rh, z = _coords -a, b, m = _vars -expr1 = cosh(log(a*rh**m))**2 -expr2 = rh**(2*m**2)*b**2*expr1 -_metric = diag(-expr2, 1/(b**2*expr1), expr2, rh**2*b**2*expr1) +from sympy import cosh, diag, log, symbols + +coords = symbols("t phi rho z", real=True) +variables = symbols("a b m", constant=True) +functions = () +t, ph, rh, z = coords +a, b, m = variables +expr1 = cosh(log(a * rh ** m)) ** 2 +expr2 = rh ** (2 * m ** 2) * b ** 2 * expr1 +metric = diag(-expr2, 1 / (b ** 2 * expr1), expr2, rh ** 2 * b ** 2 * expr1) del expr1, expr2, t, ph, rh, z, a, b, m diff --git a/src/riccipy/metrics/einstein_maxwell_3.py b/src/riccipy/metrics/einstein_maxwell_3.py index 7597c0e..a1b8039 100644 --- a/src/riccipy/metrics/einstein_maxwell_3.py +++ b/src/riccipy/metrics/einstein_maxwell_3.py @@ -1,11 +1,12 @@ # Static cylindrically symmetric Einstein-Maxwell field (iii) radial electric field (caused by an axial charge distribution) -_coords = symbols('t phi rho z', real=True) -_vars = symbols('a b m', constant=True) -_funs = () -t, ph, rh, z = _coords -a, b, m = _vars -expr1 = cosh(log(a*rh**m))**2 -expr2 = rh**(2*m**2)*b**2*expr1 -_metric = diag(-1/(b**2*expr1), rh**2*b**2*expr1, expr2, expr2) -del expr1, expr2, t, ph, rh, z, a, b, m +from sympy import cosh, diag, log, symbols +coords = symbols("t phi rho z", real=True) +variables = symbols("a b m", constant=True) +functions = () +t, ph, rh, z = coords +a, b, m = variables +expr1 = cosh(log(a * rh ** m)) ** 2 +expr2 = rh ** (2 * m ** 2) * b ** 2 * expr1 +metric = diag(-1 / (b ** 2 * expr1), rh ** 2 * b ** 2 * expr1, expr2, expr2) +del expr1, expr2, t, ph, rh, z, a, b, m diff --git a/src/riccipy/metrics/ellis_maccallum_1.py b/src/riccipy/metrics/ellis_maccallum_1.py index 75ee687..336dca8 100644 --- a/src/riccipy/metrics/ellis_maccallum_1.py +++ b/src/riccipy/metrics/ellis_maccallum_1.py @@ -1,7 +1,9 @@ # Ellis and MacCallum's G3VIo dust solution -_coords = symbols('t x y z', real=True) -_vars = () -_funs = () -t, x, y, z = _coords -_metric = diag(-1, 16*t**2, t*exp(-4*x), t*exp(4*x)) +from sympy import diag, exp, symbols + +coords = symbols("t x y z", real=True) +variables = () +functions = () +t, x, y, z = coords +metric = diag(-1, 16 * t ** 2, t * exp(-4 * x), t * exp(4 * x)) del t, x, y, z diff --git a/src/riccipy/metrics/ellis_maccallum_2.py b/src/riccipy/metrics/ellis_maccallum_2.py index 4e7a76d..c2fe92a 100644 --- a/src/riccipy/metrics/ellis_maccallum_2.py +++ b/src/riccipy/metrics/ellis_maccallum_2.py @@ -1,8 +1,15 @@ # Ellis and MacCallum Bianchi VIo vacuum solution -_coords = symbols('t x y z', real=True) -_vars = symbols('n', constant=True) -_funs = () -t, x, y, z = _coords -n = _vars -_metric = diag(-sqrt(t)*exp(n**2*t**2), sqrt(t)*exp(n**2*t**2), t*exp(2*n*x), t*exp(-2*n*x)) +from sympy import diag, exp, sqrt, symbols + +coords = symbols("t x y z", real=True) +variables = symbols("n", constant=True) +functions = () +t, x, y, z = coords +n = variables +metric = diag( + -sqrt(t) * exp(n ** 2 * t ** 2), + sqrt(t) * exp(n ** 2 * t ** 2), + t * exp(2 * n * x), + t * exp(-2 * n * x), +) del t, x, y, z, n diff --git a/src/riccipy/metrics/faulkes.py b/src/riccipy/metrics/faulkes.py index 8a4e0b3..9f513aa 100644 --- a/src/riccipy/metrics/faulkes.py +++ b/src/riccipy/metrics/faulkes.py @@ -1,10 +1,14 @@ # Faulkes' non-static spherically symmetric perfect fluid solution -_coords = symbols('t r theta phi', real=True) -_vars = symbols('k', constant=True) -_funs = symbols('E', cls=Function) -t, r, th, ph = _coords -k = _vars -E = _funs -expr = (E(t)-(r/(2*k)))**2 -_metric = diag(-E(t)**2/expr, expr**2, expr**2*r**2, expr**2*r**2*sin(th)**2) +from sympy import Function, diag, sin, symbols + +coords = symbols("t r theta phi", real=True) +variables = symbols("k", constant=True) +functions = symbols("E", cls=Function) +t, r, th, ph = coords +k = variables +E = functions +expr = (E(t) - (r / (2 * k))) ** 2 +metric = diag( + -E(t) ** 2 / expr, expr ** 2, expr ** 2 * r ** 2, expr ** 2 * r ** 2 * sin(th) ** 2 +) del expr, t, r, th, ph, k, E diff --git a/src/riccipy/metrics/godel.py b/src/riccipy/metrics/godel.py index c7d9ecc..a055a1e 100644 --- a/src/riccipy/metrics/godel.py +++ b/src/riccipy/metrics/godel.py @@ -1,9 +1,11 @@ # Godel metric -_coords = symbols('t x y z', real=True) -_vars = (symbols('omega', constant=True),) -_funs = () -t, x, y, z = _coords -om = _vars -_metric = diag(-1, 1, -Rational(1,2)*exp(2*sqrt(2)*om*x), 1) -_metric[0,2] = _metric[2,0] = -exp(sqrt(2)*om*x) +from sympy import Rational, diag, exp, sqrt, symbols + +coords = symbols("t x y z", real=True) +variables = symbols("omega", constant=True) +functions = () +t, x, y, z = coords +om = variables +metric = diag(-1, 1, -Rational(1, 2) * exp(2 * sqrt(2) * om * x), 1) +metric[0, 2] = metric[2, 0] = -exp(sqrt(2) * om * x) del t, x, y, z, om diff --git a/src/riccipy/metrics/godfrey.py b/src/riccipy/metrics/godfrey.py index eaccae4..e3acc5a 100644 --- a/src/riccipy/metrics/godfrey.py +++ b/src/riccipy/metrics/godfrey.py @@ -1,9 +1,11 @@ # A vacuum metric admitting a nontrivial homothety which is non-null, not hypersurface-orthogonal, and whose homothetic bivector is null -_coords = symbols('t r z phi', real=True) -_vars = symbols('a C') -_funs = () -t, r, z, ph = _coords -a, C = _vars -expr = r**(2*a*(a-1))*exp(2*(2*a*z-z-r**2/2+C)) -_metric = diag(-r**(2*a)*exp(2*z), expr, expr, r**(2*(1-a))/exp(2*z)) +from sympy import diag, exp, symbols + +coords = symbols("t r z phi", real=True) +variables = symbols("a C") +functions = () +t, r, z, ph = coords +a, C = variables +expr = r ** (2 * a * (a - 1)) * exp(2 * (2 * a * z - z - r ** 2 / 2 + C)) +metric = diag(-r ** (2 * a) * exp(2 * z), expr, expr, r ** (2 * (1 - a)) / exp(2 * z)) del expr, t, r, z, ph, a, C diff --git a/src/riccipy/metrics/harrison_1.py b/src/riccipy/metrics/harrison_1.py index def5f0f..bab8df3 100644 --- a/src/riccipy/metrics/harrison_1.py +++ b/src/riccipy/metrics/harrison_1.py @@ -1,13 +1,15 @@ # Harrison III-12(b). Petrov type I -_coords = symbols('x_0:4', real=True) -_vars = symbols('a', constant=True) -_funs = () -x0, x1, x2, x3 = _coords -a = _vars -expr = x1**2*cosh(x3)**Rational(3,2) -_metric = zeros(4) -_metric[0,0] = x0**Rational(3,2)*expr -_metric[1,1] = a**2*x0**3*x1*cosh(x3)**3 -_metric[2,2] = 1/(x0*x1*cosh(x3)) -_metric[3,3] = x0**Rational(7,2)*expr +from sympy import Rational, cosh, symbols, zeros + +coords = symbols("x_0:4", real=True) +variables = symbols("a", constant=True) +functions = () +x0, x1, x2, x3 = coords +a = variables +expr = x1 ** 2 * cosh(x3) ** Rational(3, 2) +metric = zeros(4) +metric[0, 0] = x0 ** Rational(3, 2) * expr +metric[1, 1] = a ** 2 * x0 ** 3 * x1 * cosh(x3) ** 3 +metric[2, 2] = 1 / (x0 * x1 * cosh(x3)) +metric[3, 3] = x0 ** Rational(7, 2) * expr del expr, x0, x1, x2, x3, a diff --git a/src/riccipy/metrics/harrison_2.py b/src/riccipy/metrics/harrison_2.py index 4a60e7f..f26ac2b 100644 --- a/src/riccipy/metrics/harrison_2.py +++ b/src/riccipy/metrics/harrison_2.py @@ -1,7 +1,14 @@ # Harrison III-3 Petrov type D, Kinnersley class IV.B (C=0) -_coords = symbols('x_0:4', real=True) -_vars = () -_funs = () -x0, x1, x2, x3 = _coords -_metric = diag(-x1*sin(x3), 1/(sqrt(x1*sin(x3))), x1*sin(x3), x1**Rational(3,2)/sqrt(sin(x3))) +from sympy import Rational, diag, sin, sqrt, symbols + +coords = symbols("x_0:4", real=True) +variables = () +functions = () +x0, x1, x2, x3 = coords +metric = diag( + -x1 * sin(x3), + 1 / (sqrt(x1 * sin(x3))), + x1 * sin(x3), + x1 ** Rational(3, 2) / sqrt(sin(x3)), +) del x0, x1, x2, x3 diff --git a/src/riccipy/metrics/harrison_3.py b/src/riccipy/metrics/harrison_3.py index 4bd6633..431276f 100644 --- a/src/riccipy/metrics/harrison_3.py +++ b/src/riccipy/metrics/harrison_3.py @@ -1,7 +1,14 @@ # Harrison III-7(a) Petrov type D, Kinnersley class IV.B (C=1/2) -_coords = symbols('x_0:4', real=True) -_vars = () -_funs = () -x0, x1, x2, x3 = _coords -_metric = diag(-1/(1-x3**2)**2, sinh(2*x0)**2/(1-x3**2)**2, x3**2, 1/(1-x3**2)**4) +from sympy import diag, sinh, symbols + +coords = symbols("x_0:4", real=True) +variables = () +functions = () +x0, x1, x2, x3 = coords +metric = diag( + -1 / (1 - x3 ** 2) ** 2, + sinh(2 * x0) ** 2 / (1 - x3 ** 2) ** 2, + x3 ** 2, + 1 / (1 - x3 ** 2) ** 4, +) del x0, x1, x2, x3 diff --git a/src/riccipy/metrics/harrison_4.py b/src/riccipy/metrics/harrison_4.py index ece521b..c8fac12 100644 --- a/src/riccipy/metrics/harrison_4.py +++ b/src/riccipy/metrics/harrison_4.py @@ -1,7 +1,14 @@ # Harrison III-7(b) Petrov type D, Kinnersley class IV.B (C=1/2) -_coords = symbols('x_0:4', real=True) -_vars = () -_funs = () -x0, x1, x2, x3 = _coords -_metric = diag(-1/(1-x3**2)**2, cosh(2*x0)**2/(1-x3**2)**2, x3**2, 1/(1-x3**2)**4) +from sympy import cosh, diag, symbols + +coords = symbols("x_0:4", real=True) +variables = () +functions = () +x0, x1, x2, x3 = coords +metric = diag( + -1 / (1 - x3 ** 2) ** 2, + cosh(2 * x0) ** 2 / (1 - x3 ** 2) ** 2, + x3 ** 2, + 1 / (1 - x3 ** 2) ** 4, +) del x0, x1, x2, x3 diff --git a/src/riccipy/metrics/harrison_5.py b/src/riccipy/metrics/harrison_5.py index 984e046..08a6bdc 100644 --- a/src/riccipy/metrics/harrison_5.py +++ b/src/riccipy/metrics/harrison_5.py @@ -1,7 +1,14 @@ # Harrison III-7(a) Petrov type D, Kinnersley class IV.B (C=1/2) -_coords = symbols('x_0:4', real=True) -_vars = () -_funs = () -x0, x1, x2, x3 = _coords -_metric = diag(-1/(1-x3**2)**2, exp(4*x0)**2/(1-x3**2)**2, x3**2, 1/(1-x3**2)**4) +from sympy import diag, exp, symbols + +coords = symbols("x_0:4", real=True) +variables = () +functions = () +x0, x1, x2, x3 = coords +metric = diag( + -1 / (1 - x3 ** 2) ** 2, + exp(4 * x0) ** 2 / (1 - x3 ** 2) ** 2, + x3 ** 2, + 1 / (1 - x3 ** 2) ** 4, +) del x0, x1, x2, x3 diff --git a/src/riccipy/metrics/harrison_6.py b/src/riccipy/metrics/harrison_6.py index 4fcd523..acf0e4e 100644 --- a/src/riccipy/metrics/harrison_6.py +++ b/src/riccipy/metrics/harrison_6.py @@ -1,7 +1,14 @@ # Harrison III-9(a) Petrov type D, Kinnersley class II.B (a=l=0) -_coords = symbols('x_0:4', real=True) -_vars = () -_funs = () -x0, x1, x2, x3 = _coords -_metric = diag(-x3**2, sinh(2*x2)**2/(1+x3**2)**2, 1/(1+x3**2)**2, 1/(1+x3**2)**4) +from sympy import diag, sinh, symbols + +coords = symbols("x_0:4", real=True) +variables = () +functions = () +x0, x1, x2, x3 = coords +metric = diag( + -x3 ** 2, + sinh(2 * x2) ** 2 / (1 + x3 ** 2) ** 2, + 1 / (1 + x3 ** 2) ** 2, + 1 / (1 + x3 ** 2) ** 4, +) del x0, x1, x2, x3 diff --git a/src/riccipy/metrics/harrison_7.py b/src/riccipy/metrics/harrison_7.py index 35056f1..e029483 100644 --- a/src/riccipy/metrics/harrison_7.py +++ b/src/riccipy/metrics/harrison_7.py @@ -1,7 +1,14 @@ # Harrison III-9(b) Petrov type D, Kinnersley class II.C (a=l=0) -_coords = symbols('x_0:4', real=True) -_vars = () -_funs = () -x0, x1, x2, x3 = _coords -_metric = diag(-x3**2, cosh(2*x2)**2/(1+x3**2)**2, 1/(1+x3**2)**2, 1/(1+x3**2)**4) +from sympy import cosh, diag, symbols + +coords = symbols("x_0:4", real=True) +variables = () +functions = () +x0, x1, x2, x3 = coords +metric = diag( + -x3 ** 2, + cosh(2 * x2) ** 2 / (1 + x3 ** 2) ** 2, + 1 / (1 + x3 ** 2) ** 2, + 1 / (1 + x3 ** 2) ** 4, +) del x0, x1, x2, x3 diff --git a/src/riccipy/metrics/harrison_8.py b/src/riccipy/metrics/harrison_8.py index 07850b8..005ef72 100644 --- a/src/riccipy/metrics/harrison_8.py +++ b/src/riccipy/metrics/harrison_8.py @@ -1,7 +1,14 @@ # Harrison III-9(c) Petrov type D, Kinnersley class II.D (a=l=0) -_coords = symbols('x_0:4', real=True) -_vars = () -_funs = () -x0, x1, x2, x3 = _coords -_metric = diag(-x3**2, exp(4*x2)**2/(1+x3**2)**2, 1/(1+x3**2)**2, 1/(1+x3**2)**4) +from sympy import diag, exp, symbols + +coords = symbols("x_0:4", real=True) +variables = () +functions = () +x0, x1, x2, x3 = coords +metric = diag( + -x3 ** 2, + exp(4 * x2) ** 2 / (1 + x3 ** 2) ** 2, + 1 / (1 + x3 ** 2) ** 2, + 1 / (1 + x3 ** 2) ** 4, +) del x0, x1, x2, x3 diff --git a/src/riccipy/metrics/heintzmann.py b/src/riccipy/metrics/heintzmann.py index c679610..f2c72ce 100644 --- a/src/riccipy/metrics/heintzmann.py +++ b/src/riccipy/metrics/heintzmann.py @@ -1,8 +1,12 @@ # Heintzmann's static spherically symmetric perfect fluid solution -_coords = symbols('t r theta phi', real=True) -_vars = symbols('A a K', constant=True) -_funs = () -t, r, th, ph = _coords -A, a, K = _vars -_metric = diag(-A**2*(1+a*r**2)**3, (1+a*r**2)/K, r**2, r**2*sin(th)**2) +from sympy import diag, sin, symbols + +coords = symbols("t r theta phi", real=True) +variables = symbols("A a K", constant=True) +functions = () +t, r, th, ph = coords +A, a, K = variables +metric = diag( + -A ** 2 * (1 + a * r ** 2) ** 3, (1 + a * r ** 2) / K, r ** 2, r ** 2 * sin(th) ** 2 +) del t, r, th, ph, A, a, K diff --git a/src/riccipy/metrics/kasner_1.py b/src/riccipy/metrics/kasner_1.py index 885feed..9752ce2 100644 --- a/src/riccipy/metrics/kasner_1.py +++ b/src/riccipy/metrics/kasner_1.py @@ -1,7 +1,9 @@ # Kasner power-law vacuum solution. Axisymmetric case -_coords = symbols('t x y z', real=True) -_vars = () -_funs = () -t, x, y, z = _coords -_metric = diag(-1, t**Rational(4,3), t**Rational(4,3), t**Rational(-2,3)) +from sympy import Rational, diag, symbols + +coords = symbols("t x y z", real=True) +variables = () +functions = () +t, x, y, z = coords +metric = diag(-1, t ** Rational(4, 3), t ** Rational(4, 3), t ** Rational(-2, 3)) del t, x, y, z diff --git a/src/riccipy/metrics/kasner_2.py b/src/riccipy/metrics/kasner_2.py index 416a88f..00fbe66 100644 --- a/src/riccipy/metrics/kasner_2.py +++ b/src/riccipy/metrics/kasner_2.py @@ -1,7 +1,9 @@ # Kasner power-law vacuum solution. Axisymmetric flat case -_coords = symbols('t x y z', real=True) -_vars = () -_funs = () -t, x, y, z = _coords -_metric = diag(-1, t**2, 1, 1) +from sympy import diag, symbols + +coords = symbols("t x y z", real=True) +variables = () +functions = () +t, x, y, z = coords +metric = diag(-1, t ** 2, 1, 1) del t, x, y, z diff --git a/src/riccipy/metrics/kerr_1.py b/src/riccipy/metrics/kerr_1.py index 5677f5a..b48ccda 100644 --- a/src/riccipy/metrics/kerr_1.py +++ b/src/riccipy/metrics/kerr_1.py @@ -1,14 +1,27 @@ # Kerr metric in Cartesian coordinates -_coords = symbols('t x y z', real=True) -_vars = symbols('a M', constant=True) -_funs = () -expr = _coords[1]**2+_vars[0]**2*_coords[2]**2 -t, x, y, z = _coords -a, M = _vars -_metric = zeros(4) -_metric[0,0] = -(a**2*y**2+x**2-2*M*x)/expr -_metric[1,1] = expr/(x**2-2*M*x+a**2) -_metric[2,2] = -expr/(y**2-1) -_metric[3,3] = -(x**4+x**2*a**2+2*a**2*M*x+a**2*y**2*x**2-2*a*y**2*M*x+a**4*y**2)*(y**2-1)/expr -_metric[0,3] = _metric[3,0] = 2*a*M*x*(y**2-1)/expr +from sympy import symbols, zeros + +coords = symbols("t x y z", real=True) +variables = symbols("a M", constant=True) +functions = () +t, x, y, z = coords +a, M = variables +expr = x ** 2 + a ** 2 * y ** 2 +metric = zeros(4) +metric[0, 0] = -(a ** 2 * y ** 2 + x ** 2 - 2 * M * x) / expr +metric[1, 1] = expr / (x ** 2 - 2 * M * x + a ** 2) +metric[2, 2] = -expr / (y ** 2 - 1) +metric[3, 3] = ( + -( + x ** 4 + + x ** 2 * a ** 2 + + 2 * a ** 2 * M * x + + a ** 2 * y ** 2 * x ** 2 + - 2 * a * y ** 2 * M * x + + a ** 4 * y ** 2 + ) + * (y ** 2 - 1) + / expr +) +metric[0, 3] = metric[3, 0] = 2 * a * M * x * (y ** 2 - 1) / expr del expr, t, x, y, z, a, M diff --git a/src/riccipy/metrics/kerr_2.py b/src/riccipy/metrics/kerr_2.py index b383835..1529d9e 100644 --- a/src/riccipy/metrics/kerr_2.py +++ b/src/riccipy/metrics/kerr_2.py @@ -1,14 +1,27 @@ # Kerr metric in Boyer Lindquist coordinates -_coords = symbols('t r theta phi', real=True) -_vars = symbols('a M', constant=True) -_funs = () -t, r, th, ph = _coords -a, M = _vars -expr = a**2*cos(th)**2+r**2 -_metric = zeros(4) -_metric[0,0] = -(a**2-sin(th)**2*a**2+r**2-2*M*r)/expr -_metric[1,1] = expr/(r**2-2*M*r+a**2) -_metric[2,2] = expr -_metric[3,3] = (-a**4*sin(th)**2+a**4+2*r**2*a**2-a**2*sin(th)**2*r**2+2*a**2*sin(th)**2*M*r+r**4)*sin(th)**2/expr -_metric[0,3] = _metric[3,0] = -2*M*r*a*sin(th)**2/expr +from sympy import cos, sin, symbols, zeros + +coords = symbols("t r theta phi", real=True) +variables = symbols("a M", constant=True) +functions = () +t, r, th, ph = coords +a, M = variables +expr = a ** 2 * cos(th) ** 2 + r ** 2 +metric = zeros(4) +metric[0, 0] = -(a ** 2 - sin(th) ** 2 * a ** 2 + r ** 2 - 2 * M * r) / expr +metric[1, 1] = expr / (r ** 2 - 2 * M * r + a ** 2) +metric[2, 2] = expr +metric[3, 3] = ( + ( + -a ** 4 * sin(th) ** 2 + + a ** 4 + + 2 * r ** 2 * a ** 2 + - a ** 2 * sin(th) ** 2 * r ** 2 + + 2 * a ** 2 * sin(th) ** 2 * M * r + + r ** 4 + ) + * sin(th) ** 2 + / expr +) +metric[0, 3] = metric[3, 0] = -2 * M * r * a * sin(th) ** 2 / expr del expr, t, r, th, ph, a, M diff --git a/src/riccipy/metrics/kerr_3.py b/src/riccipy/metrics/kerr_3.py index 581b726..aa08fe9 100644 --- a/src/riccipy/metrics/kerr_3.py +++ b/src/riccipy/metrics/kerr_3.py @@ -1,15 +1,28 @@ # Kerr metric in outgoing Eddington Finkelstein form -_coords = symbols('u r theta phi', real=True) -_vars = symbols('a M', constant=True) -_funs = () -u, r, th, ph = _coords -a, M = _vars -expr = r**2 + a**2*cos(th)**2 -_metric = zeros(4) -_metric[0,0] = -(a**2-sin(th)**2*a**2+r**2-2*M*r)/expr -_metric[2,2] = expr -_metric[3,3] = sin(th)**2*(2*a**2*M*r*sin(th)**2+a**4-a**4*sin(th)**2+2*r**2*a**2-a**2*sin(th)**2*r**2+r**4)/expr -_metric[0,1] = _metric[1,0] = -1 -_metric[0,3] = _metric[3,0] = -2*a*sin(th)**2*M*r/expr -_metric[1,3] = _metric[3,1] = a*sin(th)**2 +from sympy import cos, sin, symbols, zeros + +coords = symbols("u r theta phi", real=True) +variables = symbols("a M", constant=True) +functions = () +u, r, th, ph = coords +a, M = variables +expr = r ** 2 + a ** 2 * cos(th) ** 2 +metric = zeros(4) +metric[0, 0] = -(a ** 2 - sin(th) ** 2 * a ** 2 + r ** 2 - 2 * M * r) / expr +metric[2, 2] = expr +metric[3, 3] = ( + sin(th) ** 2 + * ( + 2 * a ** 2 * M * r * sin(th) ** 2 + + a ** 4 + - a ** 4 * sin(th) ** 2 + + 2 * r ** 2 * a ** 2 + - a ** 2 * sin(th) ** 2 * r ** 2 + + r ** 4 + ) + / expr +) +metric[0, 1] = metric[1, 0] = -1 +metric[0, 3] = metric[3, 0] = -2 * a * sin(th) ** 2 * M * r / expr +metric[1, 3] = metric[3, 1] = a * sin(th) ** 2 del expr, u, r, th, ph, a, M diff --git a/src/riccipy/metrics/kerr_newman_1.py b/src/riccipy/metrics/kerr_newman_1.py index 1ed2a57..58c7616 100644 --- a/src/riccipy/metrics/kerr_newman_1.py +++ b/src/riccipy/metrics/kerr_newman_1.py @@ -1,14 +1,29 @@ # Kerr metric in Cartesian coordinates -_coords = symbols('t x y z', real=True) -_vars = symbols('a M Q', constant=True) -_funs = () -t, x, y, z = _coords -a, M, Q = _vars -expr = x**2+a**2*y**2 -_metric = zeros(4) -_metric[0,0] = -(a**2*y**2+x**2-2*M*x+Q**2)/expr -_metric[1,1] = expr/(x**2-2*M*x+a**2+Q**2) -_metric[2,2] = -expr/(x**2-1) -_metric[3,3] = -(x**4+x**2*a**2+2*a**2*M*x-a**2*Q**2+a**2*y**2*x**2-2*a**2*y**2*M*x+a**4*y**2+a**2*y**2*Q**2)*(y**2-1)/expr -_metric[0,3] = _metric[3,0] = a*(2*M*x-Q**2)*(y**2-1)/expr +from sympy import symbols, zeros + +coords = symbols("t x y z", real=True) +variables = symbols("a M Q", constant=True) +functions = () +t, x, y, z = coords +a, M, Q = variables +expr = x ** 2 + a ** 2 * y ** 2 +metric = zeros(4) +metric[0, 0] = -(a ** 2 * y ** 2 + x ** 2 - 2 * M * x + Q ** 2) / expr +metric[1, 1] = expr / (x ** 2 - 2 * M * x + a ** 2 + Q ** 2) +metric[2, 2] = -expr / (x ** 2 - 1) +metric[3, 3] = ( + -( + x ** 4 + + x ** 2 * a ** 2 + + 2 * a ** 2 * M * x + - a ** 2 * Q ** 2 + + a ** 2 * y ** 2 * x ** 2 + - 2 * a ** 2 * y ** 2 * M * x + + a ** 4 * y ** 2 + + a ** 2 * y ** 2 * Q ** 2 + ) + * (y ** 2 - 1) + / expr +) +metric[0, 3] = metric[3, 0] = a * (2 * M * x - Q ** 2) * (y ** 2 - 1) / expr del expr, t, x, y, z, a, M, Q diff --git a/src/riccipy/metrics/kerr_newman_2.py b/src/riccipy/metrics/kerr_newman_2.py index b9494d3..183ac73 100644 --- a/src/riccipy/metrics/kerr_newman_2.py +++ b/src/riccipy/metrics/kerr_newman_2.py @@ -1,15 +1,30 @@ # Kerr metric in Boyer Lindquist coordinates -_coords = symbols('t r theta phi', real=True) -_vars = symbols('a M Q', constant=True) -_funs = () -t, r, th, ph = _coords -a, M, Q = _vars -expr = a**2*cos(th)**2+r**2 -_metric = diag(-(a**2-sin(th)**2*a**2+r**2-(2*M*r-Q**2))/expr, expr/(r**2-2*M*r+Q**2+a**2), expr, (-a**4*sin(th)**2+a**4+2*r**2*a**2-a**2*sin(th)**2*r**2+2*a**2*sin(th)**2*M*r-a**2*sin(th)**2*Q**2+r**4)*sin(th)**2/expr) -_metric = zeros(4) -_metric[0,0] = -(a**2-sin(th)**2*a**2+r**2-(2*M*r-Q**2))/expr -_metric[1,1] = expr/(r**2-2*M*r+Q**2+a**2) -_metric[2,2] = expr -_metric[3,3] = (-a**4*sin(th)**2+a**4+2*r**2*a**2-a**2*sin(th)**2*r**2+2*a**2*sin(th)**2*M*r-a**2*sin(th)**2*Q**2+r**4)*sin(th)**2/expr -_metric[0,3] = _metric[3,0] = -(2*a*sin(th)**2*M*r-a*sin(th)**2*Q**2)/expr +from sympy import cos, sin, symbols, zeros + +coords = symbols("t r theta phi", real=True) +variables = symbols("a M Q", constant=True) +functions = () +t, r, th, ph = coords +a, M, Q = variables +expr = a ** 2 * cos(th) ** 2 + r ** 2 +metric = zeros(4) +metric[0, 0] = -(a ** 2 - sin(th) ** 2 * a ** 2 + r ** 2 - (2 * M * r - Q ** 2)) / expr +metric[1, 1] = expr / (r ** 2 - 2 * M * r + Q ** 2 + a ** 2) +metric[2, 2] = expr +metric[3, 3] = ( + ( + -a ** 4 * sin(th) ** 2 + + a ** 4 + + 2 * r ** 2 * a ** 2 + - a ** 2 * sin(th) ** 2 * r ** 2 + + 2 * a ** 2 * sin(th) ** 2 * M * r + - a ** 2 * sin(th) ** 2 * Q ** 2 + + r ** 4 + ) + * sin(th) ** 2 + / expr +) +metric[0, 3] = metric[3, 0] = ( + -(2 * a * sin(th) ** 2 * M * r - a * sin(th) ** 2 * Q ** 2) / expr +) del expr, t, r, th, ph, a, M, Q diff --git a/src/riccipy/metrics/klein.py b/src/riccipy/metrics/klein.py index 1d8c1f9..23fbbd3 100644 --- a/src/riccipy/metrics/klein.py +++ b/src/riccipy/metrics/klein.py @@ -1,8 +1,10 @@ # Klein's static spherically symmetric radiation perfect fluid solution -_coords = symbols('t r theta phi', real=True) -_vars = symbols('p_0', constant=True) -_funs = () -t, r, th, ph = _coords -p_0 = _vars -_metric = diag(-sqrt(7*p_0)*r, Rational(7,4), r**2, r**2*sin(th)**2) -del t, r, th, ph, p_0 +from sympy import Rational, diag, sin, sqrt, symbols + +coords = symbols("t r theta phi", real=True) +variables = symbols("p_0", constant=True) +functions = () +t, r, th, ph = coords +p0 = variables +metric = diag(-sqrt(7 * p0) * r, Rational(7, 4), r ** 2, r ** 2 * sin(th) ** 2) +del t, r, th, ph, p0 diff --git a/src/riccipy/metrics/kottler.py b/src/riccipy/metrics/kottler.py index c765255..527f9b2 100644 --- a/src/riccipy/metrics/kottler.py +++ b/src/riccipy/metrics/kottler.py @@ -1,9 +1,11 @@ # Kottler's generalization of the Schwarzschild metric with non-zero cosmological constant. Aka Schwarzschild-de Sitter. -_coords = symbols('t r theta phi', real=True) -_vars = symbols('M Lambda', constant=True) -_funs = () -t, r, th, ph = _coords -M, La = _vars -expr = 1-2*M/r-La*r**2/3 -_metric = diag(-expr, 1/expr, r**2, r**2*sin(th)**2) +from sympy import diag, sin, symbols + +coords = symbols("t r theta phi", real=True) +variables = symbols("M Lambda", constant=True) +functions = () +t, r, th, ph = coords +M, La = variables +expr = 1 - 2 * M / r - La * r ** 2 / 3 +metric = diag(-expr, 1 / expr, r ** 2, r ** 2 * sin(th) ** 2) del t, r, th, ph, M, La, expr diff --git a/src/riccipy/metrics/koutras_mcintosh.py b/src/riccipy/metrics/koutras_mcintosh.py index 2d9213c..65d6255 100644 --- a/src/riccipy/metrics/koutras_mcintosh.py +++ b/src/riccipy/metrics/koutras_mcintosh.py @@ -1,14 +1,16 @@ # Koutras-McIntosh metric (no symmetries or invariants) -_coords = symbols('w u x y', real=True) -_vars = symbols('a b', constant=True) -_funs = symbols('f', cls=Function) -w, u, x, y = _coords -a, b = _vars -f = _funs -_metric = zeros(4) -_metric[1,1] = -(2*f(u)*(a*x+b)*(x**2+y**2)-a**2*w**2) -_metric[2,2] = 1 -_metric[3,3] = 1 -_metric[0,1] = _metric[1,0] = -(a*x+b) -_metric[1,2] = _metric[2,1] = a*w +from sympy import Function, symbols, zeros + +coords = symbols("w u x y", real=True) +variables = symbols("a b", constant=True) +functions = symbols("f", cls=Function) +w, u, x, y = coords +a, b = variables +f = functions +metric = zeros(4) +metric[1, 1] = -(2 * f(u) * (a * x + b) * (x ** 2 + y ** 2) - a ** 2 * w ** 2) +metric[2, 2] = 1 +metric[3, 3] = 1 +metric[0, 1] = metric[1, 0] = -(a * x + b) +metric[1, 2] = metric[2, 1] = a * w del w, u, x, y, a, b, f diff --git a/src/riccipy/metrics/kowalczynski_plebanski.py b/src/riccipy/metrics/kowalczynski_plebanski.py index d2f42c2..3020255 100644 --- a/src/riccipy/metrics/kowalczynski_plebanski.py +++ b/src/riccipy/metrics/kowalczynski_plebanski.py @@ -1,10 +1,14 @@ # Kowalczynski and Plebanski metric -_coords = symbols('t x y z', real=True) -_vars = symbols('a b c d', constant=True) -_funs = () -t, x, y, z = _coords -a, b, c, d = _vars -expr1 = a*z**2+b -expr2 = -2*d**2*x**2+c*x-a -_metric = diag(-2*expr1/x**2, 2/(expr2*x**4), 2*expr2, 2/(expr1*x**2)) +from sympy import diag, symbols + +coords = symbols("t x y z", real=True) +variables = symbols("a b c d", constant=True) +functions = () +t, x, y, z = coords +a, b, c, d = variables +expr1 = a * z ** 2 + b +expr2 = -2 * d ** 2 * x ** 2 + c * x - a +metric = diag( + -2 * expr1 / x ** 2, 2 / (expr2 * x ** 4), 2 * expr2, 2 / (expr1 * x ** 2) +) del t, x, y, z, a, b, c, d, expr1, expr2 diff --git a/src/riccipy/metrics/levi_civita_1.py b/src/riccipy/metrics/levi_civita_1.py index 163e113..4725998 100644 --- a/src/riccipy/metrics/levi_civita_1.py +++ b/src/riccipy/metrics/levi_civita_1.py @@ -1,8 +1,10 @@ # Levi-Civita solution, Class AI. Aka the exterior Schwarzschild metric. -_coords = symbols('t r theta phi', real=True) -_vars = symbols('M', constant=True) -_funs = () -t, r, th, ph = _coords -M = _vars -_metric = diag(-(1-2*M/r), 1/(1-2*M/r), r**2, r**2*sin(th)**2) +from sympy import diag, sin, symbols + +coords = symbols("t r theta phi", real=True) +variables = symbols("M", constant=True) +functions = () +t, r, th, ph = coords +M = variables +metric = diag(-(1 - 2 * M / r), 1 / (1 - 2 * M / r), r ** 2, r ** 2 * sin(th) ** 2) del t, r, th, ph, M diff --git a/src/riccipy/metrics/levi_civita_2.py b/src/riccipy/metrics/levi_civita_2.py index b440321..d34ae03 100644 --- a/src/riccipy/metrics/levi_civita_2.py +++ b/src/riccipy/metrics/levi_civita_2.py @@ -1,8 +1,10 @@ # Levi-Civita solution, Class AII -_coords = symbols('t z r phi', real=True) -_vars = symbols('M', constant=True) -_funs = () -t, z, r, ph = _coords -M = _vars -_metric = diag(-(2*M/z-1), 1/(2*M/z-1), z**2, z**2*sinh(r)**2) +from sympy import diag, sinh, symbols + +coords = symbols("t z r phi", real=True) +variables = symbols("M", constant=True) +functions = () +t, z, r, ph = coords +M = variables +metric = diag(-(2 * M / z - 1), 1 / (2 * M / z - 1), z ** 2, z ** 2 * sinh(r) ** 2) del t, z, r, ph, M diff --git a/src/riccipy/metrics/levi_civita_3.py b/src/riccipy/metrics/levi_civita_3.py index 0af4b2d..074fe8e 100644 --- a/src/riccipy/metrics/levi_civita_3.py +++ b/src/riccipy/metrics/levi_civita_3.py @@ -1,7 +1,9 @@ # Levi-Civita solution, Class AIII -_coords = symbols('t z r phi', real=True) -_vars = () -_funs = () -t, z, r, ph = _coords -_metric = diag(-1/z, z, z**2, z**2*r**2) +from sympy import diag, symbols + +coords = symbols("t z r phi", real=True) +variables = () +functions = () +t, z, r, ph = coords +metric = diag(-1 / z, z, z ** 2, z ** 2 * r ** 2) del t, z, r, ph diff --git a/src/riccipy/metrics/levi_civita_4.py b/src/riccipy/metrics/levi_civita_4.py index fee66bc..bb48ea4 100644 --- a/src/riccipy/metrics/levi_civita_4.py +++ b/src/riccipy/metrics/levi_civita_4.py @@ -1,8 +1,10 @@ # Levi-Civita solution, Class BI -_coords = symbols('t r theta phi', real=True) -_vars = symbols('M', constant=True) -_funs = () -t, r, th, ph = _coords -M = _vars -_metric = diag(-r**2*sin(th)**2, 1/(1-2*M/r), r**2, 1-2*M/r) +from sympy import diag, sin, symbols + +coords = symbols("t r theta phi", real=True) +variables = symbols("M", constant=True) +functions = () +t, r, th, ph = coords +M = variables +metric = diag(-r ** 2 * sin(th) ** 2, 1 / (1 - 2 * M / r), r ** 2, 1 - 2 * M / r) del t, r, th, ph, M diff --git a/src/riccipy/metrics/levi_civita_5.py b/src/riccipy/metrics/levi_civita_5.py index ea33aa0..ada710b 100644 --- a/src/riccipy/metrics/levi_civita_5.py +++ b/src/riccipy/metrics/levi_civita_5.py @@ -1,8 +1,10 @@ # Levi-Civita solution, Class BII -_coords = symbols('t z r phi', real=True) -_vars = symbols('M', constant=True) -_funs = () -t, z, r, ph = _coords -M = _vars -_metric = diag(-z**2*sinh(r)**2, 1/(2*M/z-1), z**2, 2*M/z-1) +from sympy import diag, sinh, symbols + +coords = symbols("t z r phi", real=True) +variables = symbols("M", constant=True) +functions = () +t, z, r, ph = coords +M = variables +metric = diag(-z ** 2 * sinh(r) ** 2, 1 / (2 * M / z - 1), z ** 2, 2 * M / z - 1) del t, z, r, ph, M diff --git a/src/riccipy/metrics/levi_civita_6.py b/src/riccipy/metrics/levi_civita_6.py index a9e7904..bd1966a 100644 --- a/src/riccipy/metrics/levi_civita_6.py +++ b/src/riccipy/metrics/levi_civita_6.py @@ -1,7 +1,9 @@ # Levi-Civita solution, Class BIII -_coords = symbols('t z r phi', real=True) -_vars = () -_funs = () -t, z, r, ph = _coords -_metric = diag(-r**2*z**2, z, z**2, 1/z) +from sympy import diag, symbols + +coords = symbols("t z r phi", real=True) +variables = () +functions = () +t, z, r, ph = coords +metric = diag(-r ** 2 * z ** 2, z, z ** 2, 1 / z) del t, z, r, ph diff --git a/src/riccipy/metrics/levi_civita_7.py b/src/riccipy/metrics/levi_civita_7.py index 2dac456..a20c839 100644 --- a/src/riccipy/metrics/levi_civita_7.py +++ b/src/riccipy/metrics/levi_civita_7.py @@ -1,7 +1,9 @@ # Levi-Civita static vacuum solution. Special case m=2, Petrov D -_coords = symbols('t rho z phi', real=True) -_vars = () -_funs = () -t, rh, z, ph = _coords -_metric = diag(-rh**4, rh**4, rh**4, 1/rh**2) +from sympy import diag, symbols + +coords = symbols("t rho z phi", real=True) +variables = () +functions = () +t, rh, z, ph = coords +metric = diag(-rh ** 4, rh ** 4, rh ** 4, 1 / rh ** 2) del t, rh, z, ph diff --git a/src/riccipy/metrics/levi_civita_8.py b/src/riccipy/metrics/levi_civita_8.py index 66ab1fb..85dbd89 100644 --- a/src/riccipy/metrics/levi_civita_8.py +++ b/src/riccipy/metrics/levi_civita_8.py @@ -1,8 +1,15 @@ # Levi-Civita static vacuum solution -_coords = symbols('t rho z phi', real=True) -_vars = symbols('m', constant=True) -_funs = () -t, rh, z, ph = _coords -m = _vars -_metric = diag(-rh**(2*m), rh**(2*(m**2-m)), rh**(2*(m**2-m)), rh**(2*(1-m))) +from sympy import diag, symbols + +coords = symbols("t rho z phi", real=True) +variables = symbols("m", constant=True) +functions = () +t, rh, z, ph = coords +m = variables +metric = diag( + -rh ** (2 * m), + rh ** (2 * (m ** 2 - m)), + rh ** (2 * (m ** 2 - m)), + rh ** (2 * (1 - m)), +) del t, rh, z, ph, m diff --git a/src/riccipy/metrics/lewis_papapetrou.py b/src/riccipy/metrics/lewis_papapetrou.py index f0a95be..43a9753 100644 --- a/src/riccipy/metrics/lewis_papapetrou.py +++ b/src/riccipy/metrics/lewis_papapetrou.py @@ -1,12 +1,16 @@ # Lewis Papapetrou metric -_coords = symbols('t x y z', real=True) -_vars = () -_funs = symbols('k r s w', cls=Function) -t, x, y, z = _coords -k, r, s, w = _funs -_metric = zeros(4) -_metric[0,0] = -exp(2*s(x,y)) -_metric[3,3] = (exp(-s(x,y))*r(x,y)-w(x,y)*exp(s(x,y)))*(exp(-s(x,y))*r(x,y)+w(x,y)*exp(s(x,y))) -_metric[0,3] = _metric[3,0] = -w(x,y)*exp(2*s(x,y)) -_metric[1,2] = _metric[2,1] = Rational(1,2)*exp(2*k(x,y)-2*s(x,y)) +from sympy import Function, Rational, exp, symbols, zeros + +coords = symbols("t x y z", real=True) +variables = () +functions = symbols("k r s w", cls=Function) +t, x, y, z = coords +k, r, s, w = functions +metric = zeros(4) +metric[0, 0] = -exp(2 * s(x, y)) +metric[3, 3] = (exp(-s(x, y)) * r(x, y) - w(x, y) * exp(s(x, y))) * ( + exp(-s(x, y)) * r(x, y) + w(x, y) * exp(s(x, y)) +) +metric[0, 3] = metric[3, 0] = -w(x, y) * exp(2 * s(x, y)) +metric[1, 2] = metric[2, 1] = Rational(1, 2) * exp(2 * k(x, y) - 2 * s(x, y)) del t, x, y, z, k, r, s, w diff --git a/src/riccipy/metrics/lrs.py b/src/riccipy/metrics/lrs.py index 6696040..3b18402 100644 --- a/src/riccipy/metrics/lrs.py +++ b/src/riccipy/metrics/lrs.py @@ -1,8 +1,10 @@ # LRS stiff perfect fluid cosmological solution with G4 on S3 -_coords = symbols('t x y z', real=True) -_vars = symbols('k', constant=True) -_funs = () -t, x, y, z = _coords -k = _vars -_metric = diag(-1, t**(2/k), t**(1-1/k), t**(1-1/k)) +from sympy import diag, symbols + +coords = symbols("t x y z", real=True) +variables = symbols("k", constant=True) +functions = () +t, x, y, z = coords +k = variables +metric = diag(-1, t ** (2 / k), t ** (1 - 1 / k), t ** (1 - 1 / k)) del t, x, y, z, k diff --git a/src/riccipy/metrics/mclenaghan_tariq_tupper.py b/src/riccipy/metrics/mclenaghan_tariq_tupper.py index 1a6576f..fadfef1 100644 --- a/src/riccipy/metrics/mclenaghan_tariq_tupper.py +++ b/src/riccipy/metrics/mclenaghan_tariq_tupper.py @@ -1,8 +1,10 @@ # McLenaghan Tariq Tupper metric -_coords = symbols('t x y phi', real=True) -_vars = symbols('a', constant=True) -_funs = () -t, x, y, ph = _coords -_metric = diag(-1, a**2/x**2, a**2/x**2, x**2-4*y**2) -_metric[0,3] = _metric[3,0] = 2*y +from sympy import diag, symbols + +coords = symbols("t x y phi", real=True) +variables = symbols("a", constant=True) +functions = () +t, x, y, ph = coords +metric = diag(-1, a ** 2 / x ** 2, a ** 2 / x ** 2, x ** 2 - 4 * y ** 2) +metric[0, 3] = metric[3, 0] = 2 * y del t, x, y, ph diff --git a/src/riccipy/metrics/mcvittie.py b/src/riccipy/metrics/mcvittie.py index d178a9e..ecc9012 100644 --- a/src/riccipy/metrics/mcvittie.py +++ b/src/riccipy/metrics/mcvittie.py @@ -1,8 +1,10 @@ # McVittie's plane Einstein-Maxwell field with Lambda=0 -_coords = symbols('t x y z', real=True) -_vars = symbols('M Q', constant=True) -_funs = () -t, x, y, z = _coords -M, Q = _vars -_metric = diag(-(M/z+Q**2/z**2), z**2, z**2, 1/(M/z+Q**2/z**2)) +from sympy import diag, symbols + +coords = symbols("t x y z", real=True) +variables = symbols("M Q", constant=True) +functions = () +t, x, y, z = coords +M, Q = variables +metric = diag(-(M / z + Q ** 2 / z ** 2), z ** 2, z ** 2, 1 / (M / z + Q ** 2 / z ** 2)) del t, x, y, z, M, Q diff --git a/src/riccipy/metrics/melvin.py b/src/riccipy/metrics/melvin.py index 647383f..e9d351a 100644 --- a/src/riccipy/metrics/melvin.py +++ b/src/riccipy/metrics/melvin.py @@ -1,9 +1,11 @@ # Melvin's magnetic universe -_coords = symbols('t rho z phi', real=True) -_vars = symbols('B_0', constant=True) -_funs = () -t, rh, z, ph = _coords -B0 = _vars -expr = (1+B0**2*rh**2/4)**2 -_metric = diag(-expr, expr, expr, rh**2/expr) +from sympy import diag, symbols + +coords = symbols("t rho z phi", real=True) +variables = symbols("B_0", constant=True) +functions = () +t, rh, z, ph = coords +B0 = variables +expr = (1 + B0 ** 2 * rh ** 2 / 4) ** 2 +metric = diag(-expr, expr, expr, rh ** 2 / expr) del expr, t, rh, z, ph, B0 diff --git a/src/riccipy/metrics/minkowski_1.py b/src/riccipy/metrics/minkowski_1.py index 3458a8d..4d6638a 100644 --- a/src/riccipy/metrics/minkowski_1.py +++ b/src/riccipy/metrics/minkowski_1.py @@ -1,5 +1,7 @@ # Minkowski space in Cartesian coordinates -_coords = symbols('t x y z', real=True) -_vars = () -_funs = () -_metric = diag(-1, 1, 1, 1) +from sympy import diag, symbols + +coords = symbols("t x y z", real=True) +variables = () +functions = () +metric = diag(-1, 1, 1, 1) diff --git a/src/riccipy/metrics/minkowski_2.py b/src/riccipy/metrics/minkowski_2.py index c5790e3..9c1c9b5 100644 --- a/src/riccipy/metrics/minkowski_2.py +++ b/src/riccipy/metrics/minkowski_2.py @@ -1,7 +1,9 @@ # Minkowski space in polar coordinates -_coords = symbols('t r theta phi', real=True) -_vars = () -_funs = () -t, r, th, ph = _coords -_metric = diag(-1, 1, r**2, r**2*sin(th)**2) +from sympy import diag, sin, symbols + +coords = symbols("t r theta phi", real=True) +variables = () +functions = () +t, r, th, ph = coords +metric = diag(-1, 1, r ** 2, r ** 2 * sin(th) ** 2) del t, r, th, ph diff --git a/src/riccipy/metrics/minkowski_3.py b/src/riccipy/metrics/minkowski_3.py index 46d2c76..e30b632 100644 --- a/src/riccipy/metrics/minkowski_3.py +++ b/src/riccipy/metrics/minkowski_3.py @@ -1,11 +1,13 @@ # Minkowski space in null coordinates -_coords = symbols('u v theta phi', real=True) -_vars = symbols('a b', constant=True) -_funs = () -u, v, th, ph = _coords -a, b = _vars -_metric = zeros(4) -_metric[2,2] = (a*u-Rational(1,2)*v/a+c)**2 -_metric[3,3] = (a*u-Rational(1,2)*v/a+c)**2*sin(th)**2 -_metric[0,1] = _metric[1,0] = -1 +from sympy import Rational, sin, symbols, zeros + +coords = symbols("u v theta phi", real=True) +variables = symbols("a b", constant=True) +functions = () +u, v, th, ph = coords +a, b = variables +metric = zeros(4) +metric[2, 2] = (a * u - Rational(1, 2) * v / a + c) ** 2 +metric[3, 3] = (a * u - Rational(1, 2) * v / a + c) ** 2 * sin(th) ** 2 +metric[0, 1] = metric[1, 0] = -1 del u, v, th, ph, a, b diff --git a/src/riccipy/metrics/nariai.py b/src/riccipy/metrics/nariai.py index 9125e31..1a53f03 100644 --- a/src/riccipy/metrics/nariai.py +++ b/src/riccipy/metrics/nariai.py @@ -1,11 +1,13 @@ # Nariai vacuum metric -_coords = symbols('t x y z', real=True) -_vars = symbols('lambda', constant=True) -_funs = symbols('a b', cls=Function) -t, x, y, z = _coords -la = _vars -a, b = _funs -expr1 = x**2+y**2+z**2 -expr2 = a(t)*cos(log(sqrt(expr1)/la)) + b(t)*sin(log(sqrt(expr1)/la)) -_metric = diag(-expr2, la**2/expr1, la**2/expr1, la**2/expr1) +from sympy import Function, cos, diag, log, sin, sqrt, symbols + +coords = symbols("t x y z", real=True) +variables = symbols("lambda", constant=True) +functions = symbols("a b", cls=Function) +t, x, y, z = coords +la = variables +a, b = functions +expr1 = x ** 2 + y ** 2 + z ** 2 +expr2 = a(t) * cos(log(sqrt(expr1) / la)) + b(t) * sin(log(sqrt(expr1) / la)) +metric = diag(-expr2, la ** 2 / expr1, la ** 2 / expr1, la ** 2 / expr1) del expr1, expr2, t, x, y, z, la, a, b diff --git a/src/riccipy/metrics/novotny_horsky.py b/src/riccipy/metrics/novotny_horsky.py index b895ab1..6b6c64f 100644 --- a/src/riccipy/metrics/novotny_horsky.py +++ b/src/riccipy/metrics/novotny_horsky.py @@ -1,8 +1,15 @@ # Novotny and Horsky plane symmetric vacuum metric -_coords = symbols('t x y z', real=True) -_vars = symbols('a', constant=True) -_funs = () -t, x, y, z = _coords -a = _vars -_metric = diag(-cos(z)/sin(z)**Rational(2,3), sin(z)**Rational(4,3), sin(z)**Rational(4,3), 1/a**2) +from sympy import Rational, cos, diag, sin, symbols + +coords = symbols("t x y z", real=True) +variables = symbols("a", constant=True) +functions = () +t, x, y, z = coords +a = variables +metric = diag( + -cos(z) / sin(z) ** Rational(2, 3), + sin(z) ** Rational(4, 3), + sin(z) ** Rational(4, 3), + 1 / a ** 2, +) del t, x, y, z, a diff --git a/src/riccipy/metrics/pant_sah.py b/src/riccipy/metrics/pant_sah.py index 16a89df..d51baf3 100644 --- a/src/riccipy/metrics/pant_sah.py +++ b/src/riccipy/metrics/pant_sah.py @@ -1,8 +1,10 @@ # Pant and Sah charged static spherically symmetric solution -_coords = symbols('t r theta phi', real=True) -_vars = symbols('A n', constant=True) -_funs = () -t, r, th, ph = _coords -A, n = _vars -_metric = diag(-A*r**(2*n), n**2+1, r**2, r**2*sin(th)**2) +from sympy import diag, sin, symbols + +coords = symbols("t r theta phi", real=True) +variables = symbols("A n", constant=True) +functions = () +t, r, th, ph = coords +A, n = variables +metric = diag(-A * r ** (2 * n), n ** 2 + 1, r ** 2, r ** 2 * sin(th) ** 2) del t, r, th, ph, A, n diff --git a/src/riccipy/metrics/plane_symmetric.py b/src/riccipy/metrics/plane_symmetric.py index 67afbc2..abcee3d 100644 --- a/src/riccipy/metrics/plane_symmetric.py +++ b/src/riccipy/metrics/plane_symmetric.py @@ -1,8 +1,10 @@ # Bianchi I plane symmetric model -_coords = symbols('t x y z', real=True) -_vars = () -_funs = symbols('alpha beta', cls=Function) -t, x, y, z = _coords -al, be = _funs -_metric = diag(-1, exp(2*be(t)), exp(2*be(t)), exp(2*al(t))) +from sympy import Function, diag, exp, symbols + +coords = symbols("t x y z", real=True) +variables = () +functions = symbols("alpha beta", cls=Function) +t, x, y, z = coords +al, be = functions +metric = diag(-1, exp(2 * be(t)), exp(2 * be(t)), exp(2 * al(t))) del t, x, y, z, al, be diff --git a/src/riccipy/metrics/reissner_nordstrom_1.py b/src/riccipy/metrics/reissner_nordstrom_1.py index df1da35..8606dd3 100644 --- a/src/riccipy/metrics/reissner_nordstrom_1.py +++ b/src/riccipy/metrics/reissner_nordstrom_1.py @@ -1,9 +1,11 @@ # Reissner-Nordstrom spherically symmetric electro-vacuum solution -_coords = symbols('t r theta phi', real=True) -_vars = symbols('M Q', constant=True) -_funs = () -t, r, th, ph = _coords -M, Q = _vars -expr = 1-2*M/r+Q**2/r**2 -_metric = diag(-expr, 1/expr, r**2, r**2*sin(th)**2) +from sympy import diag, sin, symbols + +coords = symbols("t r theta phi", real=True) +variables = symbols("M Q", constant=True) +functions = () +t, r, th, ph = coords +M, Q = variables +expr = 1 - 2 * M / r + Q ** 2 / r ** 2 +metric = diag(-expr, 1 / expr, r ** 2, r ** 2 * sin(th) ** 2) del expr, t, r, th, ph, M, Q diff --git a/src/riccipy/metrics/reissner_nordstrom_2.py b/src/riccipy/metrics/reissner_nordstrom_2.py index 33e9b16..13d86ca 100644 --- a/src/riccipy/metrics/reissner_nordstrom_2.py +++ b/src/riccipy/metrics/reissner_nordstrom_2.py @@ -1,9 +1,11 @@ # Reissner-Nordstrom spherically symmetric electro-vacuum solution with non-zero cosmological constant -_coords = symbols('t r theta phi', real=True) -_vars = symbols('M Q Lambda', constant=True) -_funs = () -t, r, th, ph = _coords -M, Q, La = _vars -expr = 1-2*M/r+Q**2/r**2-La*r**2/3 -_metric = diag(-expr, 1/expr, r**2, r**2*sin(th)**2) +from sympy import diag, sin, symbols + +coords = symbols("t r theta phi", real=True) +variables = symbols("M Q Lambda", constant=True) +functions = () +t, r, th, ph = coords +M, Q, La = variables +expr = 1 - 2 * M / r + Q ** 2 / r ** 2 - La * r ** 2 / 3 +metric = diag(-expr, 1 / expr, r ** 2, r ** 2 * sin(th) ** 2) del expr, t, r, th, ph, M, Q diff --git a/src/riccipy/metrics/robertson_walker_1.py b/src/riccipy/metrics/robertson_walker_1.py index a9eafd7..3577b97 100644 --- a/src/riccipy/metrics/robertson_walker_1.py +++ b/src/riccipy/metrics/robertson_walker_1.py @@ -1,8 +1,12 @@ # Closed Friedman-Robertson-Walker metric. Perfect fluid -_coords = symbols('t r theta phi', real=True) -_vars = () -_funs = symbols('a', cls=Function) -t, r, th, ph = _coords -a = _funs -_metric = diag(-1, a(t)**2, a(t)**2*sin(r)**2, a(t)**2*sin(r)**2*sin(th)**2) +from sympy import Function, diag, sin, symbols + +coords = symbols("t r theta phi", real=True) +variables = () +functions = symbols("a", cls=Function) +t, r, th, ph = coords +a = functions +metric = diag( + -1, a(t) ** 2, a(t) ** 2 * sin(r) ** 2, a(t) ** 2 * sin(r) ** 2 * sin(th) ** 2 +) del t, r, th, ph, a diff --git a/src/riccipy/metrics/robertson_walker_2.py b/src/riccipy/metrics/robertson_walker_2.py index 78087f2..0c5ad0a 100644 --- a/src/riccipy/metrics/robertson_walker_2.py +++ b/src/riccipy/metrics/robertson_walker_2.py @@ -1,8 +1,10 @@ # Spatially flat Friedman-Robertson-Walker metric. Perfect fluid -_coords = symbols('t r theta phi', real=True) -_vars = () -_funs = symbols('a', cls=Function) -t, r, th, ph = _coords -a = _funs -_metric = diag(-1, a(t)**2, a(t)**2*r**2, a(t)**2*r**2*sin(th)**2) +from sympy import Function, diag, sin, symbols + +coords = symbols("t r theta phi", real=True) +variables = () +functions = symbols("a", cls=Function) +t, r, th, ph = coords +a = functions +metric = diag(-1, a(t) ** 2, a(t) ** 2 * r ** 2, a(t) ** 2 * r ** 2 * sin(th) ** 2) del t, r, th, ph, a diff --git a/src/riccipy/metrics/robertson_walker_3.py b/src/riccipy/metrics/robertson_walker_3.py index 09beea8..d2e7ff3 100644 --- a/src/riccipy/metrics/robertson_walker_3.py +++ b/src/riccipy/metrics/robertson_walker_3.py @@ -1,9 +1,11 @@ # Closed Friedman-Robertson-Walker metric. Dust -_coords = symbols('nu chi theta phi', real=True) -_vars = symbols('A_0', constant=True) -_funs = () -nu, ch, th, ph = _coords -A0 = _vars -expr = A0**2*(1-cos(nu))**2 -_metric = diag(-expr, expr, expr*sin(ch)**2, expr*sin(ch)**2*sin(th)**2) +from sympy import cos, diag, sin, symbols + +coords = symbols("nu chi theta phi", real=True) +variables = symbols("A_0", constant=True) +functions = () +nu, ch, th, ph = coords +A0 = variables +expr = A0 ** 2 * (1 - cos(nu)) ** 2 +metric = diag(-expr, expr, expr * sin(ch) ** 2, expr * sin(ch) ** 2 * sin(th) ** 2) del expr, nu, ch, th, ph, A0 diff --git a/src/riccipy/metrics/schwarzschild_1.py b/src/riccipy/metrics/schwarzschild_1.py index 4b865ff..951cd81 100644 --- a/src/riccipy/metrics/schwarzschild_1.py +++ b/src/riccipy/metrics/schwarzschild_1.py @@ -1,8 +1,10 @@ # Schwarzschild exterior metric in curvature coordinates -_coords = symbols('t r theta phi', real=True) -_vars = symbols('M', constant=True) -_funs = () -t, r, th, ph = _coords -M = _vars -_metric = diag(-(1-2*M/r), 1/(1-2*M/r), r**2, r**2*sin(th)**2) +from sympy import diag, sin, symbols + +coords = symbols("t r theta phi", real=True) +variables = symbols("M", constant=True) +functions = () +t, r, th, ph = coords +M = variables +metric = diag(-(1 - 2 * M / r), 1 / (1 - 2 * M / r), r ** 2, r ** 2 * sin(th) ** 2) del t, r, th, ph, M diff --git a/src/riccipy/metrics/schwarzschild_2.py b/src/riccipy/metrics/schwarzschild_2.py index 7b59ec2..76ebf1a 100644 --- a/src/riccipy/metrics/schwarzschild_2.py +++ b/src/riccipy/metrics/schwarzschild_2.py @@ -1,9 +1,11 @@ # Schwarzschild metric in outgoing Eddington-Finkelstein coordinates -_coords = symbols('r u theta phi', real=True) -_vars = symbols('M', constant=True) -_funs = () -r, u, th, ph = _coords -M = _vars -_metric = diag(0, -(1-2*M/r), r**2, r**2*sin(th)**2) -_metric[0,1] = _metric[1,0] = -1 +from sympy import diag, sin, symbols + +coords = symbols("r u theta phi", real=True) +variables = symbols("M", constant=True) +functions = () +r, u, th, ph = coords +M = variables +metric = diag(0, -(1 - 2 * M / r), r ** 2, r ** 2 * sin(th) ** 2) +metric[0, 1] = metric[1, 0] = -1 del r, u, th, ph, M diff --git a/src/riccipy/metrics/schwarzschild_3.py b/src/riccipy/metrics/schwarzschild_3.py index 6b8dddf..d10884e 100644 --- a/src/riccipy/metrics/schwarzschild_3.py +++ b/src/riccipy/metrics/schwarzschild_3.py @@ -1,9 +1,11 @@ # Schwarzschild metric in ingoing Eddington-Finkelstein coordinates -_coords = symbols('r v theta phi', real=True) -_vars = symbols('M', constant=True) -_funs = () -r, v, th, ph = _coords -M = _vars -_metric = diag(0, -(1-2*M/r), r**2, r**2*sin(th)**2) -_metric[0,1] = _metric[1,0] = 1 +from sympy import diag, sin, symbols + +coords = symbols("r v theta phi", real=True) +variables = symbols("M", constant=True) +functions = () +r, v, th, ph = coords +M = variables +metric = diag(0, -(1 - 2 * M / r), r ** 2, r ** 2 * sin(th) ** 2) +metric[0, 1] = metric[1, 0] = 1 del r, v, th, ph, M diff --git a/src/riccipy/metrics/schwarzschild_4.py b/src/riccipy/metrics/schwarzschild_4.py index 2eca2ed..7a801b8 100644 --- a/src/riccipy/metrics/schwarzschild_4.py +++ b/src/riccipy/metrics/schwarzschild_4.py @@ -1,9 +1,16 @@ # Schwarzschild exterior metric in isotropic coordinates -_coords = symbols('t r theta phi', real=True) -_vars = symbols('M', constant=True) -_funs = () -t, r, th, ph = _coords -M = _vars -expr = (1+Rational(1,2)*M/r)**4 -_metric = diag(-(1-Rational(1,2)*M/r)**2/(1+Rational(1,2)*M/r)**2, expr, expr*r**2, expr*r**2*sin(th)**2) +from sympy import Rational, diag, sin, symbols + +coords = symbols("t r theta phi", real=True) +variables = symbols("M", constant=True) +functions = () +t, r, th, ph = coords +M = variables +expr = (1 + Rational(1, 2) * M / r) ** 4 +metric = diag( + -(1 - Rational(1, 2) * M / r) ** 2 / (1 + Rational(1, 2) * M / r) ** 2, + expr, + expr * r ** 2, + expr * r ** 2 * sin(th) ** 2, +) del expr, t, r, th, ph, M diff --git a/src/riccipy/metrics/schwarzschild_5.py b/src/riccipy/metrics/schwarzschild_5.py index 73a85da..fdd5001 100644 --- a/src/riccipy/metrics/schwarzschild_5.py +++ b/src/riccipy/metrics/schwarzschild_5.py @@ -1,10 +1,17 @@ # Schwarzschild exterior metric in Cartesian isotropic coordinates -_coords = symbols('t x y z', real=True) -_vars = symbols('M', constant=True) -_funs = () -t, x, y, z = _coords -M = _vars -expr1 = sqrt(x**2+y**2+z**2) -expr2 = (1+Rational(1,2)*M/expr1)**4 -_metric = diag(-(1-Rational(1,2)*M/expr1)**2/(1+Rational(1,2)*M/expr1)**2, expr2, expr2, expr2) +from sympy import Rational, diag, sqrt, symbols + +coords = symbols("t x y z", real=True) +variables = symbols("M", constant=True) +functions = () +t, x, y, z = coords +M = variables +expr1 = sqrt(x ** 2 + y ** 2 + z ** 2) +expr2 = (1 + Rational(1, 2) * M / expr1) ** 4 +metric = diag( + -(1 - Rational(1, 2) * M / expr1) ** 2 / (1 + Rational(1, 2) * M / expr1) ** 2, + expr2, + expr2, + expr2, +) del expr1, expr2, t, x, y, z, M diff --git a/src/riccipy/metrics/schwarzschild_6.py b/src/riccipy/metrics/schwarzschild_6.py index 99121ca..2bcb735 100644 --- a/src/riccipy/metrics/schwarzschild_6.py +++ b/src/riccipy/metrics/schwarzschild_6.py @@ -1,10 +1,14 @@ # Schwarzschild exterior metric in Israel coordinates -_coords = symbols('u w theta phi', real=True) -_vars = symbols('M', constant=True) -_funs = () -u, w, th, ph = _coords -M = _vars -expr = 2*M+Rational(1,4)*u*w/M -_metric = diag(Rational(1,2)*w**2/(M*expr), 0, expr**2, expr**2*sin(th)**2) -_metric[0,1] = _metric[1,0] = 1 +from sympy import Rational, diag, sin, symbols + +coords = symbols("u w theta phi", real=True) +variables = symbols("M", constant=True) +functions = () +u, w, th, ph = coords +M = variables +expr = 2 * M + Rational(1, 4) * u * w / M +metric = diag( + Rational(1, 2) * w ** 2 / (M * expr), 0, expr ** 2, expr ** 2 * sin(th) ** 2 +) +metric[0, 1] = metric[1, 0] = 1 del expr, u, w, th, ph, M diff --git a/src/riccipy/metrics/schwarzschild_7.py b/src/riccipy/metrics/schwarzschild_7.py index 4321378..ea1508b 100644 --- a/src/riccipy/metrics/schwarzschild_7.py +++ b/src/riccipy/metrics/schwarzschild_7.py @@ -1,9 +1,16 @@ # Schwarzschild metric as the rho->0 limit of Tolman-Bondi dust -_coords = symbols('t r theta phi', real=True) -_vars = symbols('M', constant=True) -_funs = () -t, r, th, ph = _coords -M = _vars -expr = M*(r-t)**2 -_metric = diag(-1, Rational(4,9)*M/expr**Rational(1,3), expr**Rational(2,3), expr**Rational(2,3)*sin(th)**2) +from sympy import Rational, diag, sin, symbols + +coords = symbols("t r theta phi", real=True) +variables = symbols("M", constant=True) +functions = () +t, r, th, ph = coords +M = variables +expr = M * (r - t) ** 2 +metric = diag( + -1, + Rational(4, 9) * M / expr ** Rational(1, 3), + expr ** Rational(2, 3), + expr ** Rational(2, 3) * sin(th) ** 2, +) del expr, t, r, th, ph, M diff --git a/src/riccipy/metrics/schwarzschild_8.py b/src/riccipy/metrics/schwarzschild_8.py index 464da30..ac23650 100644 --- a/src/riccipy/metrics/schwarzschild_8.py +++ b/src/riccipy/metrics/schwarzschild_8.py @@ -1,8 +1,15 @@ # Schwarzschild interior solution in curvature coordinates -_coords = symbols('t r theta phi', real=True) -_vars = symbols('A B R', constant=True) -_funs = () -t, r, th, ph = _coords -A, B, R = _vars -_metric = diag(-(A-B*sqrt(1-r**2/R**2))**2, 1/(1-r**2/R**2), r**2, r**2*sin(th)**2) +from sympy import diag, sin, sqrt, symbols + +coords = symbols("t r theta phi", real=True) +variables = symbols("A B R", constant=True) +functions = () +t, r, th, ph = coords +A, B, R = variables +metric = diag( + -(A - B * sqrt(1 - r ** 2 / R ** 2)) ** 2, + 1 / (1 - r ** 2 / R ** 2), + r ** 2, + r ** 2 * sin(th) ** 2, +) del t, r, th, ph, A, B, R diff --git a/src/riccipy/metrics/static_spherical_1.py b/src/riccipy/metrics/static_spherical_1.py index 3a2a63b..e2281c5 100644 --- a/src/riccipy/metrics/static_spherical_1.py +++ b/src/riccipy/metrics/static_spherical_1.py @@ -1,8 +1,10 @@ # General static, spherically symmetric metric in curvature coordinates -_coords = symbols('t r theta phi', real=True) -_vars = () -_funs = symbolic('alpha beta', cls=Function) -t, r, th, ph = _coords -al, be = _funs -_metric = diag(-exp(2*al(r)), exp(2*be(r)), r**2, r**2*sin(th)**2) +from sympy import Function, diag, exp, sin, symbols + +coords = symbols("t r theta phi", real=True) +variables = () +functions = symbolic("alpha beta", cls=Function) +t, r, th, ph = coords +al, be = functions +metric = diag(-exp(2 * al(r)), exp(2 * be(r)), r ** 2, r ** 2 * sin(th) ** 2) del t, r, th, ph, al, be diff --git a/src/riccipy/metrics/static_spherical_2.py b/src/riccipy/metrics/static_spherical_2.py index 8ffbfb8..54c0bff 100644 --- a/src/riccipy/metrics/static_spherical_2.py +++ b/src/riccipy/metrics/static_spherical_2.py @@ -1,8 +1,15 @@ # General static, spherically symmetric metric in curvature coordinates -_coords = symbols('t r theta phi', real=True) -_vars = () -_funs = symbolic('alpha beta', cls=Function) -t, r, th, ph = _coords -al, be = _funs -_metric = diag(-exp(2*al(r)), exp(2*be(r)), exp(2*be(r))*r**2, exp(2*be(r))*r**2*sin(th)**2) +from sympy import Function, diag, exp, sin, symbols + +coords = symbols("t r theta phi", real=True) +variables = () +functions = symbols("alpha beta", cls=Function) +t, r, th, ph = coords +al, be = functions +metric = diag( + -exp(2 * al(r)), + exp(2 * be(r)), + exp(2 * be(r)) * r ** 2, + exp(2 * be(r)) * r ** 2 * sin(th) ** 2, +) del t, r, th, ph, al, be diff --git a/src/riccipy/metrics/szekeres_1.py b/src/riccipy/metrics/szekeres_1.py index 2010736..f285a89 100644 --- a/src/riccipy/metrics/szekeres_1.py +++ b/src/riccipy/metrics/szekeres_1.py @@ -1,7 +1,11 @@ # Szekeres solution for a special stiff perfect fluid -_coords = symbols('t x y z', real=True) -_vars = () -_funs = () -t, x, y, z = _coords -_metric = diag(-x**6, x**4*cos(2*t)**2, x**2/cos(2*t), x**2/cos(2*t)) +from sympy import cos, diag, symbols + +coords = symbols("t x y z", real=True) +variables = () +functions = () +t, x, y, z = coords +metric = diag( + -x ** 6, x ** 4 * cos(2 * t) ** 2, x ** 2 / cos(2 * t), x ** 2 / cos(2 * t) +) del t, x, y, z diff --git a/src/riccipy/metrics/szekeres_2.py b/src/riccipy/metrics/szekeres_2.py index c1ad30a..218ceef 100644 --- a/src/riccipy/metrics/szekeres_2.py +++ b/src/riccipy/metrics/szekeres_2.py @@ -1,7 +1,14 @@ # Szekeres solution for a special stiff perfect fluid in Abelian type coordinates -_coords = symbols('t x y z', real=True) -_vars = () -_funs = () -t, x, y, z = _coords -_metric = diag(-exp(6*x)/cosh(2*t)**2, exp(6*x)/cosh(2*t)**2, exp(2*x)*cosh(2*t), exp(2*x)*cosh(2*t)) +from sympy import cosh, diag, exp, symbols + +coords = symbols("t x y z", real=True) +variables = () +functions = () +t, x, y, z = coords +metric = diag( + -exp(6 * x) / cosh(2 * t) ** 2, + exp(6 * x) / cosh(2 * t) ** 2, + exp(2 * x) * cosh(2 * t), + exp(2 * x) * cosh(2 * t), +) del t, x, y, z diff --git a/src/riccipy/metrics/tariq_tupper.py b/src/riccipy/metrics/tariq_tupper.py index d4c379f..f11fa34 100644 --- a/src/riccipy/metrics/tariq_tupper.py +++ b/src/riccipy/metrics/tariq_tupper.py @@ -1,7 +1,9 @@ # Tariq and Tupper metric admitting a G3VIo on S3 -_coords = symbols('t x y z', real=True) -_vars = () -_funs = () -t, x, y, z = _coords -_metric = diag(-1, 4*t**2/3, t/exp(2*x), t*exp(2*x)) +from sympy import diag, exp, symbols + +coords = symbols("t x y z", real=True) +variables = () +functions = () +t, x, y, z = coords +metric = diag(-1, 4 * t ** 2 / 3, t / exp(2 * x), t * exp(2 * x)) del t, x, y, z diff --git a/src/riccipy/metrics/taub_1.py b/src/riccipy/metrics/taub_1.py index d207d2c..ce673c3 100644 --- a/src/riccipy/metrics/taub_1.py +++ b/src/riccipy/metrics/taub_1.py @@ -1,8 +1,10 @@ # Taub metric for plane symmetric, static perfect fluid. -_coords = symbols('t x y z', real=True) -_vars = symbols('mu', constant=True) -_funs = () -t, x, y, z = _coords -mu = _vars -_metric = diag(-(z-3)**2, z**2, z**2, 3/(mu*z**2)) +from sympy import diag, symbols + +coords = symbols("t x y z", real=True) +variables = symbols("mu", constant=True) +functions = () +t, x, y, z = coords +mu = variables +metric = diag(-(z - 3) ** 2, z ** 2, z ** 2, 3 / (mu * z ** 2)) del t, x, y, z, mu diff --git a/src/riccipy/metrics/taub_2.py b/src/riccipy/metrics/taub_2.py index ff8e2c9..6bdb442 100644 --- a/src/riccipy/metrics/taub_2.py +++ b/src/riccipy/metrics/taub_2.py @@ -1,7 +1,9 @@ # Taub's plane symmetric vacuum solution -_coords = symbols('t x y z', real=True) -_vars = () -_funs = () -t, x, y, z = _coords -_metric = diag(-1/sqrt(z), z, z, 1/sqrt(z)) +from sympy import diag, sqrt, symbols + +coords = symbols("t x y z", real=True) +variables = () +functions = () +t, x, y, z = coords +metric = diag(-1 / sqrt(z), z, z, 1 / sqrt(z)) del t, x, y, z diff --git a/src/riccipy/metrics/tolman_1.py b/src/riccipy/metrics/tolman_1.py index c83e97c..0795399 100644 --- a/src/riccipy/metrics/tolman_1.py +++ b/src/riccipy/metrics/tolman_1.py @@ -1,8 +1,15 @@ # Tolman's type IV solution -_coords = symbols('t r theta phi', real=True) -_vars = symbols('A B R', constant=True) -_funs = () -t, r, th, ph = _coords -A, B, R = _vars -_metric = diag(-B**2*(1+r**2/A**2), (1+2*r**2/A**2)/((1+r**2/A**2)*(1-r**2/R**2)), r**2, r**2*sin(th)**2) +from sympy import diag, sin, symbols + +coords = symbols("t r theta phi", real=True) +variables = symbols("A B R", constant=True) +functions = () +t, r, th, ph = coords +A, B, R = variables +metric = diag( + -B ** 2 * (1 + r ** 2 / A ** 2), + (1 + 2 * r ** 2 / A ** 2) / ((1 + r ** 2 / A ** 2) * (1 - r ** 2 / R ** 2)), + r ** 2, + r ** 2 * sin(th) ** 2, +) del t, r, th, ph, A, B, R diff --git a/src/riccipy/metrics/tolman_2.py b/src/riccipy/metrics/tolman_2.py index 5fa8b03..4f19d12 100644 --- a/src/riccipy/metrics/tolman_2.py +++ b/src/riccipy/metrics/tolman_2.py @@ -1,8 +1,15 @@ # Tolman's type VI solution -_coords = symbols('t r theta phi', real=True) -_vars = symbols('A B n', constant=True) -_funs = () -t, r, th, ph = _coords -A, B, n = _vars -_metric = diag(-(A*r**(1-n)-B*r**(1+n))**2, 2-n**2, r**2, r**2*sin(th)**2) +from sympy import diag, sin, symbols + +coords = symbols("t r theta phi", real=True) +variables = symbols("A B n", constant=True) +functions = () +t, r, th, ph = coords +A, B, n = variables +metric = diag( + -(A * r ** (1 - n) - B * r ** (1 + n)) ** 2, + 2 - n ** 2, + r ** 2, + r ** 2 * sin(th) ** 2, +) del t, r, th, ph, A, B, n diff --git a/src/riccipy/metrics/tolman_3.py b/src/riccipy/metrics/tolman_3.py index 7dd1697..27a21dd 100644 --- a/src/riccipy/metrics/tolman_3.py +++ b/src/riccipy/metrics/tolman_3.py @@ -1,10 +1,16 @@ # Tolman's type VII static spherically symmetric perfect fluid solution -_coords = symbols('t r theta phi', real=True) -_vars = symbols('A B C R', constant=True) -_funs = () -t, r, th, ph = _coords -A, B, C, R = _vars -expr1 = 1-r**2/R**2+4*r**4/A**4 -expr2 = sin(log(sqrt((sqrt(expr1)+2*r**2/A**2-Rational(1,4)*A**2/R**2)/C))) -_metric = diag(-B**2*expr2**2, 1/expr1, r**2, r**2*sin(th)**2) +from sympy import Rational, diag, log, sin, sqrt, symbols + +coords = symbols("t r theta phi", real=True) +variables = symbols("A B C R", constant=True) +functions = () +t, r, th, ph = coords +A, B, C, R = variables +expr1 = 1 - r ** 2 / R ** 2 + 4 * r ** 4 / A ** 4 +expr2 = sin( + log( + sqrt((sqrt(expr1) + 2 * r ** 2 / A ** 2 - Rational(1, 4) * A ** 2 / R ** 2) / C) + ) +) +metric = diag(-B ** 2 * expr2 ** 2, 1 / expr1, r ** 2, r ** 2 * sin(th) ** 2) del expr1, expr2, t, r, th, ph, A, B, C, R diff --git a/src/riccipy/metrics/vaidya_1.py b/src/riccipy/metrics/vaidya_1.py index b31a2d6..7a0da72 100644 --- a/src/riccipy/metrics/vaidya_1.py +++ b/src/riccipy/metrics/vaidya_1.py @@ -1,9 +1,11 @@ # Vaidya metric in outgoing Eddington-Finkelstein coordinates -_coords = symbols('r v theta phi', real=True) -_vars = () -_funs = symbols('M', cls=Function) -r, v, th, ph = _coords -M = _funs -_metric = diag(0, -(1-2*M(v)/r), r**2, r**2*sin(th)**2) -_metric[0,1] = _metric[1,0] = -1 +from sympy import Function, diag, sin, symbols + +coords = symbols("r v theta phi", real=True) +variables = () +functions = symbols("M", cls=Function) +r, v, th, ph = coords +M = functions +metric = diag(0, -(1 - 2 * M(v) / r), r ** 2, r ** 2 * sin(th) ** 2) +metric[0, 1] = metric[1, 0] = -1 del r, v, th, ph, M diff --git a/src/riccipy/metrics/vaidya_2.py b/src/riccipy/metrics/vaidya_2.py index 025051f..e3faed7 100644 --- a/src/riccipy/metrics/vaidya_2.py +++ b/src/riccipy/metrics/vaidya_2.py @@ -1,9 +1,11 @@ # Vaidya metric in ingoing Eddington-Finkelstein coordinates -_coords = symbols('r v theta phi', real=True) -_vars = () -_funs = symbols('M', cls=Function) -r, v, th, ph = _coords -M = _funs -_metric = diag(0, -(1-2*M(v)/r), r**2, r**2*sin(th)**2) -_metric[0,1] = _metric[1,0] = 1 +from sympy import Function, diag, sin, symbols + +coords = symbols("r v theta phi", real=True) +variables = () +functions = symbols("M", cls=Function) +r, v, th, ph = coords +M = functions +metric = diag(0, -(1 - 2 * M(v) / r), r ** 2, r ** 2 * sin(th) ** 2) +metric[0, 1] = metric[1, 0] = 1 del r, v, th, ph, M diff --git a/src/riccipy/metrics/vaidya_3.py b/src/riccipy/metrics/vaidya_3.py index 7c42e84..585a114 100644 --- a/src/riccipy/metrics/vaidya_3.py +++ b/src/riccipy/metrics/vaidya_3.py @@ -1,9 +1,13 @@ # Vaidya metric with non-zero cosmological constant in outgoing Eddington-Finkelstein coordinates -_coords = symbols('r v theta phi', real=True) -_vars = symbols('Lambda', constant=True) -_funs = symbols('M', cls=Function) -r, v, th, ph = _coords -M = _funs -_metric = diag(0, -(1-2*M(v)/r-Lambda*r**2/3), r**2, r**2*sin(th)**2) -_metric[0,1] = _metric[1,0] = -1 +from sympy import Function, diag, sin, symbols + +coords = symbols("r v theta phi", real=True) +variables = symbols("Lambda", constant=True) +functions = symbols("M", cls=Function) +r, v, th, ph = coords +M = functions +metric = diag( + 0, -(1 - 2 * M(v) / r - Lambda * r ** 2 / 3), r ** 2, r ** 2 * sin(th) ** 2 +) +metric[0, 1] = metric[1, 0] = -1 del r, v, th, ph, M diff --git a/src/riccipy/metrics/vaidya_4.py b/src/riccipy/metrics/vaidya_4.py index 51faa33..82a0b6c 100644 --- a/src/riccipy/metrics/vaidya_4.py +++ b/src/riccipy/metrics/vaidya_4.py @@ -1,9 +1,13 @@ # Vaidya metric with non-zero cosmological constant in ingoing Eddington-Finkelstein coordinates -_coords = symbols('r v theta phi', real=True) -_vars = symbols('Lambda', constant=True) -_funs = symbols('M', cls=Function) -r, v, th, ph = _coords -M = _funs -_metric = diag(0, -(1-2*M(v)/r-Lambda*r**2/3), r**2, r**2*sin(th)**2) -_metric[0,1] = _metric[1,0] = 1 +from sympy import Function, diag, sin, symbols + +coords = symbols("r v theta phi", real=True) +variables = symbols("Lambda", constant=True) +functions = symbols("M", cls=Function) +r, v, th, ph = coords +M = functions +metric = diag( + 0, -(1 - 2 * M(v) / r - Lambda * r ** 2 / 3), r ** 2, r ** 2 * sin(th) ** 2 +) +metric[0, 1] = metric[1, 0] = 1 del r, v, th, ph, M diff --git a/src/riccipy/tests/test_metric.py b/src/riccipy/tests/test_metric.py index 0e243bd..f87675c 100644 --- a/src/riccipy/tests/test_metric.py +++ b/src/riccipy/tests/test_metric.py @@ -1,8 +1,7 @@ -from sympy import Expr, diag, eye, sin, symbols, tensorproduct, zeros - from riccipy.metric import * from riccipy.partial import * from riccipy.tensor import * +from sympy import Expr, diag, eye, sin, symbols, tensorproduct, zeros def _generate_schwarzschild(): diff --git a/src/riccipy/tests/test_partial.py b/src/riccipy/tests/test_partial.py index 6b1402b..31b2149 100644 --- a/src/riccipy/tests/test_partial.py +++ b/src/riccipy/tests/test_partial.py @@ -1,8 +1,7 @@ -from sympy import diag, sin, symbols - from riccipy.metric import * from riccipy.partial import * from riccipy.tensor import * +from sympy import diag, sin, symbols def _generate_schwarzschild(): diff --git a/src/riccipy/tests/test_tensor.py b/src/riccipy/tests/test_tensor.py index ab68c7e..27623e4 100644 --- a/src/riccipy/tests/test_tensor.py +++ b/src/riccipy/tests/test_tensor.py @@ -1,8 +1,7 @@ -from sympy import Array, diag, eye, simplify, sin, symbols -from sympy.tensor.tensor import TensExpr, TensMul - from riccipy.metric import * from riccipy.tensor import * +from sympy import Array, diag, eye, simplify, sin, symbols +from sympy.tensor.tensor import TensExpr, TensMul def _generate_simple(): From 6d6dda183927297972aae73083886c92e422f27b Mon Sep 17 00:00:00 2001 From: cjayross Date: Sun, 7 Jul 2019 16:27:58 -0500 Subject: [PATCH 24/34] added load_metric to __init__.py --- src/riccipy/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/riccipy/__init__.py b/src/riccipy/__init__.py index 19b1913..ad9e71c 100644 --- a/src/riccipy/__init__.py +++ b/src/riccipy/__init__.py @@ -7,5 +7,5 @@ """ __version__ = "0.1.dev0" -from .metric import Metric, SpacetimeMetric +from .metric import Metric, SpacetimeMetric, load_metric from .tensor import Index, Tensor, expand_tensor, indices From 5948c4d2087602a308bf81870886ca296804d14b Mon Sep 17 00:00:00 2001 From: cjayross Date: Sun, 7 Jul 2019 17:06:44 -0500 Subject: [PATCH 25/34] changed order of coordinates in einstein_maxwell --- src/riccipy/metrics/einstein_maxwell_1.py | 6 +++--- src/riccipy/metrics/einstein_maxwell_2.py | 6 +++--- src/riccipy/metrics/einstein_maxwell_3.py | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/riccipy/metrics/einstein_maxwell_1.py b/src/riccipy/metrics/einstein_maxwell_1.py index 6652e9f..94c4227 100644 --- a/src/riccipy/metrics/einstein_maxwell_1.py +++ b/src/riccipy/metrics/einstein_maxwell_1.py @@ -1,12 +1,12 @@ # Static cylindrically symmetric Einstein-Maxwell field (i) angular magnetic field (caused by an axial current) from sympy import cosh, diag, log, symbols -coords = symbols("t phi rho z", real=True) +coords = symbols("t rho z phi", real=True) variables = symbols("a b m", constant=True) functions = () -t, ph, rh, z = coords +t, rh, z, ph = coords a, b, m = variables expr1 = cosh(log(a * rh ** m)) ** 2 expr2 = rh ** (2 * m ** 2) * b ** 2 * expr1 -metric = diag(-expr2, rh ** 2 * b ** 2 * expr1, expr2, 1 / (b ** 2 * expr1)) +metric = diag(-expr2, expr2, 1 / (b ** 2 * expr1), rh ** 2 * b ** 2 * expr1) del expr1, expr2, t, ph, rh, z, a, b, m diff --git a/src/riccipy/metrics/einstein_maxwell_2.py b/src/riccipy/metrics/einstein_maxwell_2.py index 14fb881..5f43e33 100644 --- a/src/riccipy/metrics/einstein_maxwell_2.py +++ b/src/riccipy/metrics/einstein_maxwell_2.py @@ -1,12 +1,12 @@ # Static cylindrically symmetric Einstein-Maxwell field (ii) longitudinal magnetic field (caused by an angular current) from sympy import cosh, diag, log, symbols -coords = symbols("t phi rho z", real=True) +coords = symbols("t rho z phi", real=True) variables = symbols("a b m", constant=True) functions = () -t, ph, rh, z = coords +t, rh, z, ph = coords a, b, m = variables expr1 = cosh(log(a * rh ** m)) ** 2 expr2 = rh ** (2 * m ** 2) * b ** 2 * expr1 -metric = diag(-expr2, 1 / (b ** 2 * expr1), expr2, rh ** 2 * b ** 2 * expr1) +metric = diag(-expr2, expr2, rh ** 2 * b ** 2 * expr1, 1 / (b ** 2 * expr1)) del expr1, expr2, t, ph, rh, z, a, b, m diff --git a/src/riccipy/metrics/einstein_maxwell_3.py b/src/riccipy/metrics/einstein_maxwell_3.py index a1b8039..b140a34 100644 --- a/src/riccipy/metrics/einstein_maxwell_3.py +++ b/src/riccipy/metrics/einstein_maxwell_3.py @@ -1,12 +1,12 @@ # Static cylindrically symmetric Einstein-Maxwell field (iii) radial electric field (caused by an axial charge distribution) from sympy import cosh, diag, log, symbols -coords = symbols("t phi rho z", real=True) +coords = symbols("t rho z phi", real=True) variables = symbols("a b m", constant=True) functions = () -t, ph, rh, z = coords +t, rh, z, ph = coords a, b, m = variables expr1 = cosh(log(a * rh ** m)) ** 2 expr2 = rh ** (2 * m ** 2) * b ** 2 * expr1 -metric = diag(-1 / (b ** 2 * expr1), rh ** 2 * b ** 2 * expr1, expr2, expr2) +metric = diag(-1 / (b ** 2 * expr1), expr2, expr2, rh ** 2 * b ** 2 * expr1) del expr1, expr2, t, ph, rh, z, a, b, m From 992b8e184e7c4831502acbfb78e69d278b6c403d Mon Sep 17 00:00:00 2001 From: cjayross Date: Sun, 7 Jul 2019 17:49:03 -0500 Subject: [PATCH 26/34] added cosh import for de_sitter_1 --- src/riccipy/metrics/de_sitter_1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/riccipy/metrics/de_sitter_1.py b/src/riccipy/metrics/de_sitter_1.py index 4c1aa55..f25e230 100644 --- a/src/riccipy/metrics/de_sitter_1.py +++ b/src/riccipy/metrics/de_sitter_1.py @@ -1,5 +1,5 @@ # de Sitter space -from sympy import diag, sin, symbols +from sympy import cosh, diag, sin, symbols coords = symbols("t chi theta phi", real=True) variables = symbols("alpha", constant=True) From 84d8df76014019a67690b0d63b3ce9f0004dfcf0 Mon Sep 17 00:00:00 2001 From: cjayross Date: Mon, 8 Jul 2019 01:12:26 -0500 Subject: [PATCH 27/34] added citations to metrics --- src/riccipy/metrics/anti_de_sitter_1.py | 1 + src/riccipy/metrics/anti_de_sitter_2.py | 1 + src/riccipy/metrics/bayin.py | 1 + .../metrics/beckers_sinzinkayo_demaret_1.py | 1 + .../metrics/beckers_sinzinkayo_demaret_2.py | 1 + src/riccipy/metrics/bertotti_robinson_1.py | 4 +++ src/riccipy/metrics/bertotti_robinson_2.py | 4 +++ src/riccipy/metrics/bertotti_robinson_3.py | 4 +++ src/riccipy/metrics/bertotti_robinson_4.py | 4 +++ src/riccipy/metrics/bondi_1.py | 1 + src/riccipy/metrics/bondi_2.py | 1 + src/riccipy/metrics/bondi_3.py | 1 + src/riccipy/metrics/boost_1.py | 1 + src/riccipy/metrics/boost_2.py | 1 + src/riccipy/metrics/boost_3.py | 1 + src/riccipy/metrics/buchdahl_land.py | 4 +++ src/riccipy/metrics/cmetric.py | 1 + .../metrics/cross_const_curvature_1.py | 1 + .../metrics/cross_const_curvature_2.py | 1 + .../metrics/cross_const_curvature_3.py | 1 + .../metrics/cross_const_curvature_4.py | 1 + src/riccipy/metrics/datta_1.py | 2 ++ src/riccipy/metrics/datta_2.py | 1 + src/riccipy/metrics/davidson.py | 1 + src/riccipy/metrics/de_sitter_1.py | 1 + src/riccipy/metrics/de_sitter_2.py | 1 + src/riccipy/metrics/durgapal_1.py | 1 + src/riccipy/metrics/durgapal_2.py | 1 + src/riccipy/metrics/durgapal_3.py | 1 + src/riccipy/metrics/durgapal_fuloria.py | 1 + src/riccipy/metrics/einstein_1.py | 1 + src/riccipy/metrics/einstein_2.py | 1 + src/riccipy/metrics/einstein_3.py | 1 + src/riccipy/metrics/einstein_maxwell_1.py | 1 + src/riccipy/metrics/einstein_maxwell_2.py | 1 + src/riccipy/metrics/einstein_maxwell_3.py | 1 + src/riccipy/metrics/ellis_maccallum_1.py | 4 +++ src/riccipy/metrics/ellis_maccallum_2.py | 2 ++ src/riccipy/metrics/faulkes.py | 1 + src/riccipy/metrics/godel.py | 2 ++ src/riccipy/metrics/godfrey.py | 2 ++ src/riccipy/metrics/gott.py | 11 ++++++++ src/riccipy/metrics/griffiths.py | 27 +++++++++++++++++++ src/riccipy/metrics/harrison_1.py | 2 ++ src/riccipy/metrics/harrison_2.py | 2 ++ src/riccipy/metrics/harrison_3.py | 2 ++ src/riccipy/metrics/harrison_4.py | 2 ++ src/riccipy/metrics/harrison_5.py | 2 ++ src/riccipy/metrics/harrison_6.py | 2 ++ src/riccipy/metrics/harrison_7.py | 2 ++ src/riccipy/metrics/harrison_8.py | 2 ++ src/riccipy/metrics/heintzmann.py | 1 + src/riccipy/metrics/kerr_1.py | 1 + src/riccipy/metrics/kerr_2.py | 2 ++ src/riccipy/metrics/kerr_newman_1.py | 1 + src/riccipy/metrics/kerr_newman_2.py | 2 ++ src/riccipy/metrics/koutras_mcintosh.py | 1 + src/riccipy/metrics/kowalczynski_plebanski.py | 2 ++ src/riccipy/metrics/levi_civita_1.py | 1 + src/riccipy/metrics/levi_civita_2.py | 1 + src/riccipy/metrics/levi_civita_3.py | 1 + src/riccipy/metrics/levi_civita_4.py | 1 + src/riccipy/metrics/levi_civita_5.py | 1 + src/riccipy/metrics/levi_civita_6.py | 1 + src/riccipy/metrics/levi_civita_7.py | 1 + src/riccipy/metrics/levi_civita_8.py | 1 + src/riccipy/metrics/lewis_papapetrou.py | 1 + src/riccipy/metrics/lrs.py | 1 + .../metrics/mclenaghan_tariq_tupper.py | 3 +++ src/riccipy/metrics/mcvittie.py | 2 ++ src/riccipy/metrics/melvin.py | 3 +++ src/riccipy/metrics/nariai.py | 1 + src/riccipy/metrics/novotny_horsky.py | 1 + src/riccipy/metrics/pant_sah.py | 1 + src/riccipy/metrics/plane_symmetric.py | 1 + src/riccipy/metrics/reissner_nordstrom_1.py | 2 ++ src/riccipy/metrics/reissner_nordstrom_2.py | 2 ++ src/riccipy/metrics/robertson_walker_1.py | 3 +++ src/riccipy/metrics/robertson_walker_2.py | 3 +++ src/riccipy/metrics/robertson_walker_3.py | 3 +++ src/riccipy/metrics/schwarzschild_1.py | 2 ++ src/riccipy/metrics/schwarzschild_2.py | 3 +++ src/riccipy/metrics/schwarzschild_3.py | 3 +++ src/riccipy/metrics/schwarzschild_6.py | 2 +- src/riccipy/metrics/static_spherical_1.py | 1 + src/riccipy/metrics/static_spherical_2.py | 1 + src/riccipy/metrics/szekeres_1.py | 1 + src/riccipy/metrics/szekeres_2.py | 1 + src/riccipy/metrics/tariq_tupper.py | 2 ++ src/riccipy/metrics/taub_1.py | 2 ++ src/riccipy/metrics/taub_2.py | 1 + src/riccipy/metrics/tolman_1.py | 1 + src/riccipy/metrics/tolman_2.py | 1 + src/riccipy/metrics/tolman_3.py | 1 + src/riccipy/metrics/vaidya_1.py | 1 + src/riccipy/metrics/vaidya_2.py | 1 + src/riccipy/metrics/vaidya_3.py | 1 + src/riccipy/metrics/vaidya_4.py | 1 + 98 files changed, 187 insertions(+), 1 deletion(-) create mode 100644 src/riccipy/metrics/gott.py create mode 100644 src/riccipy/metrics/griffiths.py diff --git a/src/riccipy/metrics/anti_de_sitter_1.py b/src/riccipy/metrics/anti_de_sitter_1.py index db0d352..f17cf1f 100644 --- a/src/riccipy/metrics/anti_de_sitter_1.py +++ b/src/riccipy/metrics/anti_de_sitter_1.py @@ -1,4 +1,5 @@ # anti-de Sitter space +# Hawking and Ellis (5.9) p131 from sympy import cos, diag, sin, sinh, symbols coords = symbols("t chi theta phi", real=True) diff --git a/src/riccipy/metrics/anti_de_sitter_2.py b/src/riccipy/metrics/anti_de_sitter_2.py index 1640dd5..eb37f7a 100644 --- a/src/riccipy/metrics/anti_de_sitter_2.py +++ b/src/riccipy/metrics/anti_de_sitter_2.py @@ -1,4 +1,5 @@ # Static form of anti-de Sitter space +# Hawking and Ellis (5.9) p131 from sympy import cosh, diag, sin, sinh, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/bayin.py b/src/riccipy/metrics/bayin.py index e012cb3..7080019 100644 --- a/src/riccipy/metrics/bayin.py +++ b/src/riccipy/metrics/bayin.py @@ -1,4 +1,5 @@ # Bayin's spherically symmetric static perfect fluid solution II +# Bayin, Phys. Rev. D, v18, p2745-2751, (1978) from sympy import Rational, asin, sin, symbols, zeros coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/beckers_sinzinkayo_demaret_1.py b/src/riccipy/metrics/beckers_sinzinkayo_demaret_1.py index d5ed549..142cb1e 100644 --- a/src/riccipy/metrics/beckers_sinzinkayo_demaret_1.py +++ b/src/riccipy/metrics/beckers_sinzinkayo_demaret_1.py @@ -1,4 +1,5 @@ # Beckers, Sinzinkayo, and Demaret solution +# Beckers et al., Phys. Rev. D, v30, p1846, (1984) from sympy import diag, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/beckers_sinzinkayo_demaret_2.py b/src/riccipy/metrics/beckers_sinzinkayo_demaret_2.py index 74ac55c..c068175 100644 --- a/src/riccipy/metrics/beckers_sinzinkayo_demaret_2.py +++ b/src/riccipy/metrics/beckers_sinzinkayo_demaret_2.py @@ -1,4 +1,5 @@ # Beckers, Sinzinkayo, and Demaret solution +# Beckers et al., Phys. Rev. D, v30, p1846, (1984) from sympy import diag, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/bertotti_robinson_1.py b/src/riccipy/metrics/bertotti_robinson_1.py index 011c9a9..12e52de 100644 --- a/src/riccipy/metrics/bertotti_robinson_1.py +++ b/src/riccipy/metrics/bertotti_robinson_1.py @@ -1,4 +1,8 @@ # The Bertotti-Robinson solution +# Bertotti, Phys. Rev., v116, p1331, (1959) +# Bertotti, Commun. Math. Phys., v5, p257, (1967) +# Robinson, Commun. Math. Phys., v9, p161, (1968) +# Stephani (10.16) p120 from sympy import diag, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/bertotti_robinson_2.py b/src/riccipy/metrics/bertotti_robinson_2.py index 48f3d8b..08e2cab 100644 --- a/src/riccipy/metrics/bertotti_robinson_2.py +++ b/src/riccipy/metrics/bertotti_robinson_2.py @@ -1,4 +1,8 @@ # The Bertotti-Robinson solution +# Bertotti, Phys. Rev., v116, p1331, (1959) +# Lovelock, Commun. Math. Phys., v5, p257, (1967) +# Dolan, Commun. Math. Phys., v9, p161, (1968) +# Stephani (10.18) p121 from sympy import diag, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/bertotti_robinson_3.py b/src/riccipy/metrics/bertotti_robinson_3.py index bdfd6f4..4f64dd7 100644 --- a/src/riccipy/metrics/bertotti_robinson_3.py +++ b/src/riccipy/metrics/bertotti_robinson_3.py @@ -1,4 +1,8 @@ # The Bertotti-Robinson solution +# Bertotti, Phys. Rev., v116, p1331, (1959) +# Lovelock, Commun. Math. Phys., v5, p257, (1967) +# Dolan, Commun. Math. Phys., v9, p161, (1968) +# Stephani (10.19) p120 from sympy import diag, sin, sinh, symbols coords = symbols("t x theta phi", real=True) diff --git a/src/riccipy/metrics/bertotti_robinson_4.py b/src/riccipy/metrics/bertotti_robinson_4.py index fc9665d..a566447 100644 --- a/src/riccipy/metrics/bertotti_robinson_4.py +++ b/src/riccipy/metrics/bertotti_robinson_4.py @@ -1,4 +1,8 @@ # The Bertotti-Robinson solution +# Bertotti, Phys. Rev., v116, p1331, (1959) +# Lovelock, Commun. Math. Phys., v5, p257, (1967) +# Dolan, Commun. Math. Phys., v9, p161, (1968) +# Stephani (32.95) p372 from sympy import cos, diag, symbols coords = symbols("t z x y", real=True) diff --git a/src/riccipy/metrics/bondi_1.py b/src/riccipy/metrics/bondi_1.py index 5529606..07cd6c7 100644 --- a/src/riccipy/metrics/bondi_1.py +++ b/src/riccipy/metrics/bondi_1.py @@ -1,4 +1,5 @@ # Spherical Bondi metric in advanced (ingoing) coordinates +# Bondi, Proc. Roy. Soc. Lond. A, v282, p303, (1964) from sympy import Function, diag, sin, symbols coords = symbols("r v theta phi", real=True) diff --git a/src/riccipy/metrics/bondi_2.py b/src/riccipy/metrics/bondi_2.py index b4dde00..d4c4795 100644 --- a/src/riccipy/metrics/bondi_2.py +++ b/src/riccipy/metrics/bondi_2.py @@ -1,4 +1,5 @@ # Spherical Bondi metric in advanced (ingoing) coordinates +# Bondi, Proc. Roy. Soc. Lond. A, v282, p303, (1964) from sympy import Function, diag, sin, symbols coords = symbols("r v theta phi", real=True) diff --git a/src/riccipy/metrics/bondi_3.py b/src/riccipy/metrics/bondi_3.py index f217cf1..a45e541 100644 --- a/src/riccipy/metrics/bondi_3.py +++ b/src/riccipy/metrics/bondi_3.py @@ -1,4 +1,5 @@ # The Bondi metric +# Bondi, Proc. Roy. Soc. Lond. A, v269, p21, (1962) from sympy import Function, exp, sin, symbols, zeros coords = symbols("r u theta phi", real=True) diff --git a/src/riccipy/metrics/boost_1.py b/src/riccipy/metrics/boost_1.py index c38fee1..0e6c779 100644 --- a/src/riccipy/metrics/boost_1.py +++ b/src/riccipy/metrics/boost_1.py @@ -1,4 +1,5 @@ # Metric with G4 on T3 and boost isotropy (flat case, k=0) +# Stephani (11.16) p128 from sympy import Function, diag, symbols coords = symbols("t x y w", real=True) diff --git a/src/riccipy/metrics/boost_2.py b/src/riccipy/metrics/boost_2.py index ae71ad0..0d548b1 100644 --- a/src/riccipy/metrics/boost_2.py +++ b/src/riccipy/metrics/boost_2.py @@ -1,4 +1,5 @@ # Metric with G4 on T3 and boost isotropy (flat case k=1) +# Stephani (11.16) p128 from sympy import Function, diag, symbols coords = symbols("t x y w", real=True) diff --git a/src/riccipy/metrics/boost_3.py b/src/riccipy/metrics/boost_3.py index 107818d..5463e6d 100644 --- a/src/riccipy/metrics/boost_3.py +++ b/src/riccipy/metrics/boost_3.py @@ -1,4 +1,5 @@ # Metric with G4 on T3 and boost isotropy (flat case k=1) +# Stephani (11.16) p128 from sympy import Function, diag, symbols coords = symbols("t x y w", real=True) diff --git a/src/riccipy/metrics/buchdahl_land.py b/src/riccipy/metrics/buchdahl_land.py index 0a5e6c9..59fa77b 100644 --- a/src/riccipy/metrics/buchdahl_land.py +++ b/src/riccipy/metrics/buchdahl_land.py @@ -1,4 +1,8 @@ # Buchdahl and Land's static spherically symmetric stiff perfect fluid with rhob=2 +# Tolman, Phys. Rev., v55, p363-373, (1939) +# Buchdahl et al., J. Austr. Math. Soc., v8, p6-16, (1968) +# Ibanez et al., J. Math. Phys., v23, p1363-1364, (1982) +# Stephani (11.16) p128 from sympy import Rational, diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/cmetric.py b/src/riccipy/metrics/cmetric.py index 70a0540..ae9a2b1 100644 --- a/src/riccipy/metrics/cmetric.py +++ b/src/riccipy/metrics/cmetric.py @@ -1,4 +1,5 @@ # The C-metric +# Stephani (Table 16.2) p188 from sympy import Function, diag, symbols coords = symbols("t x y phi", real=True) diff --git a/src/riccipy/metrics/cross_const_curvature_1.py b/src/riccipy/metrics/cross_const_curvature_1.py index 15b2322..c694580 100644 --- a/src/riccipy/metrics/cross_const_curvature_1.py +++ b/src/riccipy/metrics/cross_const_curvature_1.py @@ -1,4 +1,5 @@ # Cross product of two 2-dimensional subspaces of constant curvature +# Stephani (10.8) p118 from sympy import diag, sin, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/cross_const_curvature_2.py b/src/riccipy/metrics/cross_const_curvature_2.py index 7e4ab02..6785ce8 100644 --- a/src/riccipy/metrics/cross_const_curvature_2.py +++ b/src/riccipy/metrics/cross_const_curvature_2.py @@ -1,4 +1,5 @@ # Cross product of two 2-dimensional subspaces of constant curvature +# Stephani (10.8) p118 from sympy import diag, sin, sinh, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/cross_const_curvature_3.py b/src/riccipy/metrics/cross_const_curvature_3.py index 2140fd6..b79bf1d 100644 --- a/src/riccipy/metrics/cross_const_curvature_3.py +++ b/src/riccipy/metrics/cross_const_curvature_3.py @@ -1,4 +1,5 @@ # Cross product of two 2-dimensional subspaces of constant curvature +# Stephani (10.8) p118 from sympy import diag, sin, sinh, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/cross_const_curvature_4.py b/src/riccipy/metrics/cross_const_curvature_4.py index a26c769..9193622 100644 --- a/src/riccipy/metrics/cross_const_curvature_4.py +++ b/src/riccipy/metrics/cross_const_curvature_4.py @@ -1,4 +1,5 @@ # Cross product of two 2-dimensional subspaces of constant curvature +# Stephani (10.8) p118 from sympy import diag, sinh, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/datta_1.py b/src/riccipy/metrics/datta_1.py index 1a09808..cdfb5b7 100644 --- a/src/riccipy/metrics/datta_1.py +++ b/src/riccipy/metrics/datta_1.py @@ -1,4 +1,6 @@ # Datta's Einstein-Maxwell solution +# Datta, Nuovo Cim., v36, p109 +# Stephani (11.60) p137 from sympy import diag, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/datta_2.py b/src/riccipy/metrics/datta_2.py index d55a464..f760fdb 100644 --- a/src/riccipy/metrics/datta_2.py +++ b/src/riccipy/metrics/datta_2.py @@ -1,4 +1,5 @@ # Datta's Einstein-Maxwell solution +# Stephani (11.62) p137 from sympy import diag, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/davidson.py b/src/riccipy/metrics/davidson.py index 9cbee21..22c5567 100644 --- a/src/riccipy/metrics/davidson.py +++ b/src/riccipy/metrics/davidson.py @@ -1,4 +1,5 @@ # Davidson's cylindrically symmetric radiation perfect fluid universe +# Davidson, J. Math. Phys., v32, p1560, (1991) from sympy import Rational, diag, symbols coords = symbols("t r z phi", real=True) diff --git a/src/riccipy/metrics/de_sitter_1.py b/src/riccipy/metrics/de_sitter_1.py index f25e230..b9d5d2d 100644 --- a/src/riccipy/metrics/de_sitter_1.py +++ b/src/riccipy/metrics/de_sitter_1.py @@ -1,4 +1,5 @@ # de Sitter space +# Hawking and Ellis p125 from sympy import cosh, diag, sin, symbols coords = symbols("t chi theta phi", real=True) diff --git a/src/riccipy/metrics/de_sitter_2.py b/src/riccipy/metrics/de_sitter_2.py index 2660073..9417ef7 100644 --- a/src/riccipy/metrics/de_sitter_2.py +++ b/src/riccipy/metrics/de_sitter_2.py @@ -1,4 +1,5 @@ # de Sitter space +# Hawking and Ellis p125 from sympy import diag, exp, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/durgapal_1.py b/src/riccipy/metrics/durgapal_1.py index e471f89..e8f0d59 100644 --- a/src/riccipy/metrics/durgapal_1.py +++ b/src/riccipy/metrics/durgapal_1.py @@ -1,4 +1,5 @@ # Durgapal's static spherically symmetric perfect fluid with n=3 +# Durgapal, J. Phys. A, v15, p2637-2644, (1982) from sympy import sin, sqrt, symbols, zeros coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/durgapal_2.py b/src/riccipy/metrics/durgapal_2.py index af10260..b6085cd 100644 --- a/src/riccipy/metrics/durgapal_2.py +++ b/src/riccipy/metrics/durgapal_2.py @@ -1,4 +1,5 @@ # Durgapal's static spherically symmetric perfect fluid with n=4 +# Durgapal, J. Phys. A, v15, p2637-2644, (1982) from sympy import Rational, sin, symbols, zeros coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/durgapal_3.py b/src/riccipy/metrics/durgapal_3.py index f0d233d..8dc260d 100644 --- a/src/riccipy/metrics/durgapal_3.py +++ b/src/riccipy/metrics/durgapal_3.py @@ -1,4 +1,5 @@ # Durgapal's static spherically symmetric perfect fluid with n=5 +# Durgapal, J. Phys. A, v15, p2637-2644, (1982) from sympy import Rational, sin, symbols, zeros coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/durgapal_fuloria.py b/src/riccipy/metrics/durgapal_fuloria.py index c4d1c69..9923dd1 100644 --- a/src/riccipy/metrics/durgapal_fuloria.py +++ b/src/riccipy/metrics/durgapal_fuloria.py @@ -1,4 +1,5 @@ # Durgapal and Fuloria's static spherically symmetric perfect fluid +# Durgapal et al., Gen. Rel. Grav., v17, p671-681, (1985) from sympy import diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/einstein_1.py b/src/riccipy/metrics/einstein_1.py index af0aaf4..957a5f9 100644 --- a/src/riccipy/metrics/einstein_1.py +++ b/src/riccipy/metrics/einstein_1.py @@ -1,4 +1,5 @@ # Einstein's static universe. Cartesian coordinates +# Stephani (10.23a) p122 from sympy import diag, sqrt, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/einstein_2.py b/src/riccipy/metrics/einstein_2.py index 0b04723..fc3e331 100644 --- a/src/riccipy/metrics/einstein_2.py +++ b/src/riccipy/metrics/einstein_2.py @@ -1,4 +1,5 @@ # Einstein's static universe. Polar coordinates +# Stephani (10.23b) p122 from sympy import diag, sin, symbols coords = symbols("t chi theta phi", real=True) diff --git a/src/riccipy/metrics/einstein_3.py b/src/riccipy/metrics/einstein_3.py index 3e61c6f..a94dc1e 100644 --- a/src/riccipy/metrics/einstein_3.py +++ b/src/riccipy/metrics/einstein_3.py @@ -1,4 +1,5 @@ # Einstein's static universe. Curvature coordinates +# Stephani (10.23c) p122 from sympy import diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/einstein_maxwell_1.py b/src/riccipy/metrics/einstein_maxwell_1.py index 94c4227..9b4ada8 100644 --- a/src/riccipy/metrics/einstein_maxwell_1.py +++ b/src/riccipy/metrics/einstein_maxwell_1.py @@ -1,4 +1,5 @@ # Static cylindrically symmetric Einstein-Maxwell field (i) angular magnetic field (caused by an axial current) +# Stephani (20.9a) p221 from sympy import cosh, diag, log, symbols coords = symbols("t rho z phi", real=True) diff --git a/src/riccipy/metrics/einstein_maxwell_2.py b/src/riccipy/metrics/einstein_maxwell_2.py index 5f43e33..99f450b 100644 --- a/src/riccipy/metrics/einstein_maxwell_2.py +++ b/src/riccipy/metrics/einstein_maxwell_2.py @@ -1,4 +1,5 @@ # Static cylindrically symmetric Einstein-Maxwell field (ii) longitudinal magnetic field (caused by an angular current) +# Stephani (20.9b) p221 from sympy import cosh, diag, log, symbols coords = symbols("t rho z phi", real=True) diff --git a/src/riccipy/metrics/einstein_maxwell_3.py b/src/riccipy/metrics/einstein_maxwell_3.py index b140a34..78a472f 100644 --- a/src/riccipy/metrics/einstein_maxwell_3.py +++ b/src/riccipy/metrics/einstein_maxwell_3.py @@ -1,4 +1,5 @@ # Static cylindrically symmetric Einstein-Maxwell field (iii) radial electric field (caused by an axial charge distribution) +# Stephani (20.9c) p221 from sympy import cosh, diag, log, symbols coords = symbols("t rho z phi", real=True) diff --git a/src/riccipy/metrics/ellis_maccallum_1.py b/src/riccipy/metrics/ellis_maccallum_1.py index 336dca8..739fa45 100644 --- a/src/riccipy/metrics/ellis_maccallum_1.py +++ b/src/riccipy/metrics/ellis_maccallum_1.py @@ -1,4 +1,8 @@ # Ellis and MacCallum's G3VIo dust solution +# Ellis et al., Commun. Math. Phys., v12, p108, (1969) +# Dunn et al., Astrophys. J., v204, p322, (1976) +# Evans, Mon. Not. R. Ast. Soc., v183, p727, (1978) +# Stephani (12.25) p150 from sympy import diag, exp, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/ellis_maccallum_2.py b/src/riccipy/metrics/ellis_maccallum_2.py index c2fe92a..49164d4 100644 --- a/src/riccipy/metrics/ellis_maccallum_2.py +++ b/src/riccipy/metrics/ellis_maccallum_2.py @@ -1,4 +1,6 @@ # Ellis and MacCallum Bianchi VIo vacuum solution +# Ellis et al., Commun. Math. Phys., v12, p108, (1969) +# Stephani (11.56) p136 from sympy import diag, exp, sqrt, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/faulkes.py b/src/riccipy/metrics/faulkes.py index 9f513aa..cc07078 100644 --- a/src/riccipy/metrics/faulkes.py +++ b/src/riccipy/metrics/faulkes.py @@ -1,4 +1,5 @@ # Faulkes' non-static spherically symmetric perfect fluid solution +# Faulkes, Prog. Theor. Phys., v42, p1139-1142, (1969) from sympy import Function, diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/godel.py b/src/riccipy/metrics/godel.py index a055a1e..d32de80 100644 --- a/src/riccipy/metrics/godel.py +++ b/src/riccipy/metrics/godel.py @@ -1,4 +1,6 @@ # Godel metric +# Rev. Mod. Phys., v21, p447, (1949) +# Stephani (10.25) 122 from sympy import Rational, diag, exp, sqrt, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/godfrey.py b/src/riccipy/metrics/godfrey.py index e3acc5a..f6271bb 100644 --- a/src/riccipy/metrics/godfrey.py +++ b/src/riccipy/metrics/godfrey.py @@ -1,4 +1,6 @@ # A vacuum metric admitting a nontrivial homothety which is non-null, not hypersurface-orthogonal, and whose homothetic bivector is null +# Godfrey, Gen. Rel. Grav., v3, p3, (1972) +# McIntosh, Gen. Rel. Grav., v7, p199-213, (1976) from sympy import diag, exp, symbols coords = symbols("t r z phi", real=True) diff --git a/src/riccipy/metrics/gott.py b/src/riccipy/metrics/gott.py new file mode 100644 index 0000000..06cedaf --- /dev/null +++ b/src/riccipy/metrics/gott.py @@ -0,0 +1,11 @@ +# Gott's interior solution for a cosmic string. +# Gott, Astrophys. J., v288, p422-427, (1985) +from sympy import diag, sin, symbols + +coords = symbols("t r phi z", real=True) +variables = symbols("r_0", constant=True) +functions = () +t, r, ph, z = coords +r0 = variables +metric = diag(-1, 1, r0 ** 2 * sin(r / r0) ** 2, 1) +del t, r, ph, z, r0 diff --git a/src/riccipy/metrics/griffiths.py b/src/riccipy/metrics/griffiths.py new file mode 100644 index 0000000..7f75c80 --- /dev/null +++ b/src/riccipy/metrics/griffiths.py @@ -0,0 +1,27 @@ +# Griffiths' metric +# Griffiths, Math. Proc. Camb. Phil. Soc., v77, p559, (1975) +from sympy import Rational, symbols, zeros + +coords = symbols("u v x y", real=True) +variables = symbols("a", constant=True) +functions = () +u, v, x, y = coords +a = variables +metric = zeros(4) +metric[2, 2] = ( + Rational(3, 2) + + 4 * a ** 2 * v * u + + 6 * a ** 2 * v ** 2 + + 6 * a ** 2 * u ** 2 + + 4 * a ** 2 * y * u + + 2 * a ** 2 * y ** 2 + + 4 * a ** 2 * v * y +) +metric[3, 3] = -Rational(1, 2) +metric[0, 1] = metric[1, 0] = -1 +metric[0, 2] = metric[2, 0] = -a * (2 * v - y) +metric[0, 3] = metric[3, 0] = -1 +metric[1, 2] = metric[2, 1] = -a * (2 * u - y) +metric[1, 3] = metric[3, 1] = -1 +metric[2, 3] = metric[3, 2] = a * (v + u + 2 * y) +del u, v, x, y, a diff --git a/src/riccipy/metrics/harrison_1.py b/src/riccipy/metrics/harrison_1.py index bab8df3..d0c0de1 100644 --- a/src/riccipy/metrics/harrison_1.py +++ b/src/riccipy/metrics/harrison_1.py @@ -1,4 +1,6 @@ # Harrison III-12(b). Petrov type I +# Harrison, Phys. Rev., v116, p1285, (1959) +# d'Inverno et al., J. Math. Phys., v12, p1258, (1971) from sympy import Rational, cosh, symbols, zeros coords = symbols("x_0:4", real=True) diff --git a/src/riccipy/metrics/harrison_2.py b/src/riccipy/metrics/harrison_2.py index f26ac2b..22f419e 100644 --- a/src/riccipy/metrics/harrison_2.py +++ b/src/riccipy/metrics/harrison_2.py @@ -1,4 +1,6 @@ # Harrison III-3 Petrov type D, Kinnersley class IV.B (C=0) +# Harrison, Phys. Rev., v116, p1285, (1959) +# d'Inverno et al., J. Math. Phys., v12, p1258, (1971) from sympy import Rational, diag, sin, sqrt, symbols coords = symbols("x_0:4", real=True) diff --git a/src/riccipy/metrics/harrison_3.py b/src/riccipy/metrics/harrison_3.py index 431276f..1748284 100644 --- a/src/riccipy/metrics/harrison_3.py +++ b/src/riccipy/metrics/harrison_3.py @@ -1,4 +1,6 @@ # Harrison III-7(a) Petrov type D, Kinnersley class IV.B (C=1/2) +# Harrison, Phys. Rev., v116, p1285, (1959) +# d'Inverno et al., J. Math. Phys., v12, p1258, (1971) from sympy import diag, sinh, symbols coords = symbols("x_0:4", real=True) diff --git a/src/riccipy/metrics/harrison_4.py b/src/riccipy/metrics/harrison_4.py index c8fac12..49730e2 100644 --- a/src/riccipy/metrics/harrison_4.py +++ b/src/riccipy/metrics/harrison_4.py @@ -1,4 +1,6 @@ # Harrison III-7(b) Petrov type D, Kinnersley class IV.B (C=1/2) +# Harrison, Phys. Rev., v116, p1285, (1959) +# d'Inverno et al., J. Math. Phys., v12, p1258, (1971) from sympy import cosh, diag, symbols coords = symbols("x_0:4", real=True) diff --git a/src/riccipy/metrics/harrison_5.py b/src/riccipy/metrics/harrison_5.py index 08a6bdc..cd4c6d4 100644 --- a/src/riccipy/metrics/harrison_5.py +++ b/src/riccipy/metrics/harrison_5.py @@ -1,4 +1,6 @@ # Harrison III-7(a) Petrov type D, Kinnersley class IV.B (C=1/2) +# Harrison, Phys. Rev., v116, p1285, (1959) +# d'Inverno et al., J. Math. Phys., v12, p1258, (1971) from sympy import diag, exp, symbols coords = symbols("x_0:4", real=True) diff --git a/src/riccipy/metrics/harrison_6.py b/src/riccipy/metrics/harrison_6.py index acf0e4e..ec265ca 100644 --- a/src/riccipy/metrics/harrison_6.py +++ b/src/riccipy/metrics/harrison_6.py @@ -1,4 +1,6 @@ # Harrison III-9(a) Petrov type D, Kinnersley class II.B (a=l=0) +# Harrison, Phys. Rev., v116, p1285, (1959) +# d'Inverno et al., J. Math. Phys., v12, p1258, (1971) from sympy import diag, sinh, symbols coords = symbols("x_0:4", real=True) diff --git a/src/riccipy/metrics/harrison_7.py b/src/riccipy/metrics/harrison_7.py index e029483..c1717c3 100644 --- a/src/riccipy/metrics/harrison_7.py +++ b/src/riccipy/metrics/harrison_7.py @@ -1,4 +1,6 @@ # Harrison III-9(b) Petrov type D, Kinnersley class II.C (a=l=0) +# Harrison, Phys. Rev., v116, p1285, (1959) +# d'Inverno et al., J. Math. Phys., v12, p1258, (1971) from sympy import cosh, diag, symbols coords = symbols("x_0:4", real=True) diff --git a/src/riccipy/metrics/harrison_8.py b/src/riccipy/metrics/harrison_8.py index 005ef72..7a1e974 100644 --- a/src/riccipy/metrics/harrison_8.py +++ b/src/riccipy/metrics/harrison_8.py @@ -1,4 +1,6 @@ # Harrison III-9(c) Petrov type D, Kinnersley class II.D (a=l=0) +# Harrison, Phys. Rev., v116, p1285, (1959) +# d'Inverno et al., J. Math. Phys., v12, p1258, (1971) from sympy import diag, exp, symbols coords = symbols("x_0:4", real=True) diff --git a/src/riccipy/metrics/heintzmann.py b/src/riccipy/metrics/heintzmann.py index f2c72ce..f0ed007 100644 --- a/src/riccipy/metrics/heintzmann.py +++ b/src/riccipy/metrics/heintzmann.py @@ -1,4 +1,5 @@ # Heintzmann's static spherically symmetric perfect fluid solution +# Heintzmann, Z. Phys., v228, p489-493, (1969) from sympy import diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/kerr_1.py b/src/riccipy/metrics/kerr_1.py index b48ccda..50899ad 100644 --- a/src/riccipy/metrics/kerr_1.py +++ b/src/riccipy/metrics/kerr_1.py @@ -1,4 +1,5 @@ # Kerr metric in Cartesian coordinates +# Allen, Gen. Rel. Grav., v26, p21, (1994) from sympy import symbols, zeros coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/kerr_2.py b/src/riccipy/metrics/kerr_2.py index 1529d9e..83be2db 100644 --- a/src/riccipy/metrics/kerr_2.py +++ b/src/riccipy/metrics/kerr_2.py @@ -1,4 +1,6 @@ # Kerr metric in Boyer Lindquist coordinates +# Boyer, J. Math. Phys., v8, p265, (1967) +# Stephani (18.25) p205 from sympy import cos, sin, symbols, zeros coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/kerr_newman_1.py b/src/riccipy/metrics/kerr_newman_1.py index 58c7616..e89dd88 100644 --- a/src/riccipy/metrics/kerr_newman_1.py +++ b/src/riccipy/metrics/kerr_newman_1.py @@ -1,4 +1,5 @@ # Kerr metric in Cartesian coordinates +# Allen, Gen. Rel. Grav., v26, p21, (1994) from sympy import symbols, zeros coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/kerr_newman_2.py b/src/riccipy/metrics/kerr_newman_2.py index 183ac73..89a091e 100644 --- a/src/riccipy/metrics/kerr_newman_2.py +++ b/src/riccipy/metrics/kerr_newman_2.py @@ -1,4 +1,6 @@ # Kerr metric in Boyer Lindquist coordinates +# Newman, J. Math. Phys., v6, p918, (1965) +# Stephani (19.19) p213 from sympy import cos, sin, symbols, zeros coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/koutras_mcintosh.py b/src/riccipy/metrics/koutras_mcintosh.py index 65d6255..f7c05dc 100644 --- a/src/riccipy/metrics/koutras_mcintosh.py +++ b/src/riccipy/metrics/koutras_mcintosh.py @@ -1,4 +1,5 @@ # Koutras-McIntosh metric (no symmetries or invariants) +# Koutras et al., Class. Quantum Grav., v13, pL47, (1996) from sympy import Function, symbols, zeros coords = symbols("w u x y", real=True) diff --git a/src/riccipy/metrics/kowalczynski_plebanski.py b/src/riccipy/metrics/kowalczynski_plebanski.py index 3020255..e5bdbaf 100644 --- a/src/riccipy/metrics/kowalczynski_plebanski.py +++ b/src/riccipy/metrics/kowalczynski_plebanski.py @@ -1,4 +1,6 @@ # Kowalczynski and Plebanski metric +# Kowalczynski et al., Int. J. Theor. Phys., v16, p371, (1977) +# Stephani (27.57) p297 from sympy import diag, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/levi_civita_1.py b/src/riccipy/metrics/levi_civita_1.py index 4725998..ae9ee0c 100644 --- a/src/riccipy/metrics/levi_civita_1.py +++ b/src/riccipy/metrics/levi_civita_1.py @@ -1,4 +1,5 @@ # Levi-Civita solution, Class AI. Aka the exterior Schwarzschild metric. +# Stephani (Table 16.2) p188 from sympy import diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/levi_civita_2.py b/src/riccipy/metrics/levi_civita_2.py index d34ae03..5010475 100644 --- a/src/riccipy/metrics/levi_civita_2.py +++ b/src/riccipy/metrics/levi_civita_2.py @@ -1,4 +1,5 @@ # Levi-Civita solution, Class AII +# Stephani (Table 16.2) p188 from sympy import diag, sinh, symbols coords = symbols("t z r phi", real=True) diff --git a/src/riccipy/metrics/levi_civita_3.py b/src/riccipy/metrics/levi_civita_3.py index 074fe8e..bdb97d9 100644 --- a/src/riccipy/metrics/levi_civita_3.py +++ b/src/riccipy/metrics/levi_civita_3.py @@ -1,4 +1,5 @@ # Levi-Civita solution, Class AIII +# Stephani (Table 16.2) p188 from sympy import diag, symbols coords = symbols("t z r phi", real=True) diff --git a/src/riccipy/metrics/levi_civita_4.py b/src/riccipy/metrics/levi_civita_4.py index bb48ea4..ff8607d 100644 --- a/src/riccipy/metrics/levi_civita_4.py +++ b/src/riccipy/metrics/levi_civita_4.py @@ -1,4 +1,5 @@ # Levi-Civita solution, Class BI +# Stephani (Table 16.2) p188 from sympy import diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/levi_civita_5.py b/src/riccipy/metrics/levi_civita_5.py index ada710b..6249689 100644 --- a/src/riccipy/metrics/levi_civita_5.py +++ b/src/riccipy/metrics/levi_civita_5.py @@ -1,4 +1,5 @@ # Levi-Civita solution, Class BII +# Stephani (Table 16.2) p188 from sympy import diag, sinh, symbols coords = symbols("t z r phi", real=True) diff --git a/src/riccipy/metrics/levi_civita_6.py b/src/riccipy/metrics/levi_civita_6.py index bd1966a..b371c28 100644 --- a/src/riccipy/metrics/levi_civita_6.py +++ b/src/riccipy/metrics/levi_civita_6.py @@ -1,4 +1,5 @@ # Levi-Civita solution, Class BIII +# Stephani (Table 16.2) p188 from sympy import diag, symbols coords = symbols("t z r phi", real=True) diff --git a/src/riccipy/metrics/levi_civita_7.py b/src/riccipy/metrics/levi_civita_7.py index a20c839..38408e1 100644 --- a/src/riccipy/metrics/levi_civita_7.py +++ b/src/riccipy/metrics/levi_civita_7.py @@ -1,4 +1,5 @@ # Levi-Civita static vacuum solution. Special case m=2, Petrov D +# Stephani (20.8) p221 from sympy import diag, symbols coords = symbols("t rho z phi", real=True) diff --git a/src/riccipy/metrics/levi_civita_8.py b/src/riccipy/metrics/levi_civita_8.py index 85dbd89..df08beb 100644 --- a/src/riccipy/metrics/levi_civita_8.py +++ b/src/riccipy/metrics/levi_civita_8.py @@ -1,4 +1,5 @@ # Levi-Civita static vacuum solution +# Stephani (20.8) p221 from sympy import diag, symbols coords = symbols("t rho z phi", real=True) diff --git a/src/riccipy/metrics/lewis_papapetrou.py b/src/riccipy/metrics/lewis_papapetrou.py index 43a9753..0170416 100644 --- a/src/riccipy/metrics/lewis_papapetrou.py +++ b/src/riccipy/metrics/lewis_papapetrou.py @@ -1,4 +1,5 @@ # Lewis Papapetrou metric +# Ernst, Phys. Rev., v167, p1175, (1968) from sympy import Function, Rational, exp, symbols, zeros coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/lrs.py b/src/riccipy/metrics/lrs.py index 3b18402..50703f8 100644 --- a/src/riccipy/metrics/lrs.py +++ b/src/riccipy/metrics/lrs.py @@ -1,4 +1,5 @@ # LRS stiff perfect fluid cosmological solution with G4 on S3 +# Stephani (12.11) p146 from sympy import diag, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/mclenaghan_tariq_tupper.py b/src/riccipy/metrics/mclenaghan_tariq_tupper.py index fadfef1..0420d47 100644 --- a/src/riccipy/metrics/mclenaghan_tariq_tupper.py +++ b/src/riccipy/metrics/mclenaghan_tariq_tupper.py @@ -1,4 +1,7 @@ # McLenaghan Tariq Tupper metric +# McLenaghan, J. Math. Phys., v16, p11, (1975) +# Tupper, Gen. Rel. Grav., v7, p479, (1976) +# Stephani (10.21) p121 from sympy import diag, symbols coords = symbols("t x y phi", real=True) diff --git a/src/riccipy/metrics/mcvittie.py b/src/riccipy/metrics/mcvittie.py index ecc9012..a38674f 100644 --- a/src/riccipy/metrics/mcvittie.py +++ b/src/riccipy/metrics/mcvittie.py @@ -1,4 +1,6 @@ # McVittie's plane Einstein-Maxwell field with Lambda=0 +# McVittie, Prog. Roy. Soc. Lond., v124, p366, (1929) +# Stephani (13.26) p158 from sympy import diag, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/melvin.py b/src/riccipy/metrics/melvin.py index e9d351a..2a23c2b 100644 --- a/src/riccipy/metrics/melvin.py +++ b/src/riccipy/metrics/melvin.py @@ -1,4 +1,7 @@ # Melvin's magnetic universe +# Bonnor, Prog. Roy. Soc. Lond., vA67, p225, (1954) +# Melvin, Phys. Lett., v8, p65, (1964) +# Stephani (20.10) p222 from sympy import diag, symbols coords = symbols("t rho z phi", real=True) diff --git a/src/riccipy/metrics/nariai.py b/src/riccipy/metrics/nariai.py index 1a53f03..7c67299 100644 --- a/src/riccipy/metrics/nariai.py +++ b/src/riccipy/metrics/nariai.py @@ -1,4 +1,5 @@ # Nariai vacuum metric +# Nariai, Sci. Rep. Tohoku Univ., v35, p62, (1951) from sympy import Function, cos, diag, log, sin, sqrt, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/novotny_horsky.py b/src/riccipy/metrics/novotny_horsky.py index 6b6c64f..f5c1557 100644 --- a/src/riccipy/metrics/novotny_horsky.py +++ b/src/riccipy/metrics/novotny_horsky.py @@ -1,4 +1,5 @@ # Novotny and Horsky plane symmetric vacuum metric +# Novotny et al., Can. J. Phys., v24, p718, (1974) from sympy import Rational, cos, diag, sin, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/pant_sah.py b/src/riccipy/metrics/pant_sah.py index d51baf3..cc69b44 100644 --- a/src/riccipy/metrics/pant_sah.py +++ b/src/riccipy/metrics/pant_sah.py @@ -1,4 +1,5 @@ # Pant and Sah charged static spherically symmetric solution +# Pant et al., J. Math. Phys., v20, p2537-2539, (1979) from sympy import diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/plane_symmetric.py b/src/riccipy/metrics/plane_symmetric.py index abcee3d..1deea32 100644 --- a/src/riccipy/metrics/plane_symmetric.py +++ b/src/riccipy/metrics/plane_symmetric.py @@ -1,4 +1,5 @@ # Bianchi I plane symmetric model +# Stephani (13.49) p162 from sympy import Function, diag, exp, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/reissner_nordstrom_1.py b/src/riccipy/metrics/reissner_nordstrom_1.py index 8606dd3..85a0344 100644 --- a/src/riccipy/metrics/reissner_nordstrom_1.py +++ b/src/riccipy/metrics/reissner_nordstrom_1.py @@ -1,4 +1,6 @@ # Reissner-Nordstrom spherically symmetric electro-vacuum solution +# Reissner, Ann. Phys., v50, p106, (1916) +# Stephani (13.21) p158 from sympy import diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/reissner_nordstrom_2.py b/src/riccipy/metrics/reissner_nordstrom_2.py index 13d86ca..35f5ff7 100644 --- a/src/riccipy/metrics/reissner_nordstrom_2.py +++ b/src/riccipy/metrics/reissner_nordstrom_2.py @@ -1,4 +1,6 @@ # Reissner-Nordstrom spherically symmetric electro-vacuum solution with non-zero cosmological constant +# Reissner, Ann. Phys., v50, p106, (1916) +# Stephani (Table 13.1) p157 from sympy import diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/robertson_walker_1.py b/src/riccipy/metrics/robertson_walker_1.py index 3577b97..d0999fa 100644 --- a/src/riccipy/metrics/robertson_walker_1.py +++ b/src/riccipy/metrics/robertson_walker_1.py @@ -1,4 +1,7 @@ # Closed Friedman-Robertson-Walker metric. Perfect fluid +# Robertson, Astrophys. J., v82, p284, (1935) +# Robertson, Astrophys. J., v83, p137, (1936) +# Stephani (10.9) p118 from sympy import Function, diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/robertson_walker_2.py b/src/riccipy/metrics/robertson_walker_2.py index 0c5ad0a..ad25f18 100644 --- a/src/riccipy/metrics/robertson_walker_2.py +++ b/src/riccipy/metrics/robertson_walker_2.py @@ -1,4 +1,7 @@ # Spatially flat Friedman-Robertson-Walker metric. Perfect fluid +# Robertson, Astrophys. J., v82, p284, (1935) +# Robertson, Astrophys. J., v83, p137, (1936) +# Stephani (10.9) p118 from sympy import Function, diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/robertson_walker_3.py b/src/riccipy/metrics/robertson_walker_3.py index d2e7ff3..a81abda 100644 --- a/src/riccipy/metrics/robertson_walker_3.py +++ b/src/riccipy/metrics/robertson_walker_3.py @@ -1,4 +1,7 @@ # Closed Friedman-Robertson-Walker metric. Dust +# Landau-Lifshitz (112.4), (112.9), (112.10) +# Stephani (12.3a) p122 +# Hawking and Ellis ch5.3 from sympy import cos, diag, sin, symbols coords = symbols("nu chi theta phi", real=True) diff --git a/src/riccipy/metrics/schwarzschild_1.py b/src/riccipy/metrics/schwarzschild_1.py index 951cd81..038780c 100644 --- a/src/riccipy/metrics/schwarzschild_1.py +++ b/src/riccipy/metrics/schwarzschild_1.py @@ -1,4 +1,6 @@ # Schwarzschild exterior metric in curvature coordinates +# Schwarzschild, Sitz. Preuss. Akad. Wiss., p189, (1916) +# Stephani (13.19) p157 from sympy import diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/schwarzschild_2.py b/src/riccipy/metrics/schwarzschild_2.py index 76ebf1a..ff600c7 100644 --- a/src/riccipy/metrics/schwarzschild_2.py +++ b/src/riccipy/metrics/schwarzschild_2.py @@ -1,4 +1,7 @@ # Schwarzschild metric in outgoing Eddington-Finkelstein coordinates +# Eddington, Nature, v113, p192, (1924) +# Finkelstein, Phys. Rev., v110, p965, (1958) +# Stephani (13.23) p158 from sympy import diag, sin, symbols coords = symbols("r u theta phi", real=True) diff --git a/src/riccipy/metrics/schwarzschild_3.py b/src/riccipy/metrics/schwarzschild_3.py index d10884e..5baae4f 100644 --- a/src/riccipy/metrics/schwarzschild_3.py +++ b/src/riccipy/metrics/schwarzschild_3.py @@ -1,4 +1,7 @@ # Schwarzschild metric in ingoing Eddington-Finkelstein coordinates +# Eddington, Nature, v113, p192, (1924) +# Finkelstein, Phys. Rev., v110, p965, (1958) +# Stephani (13.23) p158 from sympy import diag, sin, symbols coords = symbols("r v theta phi", real=True) diff --git a/src/riccipy/metrics/schwarzschild_6.py b/src/riccipy/metrics/schwarzschild_6.py index 2bcb735..896199f 100644 --- a/src/riccipy/metrics/schwarzschild_6.py +++ b/src/riccipy/metrics/schwarzschild_6.py @@ -1,4 +1,4 @@ -# Schwarzschild exterior metric in Israel coordinates +# Schwarzschild exterior metric in Israel coordinates from sympy import Rational, diag, sin, symbols coords = symbols("u w theta phi", real=True) diff --git a/src/riccipy/metrics/static_spherical_1.py b/src/riccipy/metrics/static_spherical_1.py index e2281c5..8158a06 100644 --- a/src/riccipy/metrics/static_spherical_1.py +++ b/src/riccipy/metrics/static_spherical_1.py @@ -1,4 +1,5 @@ # General static, spherically symmetric metric in curvature coordinates +# Stephani (14.1) p163 from sympy import Function, diag, exp, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/static_spherical_2.py b/src/riccipy/metrics/static_spherical_2.py index 54c0bff..828f7e5 100644 --- a/src/riccipy/metrics/static_spherical_2.py +++ b/src/riccipy/metrics/static_spherical_2.py @@ -1,4 +1,5 @@ # General static, spherically symmetric metric in curvature coordinates +# Stephani (14.1) p163 from sympy import Function, diag, exp, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/szekeres_1.py b/src/riccipy/metrics/szekeres_1.py index f285a89..b5842c9 100644 --- a/src/riccipy/metrics/szekeres_1.py +++ b/src/riccipy/metrics/szekeres_1.py @@ -1,4 +1,5 @@ # Szekeres solution for a special stiff perfect fluid +# Szekeres, Commun. Math. Phys., v41, p55, (1975) from sympy import cos, diag, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/szekeres_2.py b/src/riccipy/metrics/szekeres_2.py index 218ceef..9704520 100644 --- a/src/riccipy/metrics/szekeres_2.py +++ b/src/riccipy/metrics/szekeres_2.py @@ -1,4 +1,5 @@ # Szekeres solution for a special stiff perfect fluid in Abelian type coordinates +# Szekeres, Commun. Math. Phys., v41, p55, (1975) from sympy import cosh, diag, exp, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/tariq_tupper.py b/src/riccipy/metrics/tariq_tupper.py index f11fa34..821d606 100644 --- a/src/riccipy/metrics/tariq_tupper.py +++ b/src/riccipy/metrics/tariq_tupper.py @@ -1,4 +1,6 @@ # Tariq and Tupper metric admitting a G3VIo on S3 +# Tariq et al., Gen. Rel. Grav., v6, p345, (1975) +# Stephani (11.64) p138 from sympy import diag, exp, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/taub_1.py b/src/riccipy/metrics/taub_1.py index ce673c3..adc5496 100644 --- a/src/riccipy/metrics/taub_1.py +++ b/src/riccipy/metrics/taub_1.py @@ -1,4 +1,6 @@ # Taub metric for plane symmetric, static perfect fluid. +# Taub, Phys. Rev., v103, p454, (1956) +# Stephani (13.44) p161 from sympy import diag, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/taub_2.py b/src/riccipy/metrics/taub_2.py index 6bdb442..74b6ab7 100644 --- a/src/riccipy/metrics/taub_2.py +++ b/src/riccipy/metrics/taub_2.py @@ -1,4 +1,5 @@ # Taub's plane symmetric vacuum solution +# Taub, Ann. Math., v53, p473, (1951) from sympy import diag, sqrt, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/tolman_1.py b/src/riccipy/metrics/tolman_1.py index 0795399..0032a71 100644 --- a/src/riccipy/metrics/tolman_1.py +++ b/src/riccipy/metrics/tolman_1.py @@ -1,4 +1,5 @@ # Tolman's type IV solution +# Tolman, Phys. Rev., v55, p363-373, (1939) from sympy import diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/tolman_2.py b/src/riccipy/metrics/tolman_2.py index 4f19d12..8f585ec 100644 --- a/src/riccipy/metrics/tolman_2.py +++ b/src/riccipy/metrics/tolman_2.py @@ -1,4 +1,5 @@ # Tolman's type VI solution +# Tolman, Phys. Rev., v55, p363-373, (1939) from sympy import diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/tolman_3.py b/src/riccipy/metrics/tolman_3.py index 27a21dd..fbe2452 100644 --- a/src/riccipy/metrics/tolman_3.py +++ b/src/riccipy/metrics/tolman_3.py @@ -1,4 +1,5 @@ # Tolman's type VII static spherically symmetric perfect fluid solution +# Tolman, Phys. Rev., v55, p363-373, (1939) from sympy import Rational, diag, log, sin, sqrt, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/vaidya_1.py b/src/riccipy/metrics/vaidya_1.py index 7a0da72..86a5c4b 100644 --- a/src/riccipy/metrics/vaidya_1.py +++ b/src/riccipy/metrics/vaidya_1.py @@ -1,4 +1,5 @@ # Vaidya metric in outgoing Eddington-Finkelstein coordinates +# Stephani (13.20) p158 from sympy import Function, diag, sin, symbols coords = symbols("r v theta phi", real=True) diff --git a/src/riccipy/metrics/vaidya_2.py b/src/riccipy/metrics/vaidya_2.py index e3faed7..2c125a8 100644 --- a/src/riccipy/metrics/vaidya_2.py +++ b/src/riccipy/metrics/vaidya_2.py @@ -1,4 +1,5 @@ # Vaidya metric in ingoing Eddington-Finkelstein coordinates +# Stephani (13.20) p158 from sympy import Function, diag, sin, symbols coords = symbols("r v theta phi", real=True) diff --git a/src/riccipy/metrics/vaidya_3.py b/src/riccipy/metrics/vaidya_3.py index 585a114..ad83666 100644 --- a/src/riccipy/metrics/vaidya_3.py +++ b/src/riccipy/metrics/vaidya_3.py @@ -1,4 +1,5 @@ # Vaidya metric with non-zero cosmological constant in outgoing Eddington-Finkelstein coordinates +# Stephani (13.20) p158 from sympy import Function, diag, sin, symbols coords = symbols("r v theta phi", real=True) diff --git a/src/riccipy/metrics/vaidya_4.py b/src/riccipy/metrics/vaidya_4.py index 82a0b6c..264a350 100644 --- a/src/riccipy/metrics/vaidya_4.py +++ b/src/riccipy/metrics/vaidya_4.py @@ -1,4 +1,5 @@ # Vaidya metric with non-zero cosmological constant in ingoing Eddington-Finkelstein coordinates +# Stephani (13.20) p158 from sympy import Function, diag, sin, symbols coords = symbols("r v theta phi", real=True) From e5fffcfb5077e94f98e21ddeb2aa5722767e5854 Mon Sep 17 00:00:00 2001 From: cjayross Date: Sat, 6 Jul 2019 19:35:50 -0500 Subject: [PATCH 28/34] added first metrics --- src/riccipy/metrics/plane_symmetric.py | 9 +++++++++ src/riccipy/metrics/robertson_walker_1.py | 9 +++++++++ src/riccipy/metrics/robertson_walker_2.py | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/src/riccipy/metrics/plane_symmetric.py b/src/riccipy/metrics/plane_symmetric.py index 1deea32..b21f2ca 100644 --- a/src/riccipy/metrics/plane_symmetric.py +++ b/src/riccipy/metrics/plane_symmetric.py @@ -1,4 +1,5 @@ # Bianchi I plane symmetric model +<<<<<<< HEAD # Stephani (13.49) p162 from sympy import Function, diag, exp, symbols @@ -8,4 +9,12 @@ t, x, y, z = coords al, be = functions metric = diag(-1, exp(2 * be(t)), exp(2 * be(t)), exp(2 * al(t))) +======= +_coords = symbols('t x y z', real=True) +_vars = () +_funs = symbols('alpha beta', cls=Function) +t, x, y, z = _coords +al, be = _funs +_metric = diag(-1, exp(2*be(t)), exp(2*be(t)), exp(2*al(t))) +>>>>>>> added first metrics del t, x, y, z, al, be diff --git a/src/riccipy/metrics/robertson_walker_1.py b/src/riccipy/metrics/robertson_walker_1.py index d0999fa..733f710 100644 --- a/src/riccipy/metrics/robertson_walker_1.py +++ b/src/riccipy/metrics/robertson_walker_1.py @@ -1,4 +1,5 @@ # Closed Friedman-Robertson-Walker metric. Perfect fluid +<<<<<<< HEAD # Robertson, Astrophys. J., v82, p284, (1935) # Robertson, Astrophys. J., v83, p137, (1936) # Stephani (10.9) p118 @@ -12,4 +13,12 @@ metric = diag( -1, a(t) ** 2, a(t) ** 2 * sin(r) ** 2, a(t) ** 2 * sin(r) ** 2 * sin(th) ** 2 ) +======= +_coords = symbols('t r theta phi', real=True) +_vars = () +_funs = symbols('a', cls=Function) +t, r, th, ph = _coords +a = _funs +_metric = diag(-1, a(t)**2, a(t)**2*sin(r)**2, a(t)**2*sin(r)**2*sin(th)**2) +>>>>>>> added first metrics del t, r, th, ph, a diff --git a/src/riccipy/metrics/robertson_walker_2.py b/src/riccipy/metrics/robertson_walker_2.py index ad25f18..71bf0d9 100644 --- a/src/riccipy/metrics/robertson_walker_2.py +++ b/src/riccipy/metrics/robertson_walker_2.py @@ -1,4 +1,5 @@ # Spatially flat Friedman-Robertson-Walker metric. Perfect fluid +<<<<<<< HEAD # Robertson, Astrophys. J., v82, p284, (1935) # Robertson, Astrophys. J., v83, p137, (1936) # Stephani (10.9) p118 @@ -10,4 +11,12 @@ t, r, th, ph = coords a = functions metric = diag(-1, a(t) ** 2, a(t) ** 2 * r ** 2, a(t) ** 2 * r ** 2 * sin(th) ** 2) +======= +_coords = symbols('t r theta phi', real=True) +_vars = () +_funs = symbols('a', cls=Function) +t, r, th, ph = _coords +a = _funs +_metric = diag(-1, a(t)**2, a(t)**2*r**2, a(t)**2*r**2*sin(th)**2) +>>>>>>> added first metrics del t, r, th, ph, a From fb6b2dcd6a7a550492ddc805d87cbcd21068a83a Mon Sep 17 00:00:00 2001 From: cjayross Date: Sun, 7 Jul 2019 00:27:03 -0500 Subject: [PATCH 29/34] added the remaining metrics --- src/riccipy/metrics/plane_symmetric.py | 9 --------- src/riccipy/metrics/robertson_walker_1.py | 9 --------- src/riccipy/metrics/robertson_walker_2.py | 9 --------- 3 files changed, 27 deletions(-) diff --git a/src/riccipy/metrics/plane_symmetric.py b/src/riccipy/metrics/plane_symmetric.py index b21f2ca..1deea32 100644 --- a/src/riccipy/metrics/plane_symmetric.py +++ b/src/riccipy/metrics/plane_symmetric.py @@ -1,5 +1,4 @@ # Bianchi I plane symmetric model -<<<<<<< HEAD # Stephani (13.49) p162 from sympy import Function, diag, exp, symbols @@ -9,12 +8,4 @@ t, x, y, z = coords al, be = functions metric = diag(-1, exp(2 * be(t)), exp(2 * be(t)), exp(2 * al(t))) -======= -_coords = symbols('t x y z', real=True) -_vars = () -_funs = symbols('alpha beta', cls=Function) -t, x, y, z = _coords -al, be = _funs -_metric = diag(-1, exp(2*be(t)), exp(2*be(t)), exp(2*al(t))) ->>>>>>> added first metrics del t, x, y, z, al, be diff --git a/src/riccipy/metrics/robertson_walker_1.py b/src/riccipy/metrics/robertson_walker_1.py index 733f710..d0999fa 100644 --- a/src/riccipy/metrics/robertson_walker_1.py +++ b/src/riccipy/metrics/robertson_walker_1.py @@ -1,5 +1,4 @@ # Closed Friedman-Robertson-Walker metric. Perfect fluid -<<<<<<< HEAD # Robertson, Astrophys. J., v82, p284, (1935) # Robertson, Astrophys. J., v83, p137, (1936) # Stephani (10.9) p118 @@ -13,12 +12,4 @@ metric = diag( -1, a(t) ** 2, a(t) ** 2 * sin(r) ** 2, a(t) ** 2 * sin(r) ** 2 * sin(th) ** 2 ) -======= -_coords = symbols('t r theta phi', real=True) -_vars = () -_funs = symbols('a', cls=Function) -t, r, th, ph = _coords -a = _funs -_metric = diag(-1, a(t)**2, a(t)**2*sin(r)**2, a(t)**2*sin(r)**2*sin(th)**2) ->>>>>>> added first metrics del t, r, th, ph, a diff --git a/src/riccipy/metrics/robertson_walker_2.py b/src/riccipy/metrics/robertson_walker_2.py index 71bf0d9..ad25f18 100644 --- a/src/riccipy/metrics/robertson_walker_2.py +++ b/src/riccipy/metrics/robertson_walker_2.py @@ -1,5 +1,4 @@ # Spatially flat Friedman-Robertson-Walker metric. Perfect fluid -<<<<<<< HEAD # Robertson, Astrophys. J., v82, p284, (1935) # Robertson, Astrophys. J., v83, p137, (1936) # Stephani (10.9) p118 @@ -11,12 +10,4 @@ t, r, th, ph = coords a = functions metric = diag(-1, a(t) ** 2, a(t) ** 2 * r ** 2, a(t) ** 2 * r ** 2 * sin(th) ** 2) -======= -_coords = symbols('t r theta phi', real=True) -_vars = () -_funs = symbols('a', cls=Function) -t, r, th, ph = _coords -a = _funs -_metric = diag(-1, a(t)**2, a(t)**2*r**2, a(t)**2*r**2*sin(th)**2) ->>>>>>> added first metrics del t, r, th, ph, a From e98a5fc559d611db3dc6443e5017000eae50ca91 Mon Sep 17 00:00:00 2001 From: cjayross Date: Sun, 7 Jul 2019 03:11:20 -0500 Subject: [PATCH 30/34] added imports to metric scripts --- src/riccipy/metric.py | 3 ++- src/riccipy/metrics/schwarzschild_6.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/riccipy/metric.py b/src/riccipy/metric.py index 1cf68ba..624379e 100644 --- a/src/riccipy/metric.py +++ b/src/riccipy/metric.py @@ -5,7 +5,8 @@ from sympy.tensor.tensor import TensorIndexType from .partial import PartialDerivative -from .tensor import AbstractTensor, ReplacementManager, Tensor, expand_tensor, indices +from .tensor import (AbstractTensor, ReplacementManager, Tensor, expand_tensor, + indices) class Metric(AbstractTensor, TensorIndexType): diff --git a/src/riccipy/metrics/schwarzschild_6.py b/src/riccipy/metrics/schwarzschild_6.py index 896199f..e52b348 100644 --- a/src/riccipy/metrics/schwarzschild_6.py +++ b/src/riccipy/metrics/schwarzschild_6.py @@ -1,4 +1,5 @@ # Schwarzschild exterior metric in Israel coordinates +# Schwarzschild exterior metric in Israel coordinates from sympy import Rational, diag, sin, symbols coords = symbols("u w theta phi", real=True) From f1a819016e55494942d1d12650d9c9bfbdb98a04 Mon Sep 17 00:00:00 2001 From: cjayross Date: Sun, 7 Jul 2019 16:22:22 -0500 Subject: [PATCH 31/34] reformatted --- src/riccipy/metric.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/riccipy/metric.py b/src/riccipy/metric.py index 624379e..1cf68ba 100644 --- a/src/riccipy/metric.py +++ b/src/riccipy/metric.py @@ -5,8 +5,7 @@ from sympy.tensor.tensor import TensorIndexType from .partial import PartialDerivative -from .tensor import (AbstractTensor, ReplacementManager, Tensor, expand_tensor, - indices) +from .tensor import AbstractTensor, ReplacementManager, Tensor, expand_tensor, indices class Metric(AbstractTensor, TensorIndexType): From 290c5edb0c2119e8e21b09c173aaa7fa7a0f457c Mon Sep 17 00:00:00 2001 From: cjayross Date: Mon, 8 Jul 2019 04:43:57 -0500 Subject: [PATCH 32/34] replaced comments with docstrings --- src/riccipy/metrics/anti_de_sitter_1.py | 6 ++++-- src/riccipy/metrics/anti_de_sitter_2.py | 6 ++++-- src/riccipy/metrics/bayin.py | 6 ++++-- src/riccipy/metrics/beckers_sinzinkayo_demaret_1.py | 6 ++++-- src/riccipy/metrics/beckers_sinzinkayo_demaret_2.py | 6 ++++-- src/riccipy/metrics/bertotti_robinson_1.py | 12 +++++++----- src/riccipy/metrics/bertotti_robinson_2.py | 12 +++++++----- src/riccipy/metrics/bertotti_robinson_3.py | 12 +++++++----- src/riccipy/metrics/bertotti_robinson_4.py | 12 +++++++----- src/riccipy/metrics/bianchi_1.py | 4 +++- src/riccipy/metrics/bianchi_2.py | 4 +++- src/riccipy/metrics/bondi_1.py | 6 ++++-- src/riccipy/metrics/bondi_2.py | 6 ++++-- src/riccipy/metrics/bondi_3.py | 6 ++++-- src/riccipy/metrics/boost_1.py | 6 ++++-- src/riccipy/metrics/boost_2.py | 6 ++++-- src/riccipy/metrics/boost_3.py | 6 ++++-- src/riccipy/metrics/buchdahl_land.py | 12 +++++++----- src/riccipy/metrics/cmetric.py | 6 ++++-- src/riccipy/metrics/cross_const_curvature_1.py | 6 ++++-- src/riccipy/metrics/cross_const_curvature_2.py | 6 ++++-- src/riccipy/metrics/cross_const_curvature_3.py | 6 ++++-- src/riccipy/metrics/cross_const_curvature_4.py | 6 ++++-- src/riccipy/metrics/datta_1.py | 8 +++++--- src/riccipy/metrics/datta_2.py | 6 ++++-- src/riccipy/metrics/davidson.py | 6 ++++-- src/riccipy/metrics/de_sitter_1.py | 6 ++++-- src/riccipy/metrics/de_sitter_2.py | 6 ++++-- src/riccipy/metrics/de_sitter_3.py | 4 +++- src/riccipy/metrics/domain_wall.py | 4 +++- src/riccipy/metrics/dunn_tupper.py | 4 +++- src/riccipy/metrics/durgapal_1.py | 6 ++++-- src/riccipy/metrics/durgapal_2.py | 6 ++++-- src/riccipy/metrics/durgapal_3.py | 6 ++++-- src/riccipy/metrics/durgapal_fuloria.py | 6 ++++-- src/riccipy/metrics/einstein_1.py | 6 ++++-- src/riccipy/metrics/einstein_2.py | 6 ++++-- src/riccipy/metrics/einstein_3.py | 6 ++++-- src/riccipy/metrics/einstein_maxwell_1.py | 6 ++++-- src/riccipy/metrics/einstein_maxwell_2.py | 6 ++++-- src/riccipy/metrics/einstein_maxwell_3.py | 6 ++++-- src/riccipy/metrics/ellis_maccallum_1.py | 12 +++++++----- src/riccipy/metrics/ellis_maccallum_2.py | 8 +++++--- src/riccipy/metrics/faulkes.py | 6 ++++-- src/riccipy/metrics/godel.py | 8 +++++--- src/riccipy/metrics/godfrey.py | 8 +++++--- src/riccipy/metrics/gott.py | 6 ++++-- src/riccipy/metrics/griffiths.py | 6 ++++-- src/riccipy/metrics/harrison_1.py | 8 +++++--- src/riccipy/metrics/harrison_2.py | 8 +++++--- src/riccipy/metrics/harrison_3.py | 8 +++++--- src/riccipy/metrics/harrison_4.py | 8 +++++--- src/riccipy/metrics/harrison_5.py | 8 +++++--- src/riccipy/metrics/harrison_6.py | 8 +++++--- src/riccipy/metrics/harrison_7.py | 8 +++++--- src/riccipy/metrics/harrison_8.py | 8 +++++--- src/riccipy/metrics/heintzmann.py | 6 ++++-- src/riccipy/metrics/kasner_1.py | 4 +++- src/riccipy/metrics/kasner_2.py | 4 +++- src/riccipy/metrics/kerr_1.py | 6 ++++-- src/riccipy/metrics/kerr_2.py | 8 +++++--- src/riccipy/metrics/kerr_3.py | 4 +++- src/riccipy/metrics/kerr_newman_1.py | 6 ++++-- src/riccipy/metrics/kerr_newman_2.py | 8 +++++--- src/riccipy/metrics/klein.py | 4 +++- src/riccipy/metrics/kottler.py | 4 +++- src/riccipy/metrics/koutras_mcintosh.py | 6 ++++-- src/riccipy/metrics/kowalczynski_plebanski.py | 8 +++++--- src/riccipy/metrics/levi_civita_1.py | 6 ++++-- src/riccipy/metrics/levi_civita_2.py | 6 ++++-- src/riccipy/metrics/levi_civita_3.py | 6 ++++-- src/riccipy/metrics/levi_civita_4.py | 6 ++++-- src/riccipy/metrics/levi_civita_5.py | 6 ++++-- src/riccipy/metrics/levi_civita_6.py | 6 ++++-- src/riccipy/metrics/levi_civita_7.py | 6 ++++-- src/riccipy/metrics/levi_civita_8.py | 6 ++++-- src/riccipy/metrics/lewis_papapetrou.py | 6 ++++-- src/riccipy/metrics/lrs.py | 6 ++++-- src/riccipy/metrics/mclenaghan_tariq_tupper.py | 10 ++++++---- src/riccipy/metrics/mcvittie.py | 8 +++++--- src/riccipy/metrics/melvin.py | 10 ++++++---- src/riccipy/metrics/minkowski_1.py | 4 +++- src/riccipy/metrics/minkowski_2.py | 4 +++- src/riccipy/metrics/minkowski_3.py | 4 +++- src/riccipy/metrics/nariai.py | 6 ++++-- src/riccipy/metrics/novotny_horsky.py | 6 ++++-- src/riccipy/metrics/pant_sah.py | 6 ++++-- src/riccipy/metrics/plane_symmetric.py | 6 ++++-- src/riccipy/metrics/reissner_nordstrom_1.py | 8 +++++--- src/riccipy/metrics/reissner_nordstrom_2.py | 8 +++++--- src/riccipy/metrics/robertson_walker_1.py | 10 ++++++---- src/riccipy/metrics/robertson_walker_2.py | 10 ++++++---- src/riccipy/metrics/robertson_walker_3.py | 10 ++++++---- src/riccipy/metrics/schwarzschild_1.py | 8 +++++--- src/riccipy/metrics/schwarzschild_2.py | 10 ++++++---- src/riccipy/metrics/schwarzschild_3.py | 10 ++++++---- src/riccipy/metrics/schwarzschild_4.py | 4 +++- src/riccipy/metrics/schwarzschild_5.py | 4 +++- src/riccipy/metrics/schwarzschild_6.py | 5 +++-- src/riccipy/metrics/schwarzschild_7.py | 4 +++- src/riccipy/metrics/schwarzschild_8.py | 4 +++- src/riccipy/metrics/static_spherical_1.py | 6 ++++-- src/riccipy/metrics/static_spherical_2.py | 6 ++++-- src/riccipy/metrics/szekeres_1.py | 6 ++++-- src/riccipy/metrics/szekeres_2.py | 6 ++++-- src/riccipy/metrics/tariq_tupper.py | 8 +++++--- src/riccipy/metrics/taub_1.py | 8 +++++--- src/riccipy/metrics/taub_2.py | 6 ++++-- src/riccipy/metrics/tolman_1.py | 6 ++++-- src/riccipy/metrics/tolman_2.py | 6 ++++-- src/riccipy/metrics/tolman_3.py | 6 ++++-- src/riccipy/metrics/vaidya_1.py | 6 ++++-- src/riccipy/metrics/vaidya_2.py | 6 ++++-- src/riccipy/metrics/vaidya_3.py | 6 ++++-- src/riccipy/metrics/vaidya_4.py | 6 ++++-- 115 files changed, 495 insertions(+), 266 deletions(-) diff --git a/src/riccipy/metrics/anti_de_sitter_1.py b/src/riccipy/metrics/anti_de_sitter_1.py index f17cf1f..ca8c10c 100644 --- a/src/riccipy/metrics/anti_de_sitter_1.py +++ b/src/riccipy/metrics/anti_de_sitter_1.py @@ -1,5 +1,7 @@ -# anti-de Sitter space -# Hawking and Ellis (5.9) p131 +""" +Anti-de Sitter space +Hawking and Ellis (5.9) p131 +""" from sympy import cos, diag, sin, sinh, symbols coords = symbols("t chi theta phi", real=True) diff --git a/src/riccipy/metrics/anti_de_sitter_2.py b/src/riccipy/metrics/anti_de_sitter_2.py index eb37f7a..699607b 100644 --- a/src/riccipy/metrics/anti_de_sitter_2.py +++ b/src/riccipy/metrics/anti_de_sitter_2.py @@ -1,5 +1,7 @@ -# Static form of anti-de Sitter space -# Hawking and Ellis (5.9) p131 +""" +Static form of Anti-de Sitter space +Hawking and Ellis (5.9) p131 +""" from sympy import cosh, diag, sin, sinh, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/bayin.py b/src/riccipy/metrics/bayin.py index 7080019..f69fb00 100644 --- a/src/riccipy/metrics/bayin.py +++ b/src/riccipy/metrics/bayin.py @@ -1,5 +1,7 @@ -# Bayin's spherically symmetric static perfect fluid solution II -# Bayin, Phys. Rev. D, v18, p2745-2751, (1978) +""" +Bayin's spherically symmetric static perfect fluid solution II +Bayin, Phys. Rev. D, v18, p2745-2751, (1978) +""" from sympy import Rational, asin, sin, symbols, zeros coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/beckers_sinzinkayo_demaret_1.py b/src/riccipy/metrics/beckers_sinzinkayo_demaret_1.py index 142cb1e..b3e9484 100644 --- a/src/riccipy/metrics/beckers_sinzinkayo_demaret_1.py +++ b/src/riccipy/metrics/beckers_sinzinkayo_demaret_1.py @@ -1,5 +1,7 @@ -# Beckers, Sinzinkayo, and Demaret solution -# Beckers et al., Phys. Rev. D, v30, p1846, (1984) +""" +Beckers, Sinzinkayo, and Demaret solution +Beckers et al., Phys. Rev. D, v30, p1846, (1984) +""" from sympy import diag, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/beckers_sinzinkayo_demaret_2.py b/src/riccipy/metrics/beckers_sinzinkayo_demaret_2.py index c068175..046165a 100644 --- a/src/riccipy/metrics/beckers_sinzinkayo_demaret_2.py +++ b/src/riccipy/metrics/beckers_sinzinkayo_demaret_2.py @@ -1,5 +1,7 @@ -# Beckers, Sinzinkayo, and Demaret solution -# Beckers et al., Phys. Rev. D, v30, p1846, (1984) +""" +Beckers, Sinzinkayo, and Demaret solution +Beckers et al., Phys. Rev. D, v30, p1846, (1984) +""" from sympy import diag, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/bertotti_robinson_1.py b/src/riccipy/metrics/bertotti_robinson_1.py index 12e52de..a0c3e02 100644 --- a/src/riccipy/metrics/bertotti_robinson_1.py +++ b/src/riccipy/metrics/bertotti_robinson_1.py @@ -1,8 +1,10 @@ -# The Bertotti-Robinson solution -# Bertotti, Phys. Rev., v116, p1331, (1959) -# Bertotti, Commun. Math. Phys., v5, p257, (1967) -# Robinson, Commun. Math. Phys., v9, p161, (1968) -# Stephani (10.16) p120 +""" +The Bertotti-Robinson solution +Bertotti, Phys. Rev., v116, p1331, (1959) +Bertotti, Commun. Math. Phys., v5, p257, (1967) +Robinson, Commun. Math. Phys., v9, p161, (1968) +Stephani (10.16) p120 +""" from sympy import diag, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/bertotti_robinson_2.py b/src/riccipy/metrics/bertotti_robinson_2.py index 08e2cab..2a7ccf5 100644 --- a/src/riccipy/metrics/bertotti_robinson_2.py +++ b/src/riccipy/metrics/bertotti_robinson_2.py @@ -1,8 +1,10 @@ -# The Bertotti-Robinson solution -# Bertotti, Phys. Rev., v116, p1331, (1959) -# Lovelock, Commun. Math. Phys., v5, p257, (1967) -# Dolan, Commun. Math. Phys., v9, p161, (1968) -# Stephani (10.18) p121 +""" +The Bertotti-Robinson solution +Bertotti, Phys. Rev., v116, p1331, (1959) +Lovelock, Commun. Math. Phys., v5, p257, (1967) +Dolan, Commun. Math. Phys., v9, p161, (1968) +Stephani (10.18) p121 +""" from sympy import diag, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/bertotti_robinson_3.py b/src/riccipy/metrics/bertotti_robinson_3.py index 4f64dd7..1736b92 100644 --- a/src/riccipy/metrics/bertotti_robinson_3.py +++ b/src/riccipy/metrics/bertotti_robinson_3.py @@ -1,8 +1,10 @@ -# The Bertotti-Robinson solution -# Bertotti, Phys. Rev., v116, p1331, (1959) -# Lovelock, Commun. Math. Phys., v5, p257, (1967) -# Dolan, Commun. Math. Phys., v9, p161, (1968) -# Stephani (10.19) p120 +""" +The Bertotti-Robinson solution +Bertotti, Phys. Rev., v116, p1331, (1959) +Lovelock, Commun. Math. Phys., v5, p257, (1967) +Dolan, Commun. Math. Phys., v9, p161, (1968) +Stephani (10.19) p120 +""" from sympy import diag, sin, sinh, symbols coords = symbols("t x theta phi", real=True) diff --git a/src/riccipy/metrics/bertotti_robinson_4.py b/src/riccipy/metrics/bertotti_robinson_4.py index a566447..97a2329 100644 --- a/src/riccipy/metrics/bertotti_robinson_4.py +++ b/src/riccipy/metrics/bertotti_robinson_4.py @@ -1,8 +1,10 @@ -# The Bertotti-Robinson solution -# Bertotti, Phys. Rev., v116, p1331, (1959) -# Lovelock, Commun. Math. Phys., v5, p257, (1967) -# Dolan, Commun. Math. Phys., v9, p161, (1968) -# Stephani (32.95) p372 +""" +The Bertotti-Robinson solution +Bertotti, Phys. Rev., v116, p1331, (1959) +Lovelock, Commun. Math. Phys., v5, p257, (1967) +Dolan, Commun. Math. Phys., v9, p161, (1968) +Stephani (32.95) p372 +""" from sympy import cos, diag, symbols coords = symbols("t z x y", real=True) diff --git a/src/riccipy/metrics/bianchi_1.py b/src/riccipy/metrics/bianchi_1.py index d5a8079..f4fa74b 100644 --- a/src/riccipy/metrics/bianchi_1.py +++ b/src/riccipy/metrics/bianchi_1.py @@ -1,4 +1,6 @@ -# General metric from Bianchi II automorphisms +""" +General metric from Bianchi II automorphisms +""" from sympy import Function, diag, exp, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/bianchi_2.py b/src/riccipy/metrics/bianchi_2.py index 648a32d..86ea5d7 100644 --- a/src/riccipy/metrics/bianchi_2.py +++ b/src/riccipy/metrics/bianchi_2.py @@ -1,4 +1,6 @@ -# General metric from Bianchi IV automorphisms +""" +General metric from Bianchi IV automorphisms +""" from sympy import Function, diag, exp, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/bondi_1.py b/src/riccipy/metrics/bondi_1.py index 07cd6c7..8d79cca 100644 --- a/src/riccipy/metrics/bondi_1.py +++ b/src/riccipy/metrics/bondi_1.py @@ -1,5 +1,7 @@ -# Spherical Bondi metric in advanced (ingoing) coordinates -# Bondi, Proc. Roy. Soc. Lond. A, v282, p303, (1964) +""" +Spherical Bondi metric in advanced (ingoing) coordinates +Bondi, Proc. Roy. Soc. Lond. A, v282, p303, (1964) +""" from sympy import Function, diag, sin, symbols coords = symbols("r v theta phi", real=True) diff --git a/src/riccipy/metrics/bondi_2.py b/src/riccipy/metrics/bondi_2.py index d4c4795..306d6e6 100644 --- a/src/riccipy/metrics/bondi_2.py +++ b/src/riccipy/metrics/bondi_2.py @@ -1,5 +1,7 @@ -# Spherical Bondi metric in advanced (ingoing) coordinates -# Bondi, Proc. Roy. Soc. Lond. A, v282, p303, (1964) +""" +Spherical Bondi metric in advanced (ingoing) coordinates +Bondi, Proc. Roy. Soc. Lond. A, v282, p303, (1964) +""" from sympy import Function, diag, sin, symbols coords = symbols("r v theta phi", real=True) diff --git a/src/riccipy/metrics/bondi_3.py b/src/riccipy/metrics/bondi_3.py index a45e541..850185e 100644 --- a/src/riccipy/metrics/bondi_3.py +++ b/src/riccipy/metrics/bondi_3.py @@ -1,5 +1,7 @@ -# The Bondi metric -# Bondi, Proc. Roy. Soc. Lond. A, v269, p21, (1962) +""" +The Bondi metric +Bondi, Proc. Roy. Soc. Lond. A, v269, p21, (1962) +""" from sympy import Function, exp, sin, symbols, zeros coords = symbols("r u theta phi", real=True) diff --git a/src/riccipy/metrics/boost_1.py b/src/riccipy/metrics/boost_1.py index 0e6c779..cb18418 100644 --- a/src/riccipy/metrics/boost_1.py +++ b/src/riccipy/metrics/boost_1.py @@ -1,5 +1,7 @@ -# Metric with G4 on T3 and boost isotropy (flat case, k=0) -# Stephani (11.16) p128 +""" +Metric with G4 on T3 and boost isotropy (flat case, k=0) +Stephani (11.16) p128 +""" from sympy import Function, diag, symbols coords = symbols("t x y w", real=True) diff --git a/src/riccipy/metrics/boost_2.py b/src/riccipy/metrics/boost_2.py index 0d548b1..c19a2de 100644 --- a/src/riccipy/metrics/boost_2.py +++ b/src/riccipy/metrics/boost_2.py @@ -1,5 +1,7 @@ -# Metric with G4 on T3 and boost isotropy (flat case k=1) -# Stephani (11.16) p128 +""" +Metric with G4 on T3 and boost isotropy (flat case k=1) +Stephani (11.16) p128 +""" from sympy import Function, diag, symbols coords = symbols("t x y w", real=True) diff --git a/src/riccipy/metrics/boost_3.py b/src/riccipy/metrics/boost_3.py index 5463e6d..8f5526b 100644 --- a/src/riccipy/metrics/boost_3.py +++ b/src/riccipy/metrics/boost_3.py @@ -1,5 +1,7 @@ -# Metric with G4 on T3 and boost isotropy (flat case k=1) -# Stephani (11.16) p128 +""" +Metric with G4 on T3 and boost isotropy (flat case k=1) +Stephani (11.16) p128 +""" from sympy import Function, diag, symbols coords = symbols("t x y w", real=True) diff --git a/src/riccipy/metrics/buchdahl_land.py b/src/riccipy/metrics/buchdahl_land.py index 59fa77b..9d9a0d8 100644 --- a/src/riccipy/metrics/buchdahl_land.py +++ b/src/riccipy/metrics/buchdahl_land.py @@ -1,8 +1,10 @@ -# Buchdahl and Land's static spherically symmetric stiff perfect fluid with rhob=2 -# Tolman, Phys. Rev., v55, p363-373, (1939) -# Buchdahl et al., J. Austr. Math. Soc., v8, p6-16, (1968) -# Ibanez et al., J. Math. Phys., v23, p1363-1364, (1982) -# Stephani (11.16) p128 +""" +Buchdahl and Land's static spherically symmetric stiff perfect fluid with rhob=2 +Tolman, Phys. Rev., v55, p363-373, (1939) +Buchdahl et al., J. Austr. Math. Soc., v8, p6-16, (1968) +Ibanez et al., J. Math. Phys., v23, p1363-1364, (1982) +Stephani (11.16) p128 +""" from sympy import Rational, diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/cmetric.py b/src/riccipy/metrics/cmetric.py index ae9a2b1..f49122d 100644 --- a/src/riccipy/metrics/cmetric.py +++ b/src/riccipy/metrics/cmetric.py @@ -1,5 +1,7 @@ -# The C-metric -# Stephani (Table 16.2) p188 +""" +The C-metric +Stephani (Table 16.2) p188 +""" from sympy import Function, diag, symbols coords = symbols("t x y phi", real=True) diff --git a/src/riccipy/metrics/cross_const_curvature_1.py b/src/riccipy/metrics/cross_const_curvature_1.py index c694580..199a2e2 100644 --- a/src/riccipy/metrics/cross_const_curvature_1.py +++ b/src/riccipy/metrics/cross_const_curvature_1.py @@ -1,5 +1,7 @@ -# Cross product of two 2-dimensional subspaces of constant curvature -# Stephani (10.8) p118 +""" +Cross product of two 2-dimensional subspaces of constant curvature +Stephani (10.8) p118 +""" from sympy import diag, sin, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/cross_const_curvature_2.py b/src/riccipy/metrics/cross_const_curvature_2.py index 6785ce8..746d7f1 100644 --- a/src/riccipy/metrics/cross_const_curvature_2.py +++ b/src/riccipy/metrics/cross_const_curvature_2.py @@ -1,5 +1,7 @@ -# Cross product of two 2-dimensional subspaces of constant curvature -# Stephani (10.8) p118 +""" +Cross product of two 2-dimensional subspaces of constant curvature +Stephani (10.8) p118 +""" from sympy import diag, sin, sinh, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/cross_const_curvature_3.py b/src/riccipy/metrics/cross_const_curvature_3.py index b79bf1d..aa151f2 100644 --- a/src/riccipy/metrics/cross_const_curvature_3.py +++ b/src/riccipy/metrics/cross_const_curvature_3.py @@ -1,5 +1,7 @@ -# Cross product of two 2-dimensional subspaces of constant curvature -# Stephani (10.8) p118 +""" +Cross product of two 2-dimensional subspaces of constant curvature +Stephani (10.8) p118 +""" from sympy import diag, sin, sinh, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/cross_const_curvature_4.py b/src/riccipy/metrics/cross_const_curvature_4.py index 9193622..8d7adcb 100644 --- a/src/riccipy/metrics/cross_const_curvature_4.py +++ b/src/riccipy/metrics/cross_const_curvature_4.py @@ -1,5 +1,7 @@ -# Cross product of two 2-dimensional subspaces of constant curvature -# Stephani (10.8) p118 +""" +Cross product of two 2-dimensional subspaces of constant curvature +Stephani (10.8) p118 +""" from sympy import diag, sinh, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/datta_1.py b/src/riccipy/metrics/datta_1.py index cdfb5b7..e16a150 100644 --- a/src/riccipy/metrics/datta_1.py +++ b/src/riccipy/metrics/datta_1.py @@ -1,6 +1,8 @@ -# Datta's Einstein-Maxwell solution -# Datta, Nuovo Cim., v36, p109 -# Stephani (11.60) p137 +""" +Datta's Einstein-Maxwell solution +Datta, Nuovo Cim., v36, p109 +Stephani (11.60) p137 +""" from sympy import diag, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/datta_2.py b/src/riccipy/metrics/datta_2.py index f760fdb..6fc5507 100644 --- a/src/riccipy/metrics/datta_2.py +++ b/src/riccipy/metrics/datta_2.py @@ -1,5 +1,7 @@ -# Datta's Einstein-Maxwell solution -# Stephani (11.62) p137 +""" +Datta's Einstein-Maxwell solution +Stephani (11.62) p137 +""" from sympy import diag, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/davidson.py b/src/riccipy/metrics/davidson.py index 22c5567..007252e 100644 --- a/src/riccipy/metrics/davidson.py +++ b/src/riccipy/metrics/davidson.py @@ -1,5 +1,7 @@ -# Davidson's cylindrically symmetric radiation perfect fluid universe -# Davidson, J. Math. Phys., v32, p1560, (1991) +""" +Davidson's cylindrically symmetric radiation perfect fluid universe +Davidson, J. Math. Phys., v32, p1560, (1991) +""" from sympy import Rational, diag, symbols coords = symbols("t r z phi", real=True) diff --git a/src/riccipy/metrics/de_sitter_1.py b/src/riccipy/metrics/de_sitter_1.py index b9d5d2d..ef22b6c 100644 --- a/src/riccipy/metrics/de_sitter_1.py +++ b/src/riccipy/metrics/de_sitter_1.py @@ -1,5 +1,7 @@ -# de Sitter space -# Hawking and Ellis p125 +""" +de Sitter space +Hawking and Ellis p125 +""" from sympy import cosh, diag, sin, symbols coords = symbols("t chi theta phi", real=True) diff --git a/src/riccipy/metrics/de_sitter_2.py b/src/riccipy/metrics/de_sitter_2.py index 9417ef7..801ba20 100644 --- a/src/riccipy/metrics/de_sitter_2.py +++ b/src/riccipy/metrics/de_sitter_2.py @@ -1,5 +1,7 @@ -# de Sitter space -# Hawking and Ellis p125 +""" +de Sitter space +Hawking and Ellis p125 +""" from sympy import diag, exp, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/de_sitter_3.py b/src/riccipy/metrics/de_sitter_3.py index 7cb58ad..dc55847 100644 --- a/src/riccipy/metrics/de_sitter_3.py +++ b/src/riccipy/metrics/de_sitter_3.py @@ -1,4 +1,6 @@ -# de Sitter space with a non-zero cosmological constant +""" +de Sitter space with a non-zero cosmological constant +""" from sympy import diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/domain_wall.py b/src/riccipy/metrics/domain_wall.py index da20009..1edac36 100644 --- a/src/riccipy/metrics/domain_wall.py +++ b/src/riccipy/metrics/domain_wall.py @@ -1,4 +1,6 @@ -# Metric for spacetime with domain wall +""" +Metric for spacetime with domain wall +""" from sympy import diag, exp, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/dunn_tupper.py b/src/riccipy/metrics/dunn_tupper.py index 69f5173..0e1ebb4 100644 --- a/src/riccipy/metrics/dunn_tupper.py +++ b/src/riccipy/metrics/dunn_tupper.py @@ -1,4 +1,6 @@ -# Dunn and Tupper's G3VI0 perfect fluid solution +""" +Dunn and Tupper's G3VI0 perfect fluid solution +""" from sympy import diag, exp, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/durgapal_1.py b/src/riccipy/metrics/durgapal_1.py index e8f0d59..f53dd29 100644 --- a/src/riccipy/metrics/durgapal_1.py +++ b/src/riccipy/metrics/durgapal_1.py @@ -1,5 +1,7 @@ -# Durgapal's static spherically symmetric perfect fluid with n=3 -# Durgapal, J. Phys. A, v15, p2637-2644, (1982) +""" +Durgapal's static spherically symmetric perfect fluid with n=3 +Durgapal, J. Phys. A, v15, p2637-2644, (1982) +""" from sympy import sin, sqrt, symbols, zeros coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/durgapal_2.py b/src/riccipy/metrics/durgapal_2.py index b6085cd..c2f2631 100644 --- a/src/riccipy/metrics/durgapal_2.py +++ b/src/riccipy/metrics/durgapal_2.py @@ -1,5 +1,7 @@ -# Durgapal's static spherically symmetric perfect fluid with n=4 -# Durgapal, J. Phys. A, v15, p2637-2644, (1982) +""" +Durgapal's static spherically symmetric perfect fluid with n=4 +Durgapal, J. Phys. A, v15, p2637-2644, (1982) +""" from sympy import Rational, sin, symbols, zeros coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/durgapal_3.py b/src/riccipy/metrics/durgapal_3.py index 8dc260d..a5e6660 100644 --- a/src/riccipy/metrics/durgapal_3.py +++ b/src/riccipy/metrics/durgapal_3.py @@ -1,5 +1,7 @@ -# Durgapal's static spherically symmetric perfect fluid with n=5 -# Durgapal, J. Phys. A, v15, p2637-2644, (1982) +""" +Durgapal's static spherically symmetric perfect fluid with n=5 +Durgapal, J. Phys. A, v15, p2637-2644, (1982) +""" from sympy import Rational, sin, symbols, zeros coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/durgapal_fuloria.py b/src/riccipy/metrics/durgapal_fuloria.py index 9923dd1..f1e9d45 100644 --- a/src/riccipy/metrics/durgapal_fuloria.py +++ b/src/riccipy/metrics/durgapal_fuloria.py @@ -1,5 +1,7 @@ -# Durgapal and Fuloria's static spherically symmetric perfect fluid -# Durgapal et al., Gen. Rel. Grav., v17, p671-681, (1985) +""" +Durgapal and Fuloria's static spherically symmetric perfect fluid +Durgapal et al., Gen. Rel. Grav., v17, p671-681, (1985) +""" from sympy import diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/einstein_1.py b/src/riccipy/metrics/einstein_1.py index 957a5f9..50912f7 100644 --- a/src/riccipy/metrics/einstein_1.py +++ b/src/riccipy/metrics/einstein_1.py @@ -1,5 +1,7 @@ -# Einstein's static universe. Cartesian coordinates -# Stephani (10.23a) p122 +""" +Einstein's static universe. Cartesian coordinates +Stephani (10.23a) p122 +""" from sympy import diag, sqrt, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/einstein_2.py b/src/riccipy/metrics/einstein_2.py index fc3e331..5559744 100644 --- a/src/riccipy/metrics/einstein_2.py +++ b/src/riccipy/metrics/einstein_2.py @@ -1,5 +1,7 @@ -# Einstein's static universe. Polar coordinates -# Stephani (10.23b) p122 +""" +Einstein's static universe. Polar coordinates +Stephani (10.23b) p122 +""" from sympy import diag, sin, symbols coords = symbols("t chi theta phi", real=True) diff --git a/src/riccipy/metrics/einstein_3.py b/src/riccipy/metrics/einstein_3.py index a94dc1e..ea3ac81 100644 --- a/src/riccipy/metrics/einstein_3.py +++ b/src/riccipy/metrics/einstein_3.py @@ -1,5 +1,7 @@ -# Einstein's static universe. Curvature coordinates -# Stephani (10.23c) p122 +""" +Einstein's static universe. Curvature coordinates +Stephani (10.23c) p122 +""" from sympy import diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/einstein_maxwell_1.py b/src/riccipy/metrics/einstein_maxwell_1.py index 9b4ada8..0ff5cc8 100644 --- a/src/riccipy/metrics/einstein_maxwell_1.py +++ b/src/riccipy/metrics/einstein_maxwell_1.py @@ -1,5 +1,7 @@ -# Static cylindrically symmetric Einstein-Maxwell field (i) angular magnetic field (caused by an axial current) -# Stephani (20.9a) p221 +""" +Static cylindrically symmetric Einstein-Maxwell field (i) angular magnetic field (caused by an axial current) +Stephani (20.9a) p221 +""" from sympy import cosh, diag, log, symbols coords = symbols("t rho z phi", real=True) diff --git a/src/riccipy/metrics/einstein_maxwell_2.py b/src/riccipy/metrics/einstein_maxwell_2.py index 99f450b..11c2221 100644 --- a/src/riccipy/metrics/einstein_maxwell_2.py +++ b/src/riccipy/metrics/einstein_maxwell_2.py @@ -1,5 +1,7 @@ -# Static cylindrically symmetric Einstein-Maxwell field (ii) longitudinal magnetic field (caused by an angular current) -# Stephani (20.9b) p221 +""" +Static cylindrically symmetric Einstein-Maxwell field (ii) longitudinal magnetic field (caused by an angular current) +Stephani (20.9b) p221 +""" from sympy import cosh, diag, log, symbols coords = symbols("t rho z phi", real=True) diff --git a/src/riccipy/metrics/einstein_maxwell_3.py b/src/riccipy/metrics/einstein_maxwell_3.py index 78a472f..7f781bc 100644 --- a/src/riccipy/metrics/einstein_maxwell_3.py +++ b/src/riccipy/metrics/einstein_maxwell_3.py @@ -1,5 +1,7 @@ -# Static cylindrically symmetric Einstein-Maxwell field (iii) radial electric field (caused by an axial charge distribution) -# Stephani (20.9c) p221 +""" +Static cylindrically symmetric Einstein-Maxwell field (iii) radial electric field (caused by an axial charge distribution) +Stephani (20.9c) p221 +""" from sympy import cosh, diag, log, symbols coords = symbols("t rho z phi", real=True) diff --git a/src/riccipy/metrics/ellis_maccallum_1.py b/src/riccipy/metrics/ellis_maccallum_1.py index 739fa45..e2ae1ba 100644 --- a/src/riccipy/metrics/ellis_maccallum_1.py +++ b/src/riccipy/metrics/ellis_maccallum_1.py @@ -1,8 +1,10 @@ -# Ellis and MacCallum's G3VIo dust solution -# Ellis et al., Commun. Math. Phys., v12, p108, (1969) -# Dunn et al., Astrophys. J., v204, p322, (1976) -# Evans, Mon. Not. R. Ast. Soc., v183, p727, (1978) -# Stephani (12.25) p150 +""" +Ellis and MacCallum's G3VIo dust solution +Ellis et al., Commun. Math. Phys., v12, p108, (1969) +Dunn et al., Astrophys. J., v204, p322, (1976) +Evans, Mon. Not. R. Ast. Soc., v183, p727, (1978) +Stephani (12.25) p150 +""" from sympy import diag, exp, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/ellis_maccallum_2.py b/src/riccipy/metrics/ellis_maccallum_2.py index 49164d4..7122c6f 100644 --- a/src/riccipy/metrics/ellis_maccallum_2.py +++ b/src/riccipy/metrics/ellis_maccallum_2.py @@ -1,6 +1,8 @@ -# Ellis and MacCallum Bianchi VIo vacuum solution -# Ellis et al., Commun. Math. Phys., v12, p108, (1969) -# Stephani (11.56) p136 +""" +Ellis and MacCallum Bianchi VIo vacuum solution +Ellis et al., Commun. Math. Phys., v12, p108, (1969) +Stephani (11.56) p136 +""" from sympy import diag, exp, sqrt, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/faulkes.py b/src/riccipy/metrics/faulkes.py index cc07078..cbda137 100644 --- a/src/riccipy/metrics/faulkes.py +++ b/src/riccipy/metrics/faulkes.py @@ -1,5 +1,7 @@ -# Faulkes' non-static spherically symmetric perfect fluid solution -# Faulkes, Prog. Theor. Phys., v42, p1139-1142, (1969) +""" +Faulkes' non-static spherically symmetric perfect fluid solution +Faulkes, Prog. Theor. Phys., v42, p1139-1142, (1969) +""" from sympy import Function, diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/godel.py b/src/riccipy/metrics/godel.py index d32de80..199d65b 100644 --- a/src/riccipy/metrics/godel.py +++ b/src/riccipy/metrics/godel.py @@ -1,6 +1,8 @@ -# Godel metric -# Rev. Mod. Phys., v21, p447, (1949) -# Stephani (10.25) 122 +""" +Godel metric +Rev. Mod. Phys., v21, p447, (1949) +Stephani (10.25) 122 +""" from sympy import Rational, diag, exp, sqrt, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/godfrey.py b/src/riccipy/metrics/godfrey.py index f6271bb..52b0420 100644 --- a/src/riccipy/metrics/godfrey.py +++ b/src/riccipy/metrics/godfrey.py @@ -1,6 +1,8 @@ -# A vacuum metric admitting a nontrivial homothety which is non-null, not hypersurface-orthogonal, and whose homothetic bivector is null -# Godfrey, Gen. Rel. Grav., v3, p3, (1972) -# McIntosh, Gen. Rel. Grav., v7, p199-213, (1976) +""" +A vacuum metric admitting a nontrivial homothety which is non-null, not hypersurface-orthogonal, and whose homothetic bivector is null +Godfrey, Gen. Rel. Grav., v3, p3, (1972) +McIntosh, Gen. Rel. Grav., v7, p199-213, (1976) +""" from sympy import diag, exp, symbols coords = symbols("t r z phi", real=True) diff --git a/src/riccipy/metrics/gott.py b/src/riccipy/metrics/gott.py index 06cedaf..dda409e 100644 --- a/src/riccipy/metrics/gott.py +++ b/src/riccipy/metrics/gott.py @@ -1,5 +1,7 @@ -# Gott's interior solution for a cosmic string. -# Gott, Astrophys. J., v288, p422-427, (1985) +""" +Gott's interior solution for a cosmic string. +Gott, Astrophys. J., v288, p422-427, (1985) +""" from sympy import diag, sin, symbols coords = symbols("t r phi z", real=True) diff --git a/src/riccipy/metrics/griffiths.py b/src/riccipy/metrics/griffiths.py index 7f75c80..ab24906 100644 --- a/src/riccipy/metrics/griffiths.py +++ b/src/riccipy/metrics/griffiths.py @@ -1,5 +1,7 @@ -# Griffiths' metric -# Griffiths, Math. Proc. Camb. Phil. Soc., v77, p559, (1975) +""" +Griffiths' metric +Griffiths, Math. Proc. Camb. Phil. Soc., v77, p559, (1975) +""" from sympy import Rational, symbols, zeros coords = symbols("u v x y", real=True) diff --git a/src/riccipy/metrics/harrison_1.py b/src/riccipy/metrics/harrison_1.py index d0c0de1..2b7d516 100644 --- a/src/riccipy/metrics/harrison_1.py +++ b/src/riccipy/metrics/harrison_1.py @@ -1,6 +1,8 @@ -# Harrison III-12(b). Petrov type I -# Harrison, Phys. Rev., v116, p1285, (1959) -# d'Inverno et al., J. Math. Phys., v12, p1258, (1971) +""" +Harrison III-12(b). Petrov type I +Harrison, Phys. Rev., v116, p1285, (1959) +d'Inverno et al., J. Math. Phys., v12, p1258, (1971) +""" from sympy import Rational, cosh, symbols, zeros coords = symbols("x_0:4", real=True) diff --git a/src/riccipy/metrics/harrison_2.py b/src/riccipy/metrics/harrison_2.py index 22f419e..1369ddd 100644 --- a/src/riccipy/metrics/harrison_2.py +++ b/src/riccipy/metrics/harrison_2.py @@ -1,6 +1,8 @@ -# Harrison III-3 Petrov type D, Kinnersley class IV.B (C=0) -# Harrison, Phys. Rev., v116, p1285, (1959) -# d'Inverno et al., J. Math. Phys., v12, p1258, (1971) +""" +Harrison III-3 Petrov type D, Kinnersley class IV.B (C=0) +Harrison, Phys. Rev., v116, p1285, (1959) +d'Inverno et al., J. Math. Phys., v12, p1258, (1971) +""" from sympy import Rational, diag, sin, sqrt, symbols coords = symbols("x_0:4", real=True) diff --git a/src/riccipy/metrics/harrison_3.py b/src/riccipy/metrics/harrison_3.py index 1748284..852bb63 100644 --- a/src/riccipy/metrics/harrison_3.py +++ b/src/riccipy/metrics/harrison_3.py @@ -1,6 +1,8 @@ -# Harrison III-7(a) Petrov type D, Kinnersley class IV.B (C=1/2) -# Harrison, Phys. Rev., v116, p1285, (1959) -# d'Inverno et al., J. Math. Phys., v12, p1258, (1971) +""" +Harrison III-7(a) Petrov type D, Kinnersley class IV.B (C=1/2) +Harrison, Phys. Rev., v116, p1285, (1959) +d'Inverno et al., J. Math. Phys., v12, p1258, (1971) +""" from sympy import diag, sinh, symbols coords = symbols("x_0:4", real=True) diff --git a/src/riccipy/metrics/harrison_4.py b/src/riccipy/metrics/harrison_4.py index 49730e2..58cc610 100644 --- a/src/riccipy/metrics/harrison_4.py +++ b/src/riccipy/metrics/harrison_4.py @@ -1,6 +1,8 @@ -# Harrison III-7(b) Petrov type D, Kinnersley class IV.B (C=1/2) -# Harrison, Phys. Rev., v116, p1285, (1959) -# d'Inverno et al., J. Math. Phys., v12, p1258, (1971) +""" +Harrison III-7(b) Petrov type D, Kinnersley class IV.B (C=1/2) +Harrison, Phys. Rev., v116, p1285, (1959) +d'Inverno et al., J. Math. Phys., v12, p1258, (1971) +""" from sympy import cosh, diag, symbols coords = symbols("x_0:4", real=True) diff --git a/src/riccipy/metrics/harrison_5.py b/src/riccipy/metrics/harrison_5.py index cd4c6d4..b9c569e 100644 --- a/src/riccipy/metrics/harrison_5.py +++ b/src/riccipy/metrics/harrison_5.py @@ -1,6 +1,8 @@ -# Harrison III-7(a) Petrov type D, Kinnersley class IV.B (C=1/2) -# Harrison, Phys. Rev., v116, p1285, (1959) -# d'Inverno et al., J. Math. Phys., v12, p1258, (1971) +""" +Harrison III-7(a) Petrov type D, Kinnersley class IV.B (C=1/2) +Harrison, Phys. Rev., v116, p1285, (1959) +d'Inverno et al., J. Math. Phys., v12, p1258, (1971) +""" from sympy import diag, exp, symbols coords = symbols("x_0:4", real=True) diff --git a/src/riccipy/metrics/harrison_6.py b/src/riccipy/metrics/harrison_6.py index ec265ca..62c15b8 100644 --- a/src/riccipy/metrics/harrison_6.py +++ b/src/riccipy/metrics/harrison_6.py @@ -1,6 +1,8 @@ -# Harrison III-9(a) Petrov type D, Kinnersley class II.B (a=l=0) -# Harrison, Phys. Rev., v116, p1285, (1959) -# d'Inverno et al., J. Math. Phys., v12, p1258, (1971) +""" +Harrison III-9(a) Petrov type D, Kinnersley class II.B (a=l=0) +Harrison, Phys. Rev., v116, p1285, (1959) +d'Inverno et al., J. Math. Phys., v12, p1258, (1971) +""" from sympy import diag, sinh, symbols coords = symbols("x_0:4", real=True) diff --git a/src/riccipy/metrics/harrison_7.py b/src/riccipy/metrics/harrison_7.py index c1717c3..21b7db2 100644 --- a/src/riccipy/metrics/harrison_7.py +++ b/src/riccipy/metrics/harrison_7.py @@ -1,6 +1,8 @@ -# Harrison III-9(b) Petrov type D, Kinnersley class II.C (a=l=0) -# Harrison, Phys. Rev., v116, p1285, (1959) -# d'Inverno et al., J. Math. Phys., v12, p1258, (1971) +""" +Harrison III-9(b) Petrov type D, Kinnersley class II.C (a=l=0) +Harrison, Phys. Rev., v116, p1285, (1959) +d'Inverno et al., J. Math. Phys., v12, p1258, (1971) +""" from sympy import cosh, diag, symbols coords = symbols("x_0:4", real=True) diff --git a/src/riccipy/metrics/harrison_8.py b/src/riccipy/metrics/harrison_8.py index 7a1e974..e2fc8d5 100644 --- a/src/riccipy/metrics/harrison_8.py +++ b/src/riccipy/metrics/harrison_8.py @@ -1,6 +1,8 @@ -# Harrison III-9(c) Petrov type D, Kinnersley class II.D (a=l=0) -# Harrison, Phys. Rev., v116, p1285, (1959) -# d'Inverno et al., J. Math. Phys., v12, p1258, (1971) +""" +Harrison III-9(c) Petrov type D, Kinnersley class II.D (a=l=0) +Harrison, Phys. Rev., v116, p1285, (1959) +d'Inverno et al., J. Math. Phys., v12, p1258, (1971) +""" from sympy import diag, exp, symbols coords = symbols("x_0:4", real=True) diff --git a/src/riccipy/metrics/heintzmann.py b/src/riccipy/metrics/heintzmann.py index f0ed007..71d1f18 100644 --- a/src/riccipy/metrics/heintzmann.py +++ b/src/riccipy/metrics/heintzmann.py @@ -1,5 +1,7 @@ -# Heintzmann's static spherically symmetric perfect fluid solution -# Heintzmann, Z. Phys., v228, p489-493, (1969) +""" +Heintzmann's static spherically symmetric perfect fluid solution +Heintzmann, Z. Phys., v228, p489-493, (1969) +""" from sympy import diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/kasner_1.py b/src/riccipy/metrics/kasner_1.py index 9752ce2..636a832 100644 --- a/src/riccipy/metrics/kasner_1.py +++ b/src/riccipy/metrics/kasner_1.py @@ -1,4 +1,6 @@ -# Kasner power-law vacuum solution. Axisymmetric case +""" +Kasner power-law vacuum solution. Axisymmetric case +""" from sympy import Rational, diag, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/kasner_2.py b/src/riccipy/metrics/kasner_2.py index 00fbe66..97b2102 100644 --- a/src/riccipy/metrics/kasner_2.py +++ b/src/riccipy/metrics/kasner_2.py @@ -1,4 +1,6 @@ -# Kasner power-law vacuum solution. Axisymmetric flat case +""" +Kasner power-law vacuum solution. Axisymmetric flat case +""" from sympy import diag, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/kerr_1.py b/src/riccipy/metrics/kerr_1.py index 50899ad..cdda20a 100644 --- a/src/riccipy/metrics/kerr_1.py +++ b/src/riccipy/metrics/kerr_1.py @@ -1,5 +1,7 @@ -# Kerr metric in Cartesian coordinates -# Allen, Gen. Rel. Grav., v26, p21, (1994) +""" +Kerr metric in Cartesian coordinates +Allen, Gen. Rel. Grav., v26, p21, (1994) +""" from sympy import symbols, zeros coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/kerr_2.py b/src/riccipy/metrics/kerr_2.py index 83be2db..5fcd013 100644 --- a/src/riccipy/metrics/kerr_2.py +++ b/src/riccipy/metrics/kerr_2.py @@ -1,6 +1,8 @@ -# Kerr metric in Boyer Lindquist coordinates -# Boyer, J. Math. Phys., v8, p265, (1967) -# Stephani (18.25) p205 +""" +Kerr metric in Boyer Lindquist coordinates +Boyer, J. Math. Phys., v8, p265, (1967) +Stephani (18.25) p205 +""" from sympy import cos, sin, symbols, zeros coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/kerr_3.py b/src/riccipy/metrics/kerr_3.py index aa08fe9..54fc2e5 100644 --- a/src/riccipy/metrics/kerr_3.py +++ b/src/riccipy/metrics/kerr_3.py @@ -1,4 +1,6 @@ -# Kerr metric in outgoing Eddington Finkelstein form +""" +Kerr metric in outgoing Eddington Finkelstein form +""" from sympy import cos, sin, symbols, zeros coords = symbols("u r theta phi", real=True) diff --git a/src/riccipy/metrics/kerr_newman_1.py b/src/riccipy/metrics/kerr_newman_1.py index e89dd88..4737bc1 100644 --- a/src/riccipy/metrics/kerr_newman_1.py +++ b/src/riccipy/metrics/kerr_newman_1.py @@ -1,5 +1,7 @@ -# Kerr metric in Cartesian coordinates -# Allen, Gen. Rel. Grav., v26, p21, (1994) +""" +Kerr metric in Cartesian coordinates +Allen, Gen. Rel. Grav., v26, p21, (1994) +""" from sympy import symbols, zeros coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/kerr_newman_2.py b/src/riccipy/metrics/kerr_newman_2.py index 89a091e..016ac0d 100644 --- a/src/riccipy/metrics/kerr_newman_2.py +++ b/src/riccipy/metrics/kerr_newman_2.py @@ -1,6 +1,8 @@ -# Kerr metric in Boyer Lindquist coordinates -# Newman, J. Math. Phys., v6, p918, (1965) -# Stephani (19.19) p213 +""" +Kerr metric in Boyer Lindquist coordinates +Newman, J. Math. Phys., v6, p918, (1965) +Stephani (19.19) p213 +""" from sympy import cos, sin, symbols, zeros coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/klein.py b/src/riccipy/metrics/klein.py index 23fbbd3..0b81d92 100644 --- a/src/riccipy/metrics/klein.py +++ b/src/riccipy/metrics/klein.py @@ -1,4 +1,6 @@ -# Klein's static spherically symmetric radiation perfect fluid solution +""" +Klein's static spherically symmetric radiation perfect fluid solution +""" from sympy import Rational, diag, sin, sqrt, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/kottler.py b/src/riccipy/metrics/kottler.py index 527f9b2..a736553 100644 --- a/src/riccipy/metrics/kottler.py +++ b/src/riccipy/metrics/kottler.py @@ -1,4 +1,6 @@ -# Kottler's generalization of the Schwarzschild metric with non-zero cosmological constant. Aka Schwarzschild-de Sitter. +""" +Kottler's generalization of the Schwarzschild metric with non-zero cosmological constant. Aka Schwarzschild-de Sitter. +""" from sympy import diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/koutras_mcintosh.py b/src/riccipy/metrics/koutras_mcintosh.py index f7c05dc..3222ef7 100644 --- a/src/riccipy/metrics/koutras_mcintosh.py +++ b/src/riccipy/metrics/koutras_mcintosh.py @@ -1,5 +1,7 @@ -# Koutras-McIntosh metric (no symmetries or invariants) -# Koutras et al., Class. Quantum Grav., v13, pL47, (1996) +""" +Koutras-McIntosh metric (no symmetries or invariants) +Koutras et al., Class. Quantum Grav., v13, pL47, (1996) +""" from sympy import Function, symbols, zeros coords = symbols("w u x y", real=True) diff --git a/src/riccipy/metrics/kowalczynski_plebanski.py b/src/riccipy/metrics/kowalczynski_plebanski.py index e5bdbaf..1419b5f 100644 --- a/src/riccipy/metrics/kowalczynski_plebanski.py +++ b/src/riccipy/metrics/kowalczynski_plebanski.py @@ -1,6 +1,8 @@ -# Kowalczynski and Plebanski metric -# Kowalczynski et al., Int. J. Theor. Phys., v16, p371, (1977) -# Stephani (27.57) p297 +""" +Kowalczynski and Plebanski metric +Kowalczynski et al., Int. J. Theor. Phys., v16, p371, (1977) +Stephani (27.57) p297 +""" from sympy import diag, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/levi_civita_1.py b/src/riccipy/metrics/levi_civita_1.py index ae9ee0c..6f3912a 100644 --- a/src/riccipy/metrics/levi_civita_1.py +++ b/src/riccipy/metrics/levi_civita_1.py @@ -1,5 +1,7 @@ -# Levi-Civita solution, Class AI. Aka the exterior Schwarzschild metric. -# Stephani (Table 16.2) p188 +""" +Levi-Civita solution, Class AI. Aka the exterior Schwarzschild metric. +Stephani (Table 16.2) p188 +""" from sympy import diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/levi_civita_2.py b/src/riccipy/metrics/levi_civita_2.py index 5010475..e721ee7 100644 --- a/src/riccipy/metrics/levi_civita_2.py +++ b/src/riccipy/metrics/levi_civita_2.py @@ -1,5 +1,7 @@ -# Levi-Civita solution, Class AII -# Stephani (Table 16.2) p188 +""" +Levi-Civita solution, Class AII +Stephani (Table 16.2) p188 +""" from sympy import diag, sinh, symbols coords = symbols("t z r phi", real=True) diff --git a/src/riccipy/metrics/levi_civita_3.py b/src/riccipy/metrics/levi_civita_3.py index bdb97d9..3ac2064 100644 --- a/src/riccipy/metrics/levi_civita_3.py +++ b/src/riccipy/metrics/levi_civita_3.py @@ -1,5 +1,7 @@ -# Levi-Civita solution, Class AIII -# Stephani (Table 16.2) p188 +""" +Levi-Civita solution, Class AIII +Stephani (Table 16.2) p188 +""" from sympy import diag, symbols coords = symbols("t z r phi", real=True) diff --git a/src/riccipy/metrics/levi_civita_4.py b/src/riccipy/metrics/levi_civita_4.py index ff8607d..97a149e 100644 --- a/src/riccipy/metrics/levi_civita_4.py +++ b/src/riccipy/metrics/levi_civita_4.py @@ -1,5 +1,7 @@ -# Levi-Civita solution, Class BI -# Stephani (Table 16.2) p188 +""" +Levi-Civita solution, Class BI +Stephani (Table 16.2) p188 +""" from sympy import diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/levi_civita_5.py b/src/riccipy/metrics/levi_civita_5.py index 6249689..274e27f 100644 --- a/src/riccipy/metrics/levi_civita_5.py +++ b/src/riccipy/metrics/levi_civita_5.py @@ -1,5 +1,7 @@ -# Levi-Civita solution, Class BII -# Stephani (Table 16.2) p188 +""" +Levi-Civita solution, Class BII +Stephani (Table 16.2) p188 +""" from sympy import diag, sinh, symbols coords = symbols("t z r phi", real=True) diff --git a/src/riccipy/metrics/levi_civita_6.py b/src/riccipy/metrics/levi_civita_6.py index b371c28..f2a9d7d 100644 --- a/src/riccipy/metrics/levi_civita_6.py +++ b/src/riccipy/metrics/levi_civita_6.py @@ -1,5 +1,7 @@ -# Levi-Civita solution, Class BIII -# Stephani (Table 16.2) p188 +""" +Levi-Civita solution, Class BIII +Stephani (Table 16.2) p188 +""" from sympy import diag, symbols coords = symbols("t z r phi", real=True) diff --git a/src/riccipy/metrics/levi_civita_7.py b/src/riccipy/metrics/levi_civita_7.py index 38408e1..897eaf2 100644 --- a/src/riccipy/metrics/levi_civita_7.py +++ b/src/riccipy/metrics/levi_civita_7.py @@ -1,5 +1,7 @@ -# Levi-Civita static vacuum solution. Special case m=2, Petrov D -# Stephani (20.8) p221 +""" +Levi-Civita static vacuum solution. Special case m=2, Petrov D +Stephani (20.8) p221 +""" from sympy import diag, symbols coords = symbols("t rho z phi", real=True) diff --git a/src/riccipy/metrics/levi_civita_8.py b/src/riccipy/metrics/levi_civita_8.py index df08beb..8a0f9a5 100644 --- a/src/riccipy/metrics/levi_civita_8.py +++ b/src/riccipy/metrics/levi_civita_8.py @@ -1,5 +1,7 @@ -# Levi-Civita static vacuum solution -# Stephani (20.8) p221 +""" +Levi-Civita static vacuum solution +Stephani (20.8) p221 +""" from sympy import diag, symbols coords = symbols("t rho z phi", real=True) diff --git a/src/riccipy/metrics/lewis_papapetrou.py b/src/riccipy/metrics/lewis_papapetrou.py index 0170416..62df261 100644 --- a/src/riccipy/metrics/lewis_papapetrou.py +++ b/src/riccipy/metrics/lewis_papapetrou.py @@ -1,5 +1,7 @@ -# Lewis Papapetrou metric -# Ernst, Phys. Rev., v167, p1175, (1968) +""" +Lewis Papapetrou metric +Ernst, Phys. Rev., v167, p1175, (1968) +""" from sympy import Function, Rational, exp, symbols, zeros coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/lrs.py b/src/riccipy/metrics/lrs.py index 50703f8..aac4857 100644 --- a/src/riccipy/metrics/lrs.py +++ b/src/riccipy/metrics/lrs.py @@ -1,5 +1,7 @@ -# LRS stiff perfect fluid cosmological solution with G4 on S3 -# Stephani (12.11) p146 +""" +LRS stiff perfect fluid cosmological solution with G4 on S3 +Stephani (12.11) p146 +""" from sympy import diag, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/mclenaghan_tariq_tupper.py b/src/riccipy/metrics/mclenaghan_tariq_tupper.py index 0420d47..9296ec6 100644 --- a/src/riccipy/metrics/mclenaghan_tariq_tupper.py +++ b/src/riccipy/metrics/mclenaghan_tariq_tupper.py @@ -1,7 +1,9 @@ -# McLenaghan Tariq Tupper metric -# McLenaghan, J. Math. Phys., v16, p11, (1975) -# Tupper, Gen. Rel. Grav., v7, p479, (1976) -# Stephani (10.21) p121 +""" +McLenaghan Tariq Tupper metric +McLenaghan, J. Math. Phys., v16, p11, (1975) +Tupper, Gen. Rel. Grav., v7, p479, (1976) +Stephani (10.21) p121 +""" from sympy import diag, symbols coords = symbols("t x y phi", real=True) diff --git a/src/riccipy/metrics/mcvittie.py b/src/riccipy/metrics/mcvittie.py index a38674f..42a832f 100644 --- a/src/riccipy/metrics/mcvittie.py +++ b/src/riccipy/metrics/mcvittie.py @@ -1,6 +1,8 @@ -# McVittie's plane Einstein-Maxwell field with Lambda=0 -# McVittie, Prog. Roy. Soc. Lond., v124, p366, (1929) -# Stephani (13.26) p158 +""" +McVittie's plane Einstein-Maxwell field with Lambda=0 +McVittie, Prog. Roy. Soc. Lond., v124, p366, (1929) +Stephani (13.26) p158 +""" from sympy import diag, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/melvin.py b/src/riccipy/metrics/melvin.py index 2a23c2b..6de407d 100644 --- a/src/riccipy/metrics/melvin.py +++ b/src/riccipy/metrics/melvin.py @@ -1,7 +1,9 @@ -# Melvin's magnetic universe -# Bonnor, Prog. Roy. Soc. Lond., vA67, p225, (1954) -# Melvin, Phys. Lett., v8, p65, (1964) -# Stephani (20.10) p222 +""" +Melvin's magnetic universe +Bonnor, Prog. Roy. Soc. Lond., vA67, p225, (1954) +Melvin, Phys. Lett., v8, p65, (1964) +Stephani (20.10) p222 +""" from sympy import diag, symbols coords = symbols("t rho z phi", real=True) diff --git a/src/riccipy/metrics/minkowski_1.py b/src/riccipy/metrics/minkowski_1.py index 4d6638a..93f8348 100644 --- a/src/riccipy/metrics/minkowski_1.py +++ b/src/riccipy/metrics/minkowski_1.py @@ -1,4 +1,6 @@ -# Minkowski space in Cartesian coordinates +""" +Minkowski space in Cartesian coordinates +""" from sympy import diag, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/minkowski_2.py b/src/riccipy/metrics/minkowski_2.py index 9c1c9b5..536a25e 100644 --- a/src/riccipy/metrics/minkowski_2.py +++ b/src/riccipy/metrics/minkowski_2.py @@ -1,4 +1,6 @@ -# Minkowski space in polar coordinates +""" +Minkowski space in polar coordinates +""" from sympy import diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/minkowski_3.py b/src/riccipy/metrics/minkowski_3.py index e30b632..6d1576b 100644 --- a/src/riccipy/metrics/minkowski_3.py +++ b/src/riccipy/metrics/minkowski_3.py @@ -1,4 +1,6 @@ -# Minkowski space in null coordinates +""" +Minkowski space in null coordinates +""" from sympy import Rational, sin, symbols, zeros coords = symbols("u v theta phi", real=True) diff --git a/src/riccipy/metrics/nariai.py b/src/riccipy/metrics/nariai.py index 7c67299..3e47256 100644 --- a/src/riccipy/metrics/nariai.py +++ b/src/riccipy/metrics/nariai.py @@ -1,5 +1,7 @@ -# Nariai vacuum metric -# Nariai, Sci. Rep. Tohoku Univ., v35, p62, (1951) +""" +Nariai vacuum metric +Nariai, Sci. Rep. Tohoku Univ., v35, p62, (1951) +""" from sympy import Function, cos, diag, log, sin, sqrt, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/novotny_horsky.py b/src/riccipy/metrics/novotny_horsky.py index f5c1557..6dcb47c 100644 --- a/src/riccipy/metrics/novotny_horsky.py +++ b/src/riccipy/metrics/novotny_horsky.py @@ -1,5 +1,7 @@ -# Novotny and Horsky plane symmetric vacuum metric -# Novotny et al., Can. J. Phys., v24, p718, (1974) +""" +Novotny and Horsky plane symmetric vacuum metric +Novotny et al., Can. J. Phys., v24, p718, (1974) +""" from sympy import Rational, cos, diag, sin, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/pant_sah.py b/src/riccipy/metrics/pant_sah.py index cc69b44..aefc24d 100644 --- a/src/riccipy/metrics/pant_sah.py +++ b/src/riccipy/metrics/pant_sah.py @@ -1,5 +1,7 @@ -# Pant and Sah charged static spherically symmetric solution -# Pant et al., J. Math. Phys., v20, p2537-2539, (1979) +""" +Pant and Sah charged static spherically symmetric solution +Pant et al., J. Math. Phys., v20, p2537-2539, (1979) +""" from sympy import diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/plane_symmetric.py b/src/riccipy/metrics/plane_symmetric.py index 1deea32..0135e6f 100644 --- a/src/riccipy/metrics/plane_symmetric.py +++ b/src/riccipy/metrics/plane_symmetric.py @@ -1,5 +1,7 @@ -# Bianchi I plane symmetric model -# Stephani (13.49) p162 +""" +Bianchi I plane symmetric model +Stephani (13.49) p162 +""" from sympy import Function, diag, exp, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/reissner_nordstrom_1.py b/src/riccipy/metrics/reissner_nordstrom_1.py index 85a0344..cdc2322 100644 --- a/src/riccipy/metrics/reissner_nordstrom_1.py +++ b/src/riccipy/metrics/reissner_nordstrom_1.py @@ -1,6 +1,8 @@ -# Reissner-Nordstrom spherically symmetric electro-vacuum solution -# Reissner, Ann. Phys., v50, p106, (1916) -# Stephani (13.21) p158 +""" +Reissner-Nordstrom spherically symmetric electro-vacuum solution +Reissner, Ann. Phys., v50, p106, (1916) +Stephani (13.21) p158 +""" from sympy import diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/reissner_nordstrom_2.py b/src/riccipy/metrics/reissner_nordstrom_2.py index 35f5ff7..7bebcf3 100644 --- a/src/riccipy/metrics/reissner_nordstrom_2.py +++ b/src/riccipy/metrics/reissner_nordstrom_2.py @@ -1,6 +1,8 @@ -# Reissner-Nordstrom spherically symmetric electro-vacuum solution with non-zero cosmological constant -# Reissner, Ann. Phys., v50, p106, (1916) -# Stephani (Table 13.1) p157 +""" +Reissner-Nordstrom spherically symmetric electro-vacuum solution with non-zero cosmological constant +Reissner, Ann. Phys., v50, p106, (1916) +Stephani (Table 13.1) p157 +""" from sympy import diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/robertson_walker_1.py b/src/riccipy/metrics/robertson_walker_1.py index d0999fa..6bba855 100644 --- a/src/riccipy/metrics/robertson_walker_1.py +++ b/src/riccipy/metrics/robertson_walker_1.py @@ -1,7 +1,9 @@ -# Closed Friedman-Robertson-Walker metric. Perfect fluid -# Robertson, Astrophys. J., v82, p284, (1935) -# Robertson, Astrophys. J., v83, p137, (1936) -# Stephani (10.9) p118 +""" +Closed Friedman-Robertson-Walker metric. Perfect fluid +Robertson, Astrophys. J., v82, p284, (1935) +Robertson, Astrophys. J., v83, p137, (1936) +Stephani (10.9) p118 +""" from sympy import Function, diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/robertson_walker_2.py b/src/riccipy/metrics/robertson_walker_2.py index ad25f18..3d6d51e 100644 --- a/src/riccipy/metrics/robertson_walker_2.py +++ b/src/riccipy/metrics/robertson_walker_2.py @@ -1,7 +1,9 @@ -# Spatially flat Friedman-Robertson-Walker metric. Perfect fluid -# Robertson, Astrophys. J., v82, p284, (1935) -# Robertson, Astrophys. J., v83, p137, (1936) -# Stephani (10.9) p118 +""" +Spatially flat Friedman-Robertson-Walker metric. Perfect fluid +Robertson, Astrophys. J., v82, p284, (1935) +Robertson, Astrophys. J., v83, p137, (1936) +Stephani (10.9) p118 +""" from sympy import Function, diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/robertson_walker_3.py b/src/riccipy/metrics/robertson_walker_3.py index a81abda..b5927b1 100644 --- a/src/riccipy/metrics/robertson_walker_3.py +++ b/src/riccipy/metrics/robertson_walker_3.py @@ -1,7 +1,9 @@ -# Closed Friedman-Robertson-Walker metric. Dust -# Landau-Lifshitz (112.4), (112.9), (112.10) -# Stephani (12.3a) p122 -# Hawking and Ellis ch5.3 +""" +Closed Friedman-Robertson-Walker metric. Dust +Landau-Lifshitz (112.4), (112.9), (112.10) +Stephani (12.3a) p122 +Hawking and Ellis ch5.3 +""" from sympy import cos, diag, sin, symbols coords = symbols("nu chi theta phi", real=True) diff --git a/src/riccipy/metrics/schwarzschild_1.py b/src/riccipy/metrics/schwarzschild_1.py index 038780c..d67cf5f 100644 --- a/src/riccipy/metrics/schwarzschild_1.py +++ b/src/riccipy/metrics/schwarzschild_1.py @@ -1,6 +1,8 @@ -# Schwarzschild exterior metric in curvature coordinates -# Schwarzschild, Sitz. Preuss. Akad. Wiss., p189, (1916) -# Stephani (13.19) p157 +""" +Schwarzschild exterior metric in curvature coordinates +Schwarzschild, Sitz. Preuss. Akad. Wiss., p189, (1916) +Stephani (13.19) p157 +""" from sympy import diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/schwarzschild_2.py b/src/riccipy/metrics/schwarzschild_2.py index ff600c7..3ac1bec 100644 --- a/src/riccipy/metrics/schwarzschild_2.py +++ b/src/riccipy/metrics/schwarzschild_2.py @@ -1,7 +1,9 @@ -# Schwarzschild metric in outgoing Eddington-Finkelstein coordinates -# Eddington, Nature, v113, p192, (1924) -# Finkelstein, Phys. Rev., v110, p965, (1958) -# Stephani (13.23) p158 +""" +Schwarzschild metric in outgoing Eddington-Finkelstein coordinates +Eddington, Nature, v113, p192, (1924) +Finkelstein, Phys. Rev., v110, p965, (1958) +Stephani (13.23) p158 +""" from sympy import diag, sin, symbols coords = symbols("r u theta phi", real=True) diff --git a/src/riccipy/metrics/schwarzschild_3.py b/src/riccipy/metrics/schwarzschild_3.py index 5baae4f..d91a8d4 100644 --- a/src/riccipy/metrics/schwarzschild_3.py +++ b/src/riccipy/metrics/schwarzschild_3.py @@ -1,7 +1,9 @@ -# Schwarzschild metric in ingoing Eddington-Finkelstein coordinates -# Eddington, Nature, v113, p192, (1924) -# Finkelstein, Phys. Rev., v110, p965, (1958) -# Stephani (13.23) p158 +""" +Schwarzschild metric in ingoing Eddington-Finkelstein coordinates +Eddington, Nature, v113, p192, (1924) +Finkelstein, Phys. Rev., v110, p965, (1958) +Stephani (13.23) p158 +""" from sympy import diag, sin, symbols coords = symbols("r v theta phi", real=True) diff --git a/src/riccipy/metrics/schwarzschild_4.py b/src/riccipy/metrics/schwarzschild_4.py index 7a801b8..3fdcf6e 100644 --- a/src/riccipy/metrics/schwarzschild_4.py +++ b/src/riccipy/metrics/schwarzschild_4.py @@ -1,4 +1,6 @@ -# Schwarzschild exterior metric in isotropic coordinates +""" +Schwarzschild exterior metric in isotropic coordinates +""" from sympy import Rational, diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/schwarzschild_5.py b/src/riccipy/metrics/schwarzschild_5.py index fdd5001..948d51e 100644 --- a/src/riccipy/metrics/schwarzschild_5.py +++ b/src/riccipy/metrics/schwarzschild_5.py @@ -1,4 +1,6 @@ -# Schwarzschild exterior metric in Cartesian isotropic coordinates +""" +Schwarzschild exterior metric in Cartesian isotropic coordinates +""" from sympy import Rational, diag, sqrt, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/schwarzschild_6.py b/src/riccipy/metrics/schwarzschild_6.py index e52b348..684257d 100644 --- a/src/riccipy/metrics/schwarzschild_6.py +++ b/src/riccipy/metrics/schwarzschild_6.py @@ -1,5 +1,6 @@ -# Schwarzschild exterior metric in Israel coordinates -# Schwarzschild exterior metric in Israel coordinates +""" +Schwarzschild exterior metric in Israel coordinates +""" from sympy import Rational, diag, sin, symbols coords = symbols("u w theta phi", real=True) diff --git a/src/riccipy/metrics/schwarzschild_7.py b/src/riccipy/metrics/schwarzschild_7.py index ea1508b..8d2b55e 100644 --- a/src/riccipy/metrics/schwarzschild_7.py +++ b/src/riccipy/metrics/schwarzschild_7.py @@ -1,4 +1,6 @@ -# Schwarzschild metric as the rho->0 limit of Tolman-Bondi dust +""" +Schwarzschild metric as the rho->0 limit of Tolman-Bondi dust +""" from sympy import Rational, diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/schwarzschild_8.py b/src/riccipy/metrics/schwarzschild_8.py index ac23650..6524315 100644 --- a/src/riccipy/metrics/schwarzschild_8.py +++ b/src/riccipy/metrics/schwarzschild_8.py @@ -1,4 +1,6 @@ -# Schwarzschild interior solution in curvature coordinates +""" +Schwarzschild interior solution in curvature coordinates +""" from sympy import diag, sin, sqrt, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/static_spherical_1.py b/src/riccipy/metrics/static_spherical_1.py index 8158a06..8325c58 100644 --- a/src/riccipy/metrics/static_spherical_1.py +++ b/src/riccipy/metrics/static_spherical_1.py @@ -1,5 +1,7 @@ -# General static, spherically symmetric metric in curvature coordinates -# Stephani (14.1) p163 +""" +General static, spherically symmetric metric in curvature coordinates +Stephani (14.1) p163 +""" from sympy import Function, diag, exp, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/static_spherical_2.py b/src/riccipy/metrics/static_spherical_2.py index 828f7e5..e6a5892 100644 --- a/src/riccipy/metrics/static_spherical_2.py +++ b/src/riccipy/metrics/static_spherical_2.py @@ -1,5 +1,7 @@ -# General static, spherically symmetric metric in curvature coordinates -# Stephani (14.1) p163 +""" +General static, spherically symmetric metric in curvature coordinates +Stephani (14.1) p163 +""" from sympy import Function, diag, exp, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/szekeres_1.py b/src/riccipy/metrics/szekeres_1.py index b5842c9..049e80d 100644 --- a/src/riccipy/metrics/szekeres_1.py +++ b/src/riccipy/metrics/szekeres_1.py @@ -1,5 +1,7 @@ -# Szekeres solution for a special stiff perfect fluid -# Szekeres, Commun. Math. Phys., v41, p55, (1975) +""" +Szekeres solution for a special stiff perfect fluid +Szekeres, Commun. Math. Phys., v41, p55, (1975) +""" from sympy import cos, diag, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/szekeres_2.py b/src/riccipy/metrics/szekeres_2.py index 9704520..4b3d27a 100644 --- a/src/riccipy/metrics/szekeres_2.py +++ b/src/riccipy/metrics/szekeres_2.py @@ -1,5 +1,7 @@ -# Szekeres solution for a special stiff perfect fluid in Abelian type coordinates -# Szekeres, Commun. Math. Phys., v41, p55, (1975) +""" +Szekeres solution for a special stiff perfect fluid in Abelian type coordinates +Szekeres, Commun. Math. Phys., v41, p55, (1975) +""" from sympy import cosh, diag, exp, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/tariq_tupper.py b/src/riccipy/metrics/tariq_tupper.py index 821d606..c672dc7 100644 --- a/src/riccipy/metrics/tariq_tupper.py +++ b/src/riccipy/metrics/tariq_tupper.py @@ -1,6 +1,8 @@ -# Tariq and Tupper metric admitting a G3VIo on S3 -# Tariq et al., Gen. Rel. Grav., v6, p345, (1975) -# Stephani (11.64) p138 +""" +Tariq and Tupper metric admitting a G3VIo on S3 +Tariq et al., Gen. Rel. Grav., v6, p345, (1975) +Stephani (11.64) p138 +""" from sympy import diag, exp, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/taub_1.py b/src/riccipy/metrics/taub_1.py index adc5496..3e83920 100644 --- a/src/riccipy/metrics/taub_1.py +++ b/src/riccipy/metrics/taub_1.py @@ -1,6 +1,8 @@ -# Taub metric for plane symmetric, static perfect fluid. -# Taub, Phys. Rev., v103, p454, (1956) -# Stephani (13.44) p161 +""" +Taub metric for plane symmetric, static perfect fluid. +Taub, Phys. Rev., v103, p454, (1956) +Stephani (13.44) p161 +""" from sympy import diag, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/taub_2.py b/src/riccipy/metrics/taub_2.py index 74b6ab7..e2879ca 100644 --- a/src/riccipy/metrics/taub_2.py +++ b/src/riccipy/metrics/taub_2.py @@ -1,5 +1,7 @@ -# Taub's plane symmetric vacuum solution -# Taub, Ann. Math., v53, p473, (1951) +""" +Taub's plane symmetric vacuum solution +Taub, Ann. Math., v53, p473, (1951) +""" from sympy import diag, sqrt, symbols coords = symbols("t x y z", real=True) diff --git a/src/riccipy/metrics/tolman_1.py b/src/riccipy/metrics/tolman_1.py index 0032a71..f4ee5ac 100644 --- a/src/riccipy/metrics/tolman_1.py +++ b/src/riccipy/metrics/tolman_1.py @@ -1,5 +1,7 @@ -# Tolman's type IV solution -# Tolman, Phys. Rev., v55, p363-373, (1939) +""" +Tolman's type IV solution +Tolman, Phys. Rev., v55, p363-373, (1939) +""" from sympy import diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/tolman_2.py b/src/riccipy/metrics/tolman_2.py index 8f585ec..22b8c9b 100644 --- a/src/riccipy/metrics/tolman_2.py +++ b/src/riccipy/metrics/tolman_2.py @@ -1,5 +1,7 @@ -# Tolman's type VI solution -# Tolman, Phys. Rev., v55, p363-373, (1939) +""" +Tolman's type VI solution +Tolman, Phys. Rev., v55, p363-373, (1939) +""" from sympy import diag, sin, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/tolman_3.py b/src/riccipy/metrics/tolman_3.py index fbe2452..ecbb7d2 100644 --- a/src/riccipy/metrics/tolman_3.py +++ b/src/riccipy/metrics/tolman_3.py @@ -1,5 +1,7 @@ -# Tolman's type VII static spherically symmetric perfect fluid solution -# Tolman, Phys. Rev., v55, p363-373, (1939) +""" +Tolman's type VII static spherically symmetric perfect fluid solution +Tolman, Phys. Rev., v55, p363-373, (1939) +""" from sympy import Rational, diag, log, sin, sqrt, symbols coords = symbols("t r theta phi", real=True) diff --git a/src/riccipy/metrics/vaidya_1.py b/src/riccipy/metrics/vaidya_1.py index 86a5c4b..2efa352 100644 --- a/src/riccipy/metrics/vaidya_1.py +++ b/src/riccipy/metrics/vaidya_1.py @@ -1,5 +1,7 @@ -# Vaidya metric in outgoing Eddington-Finkelstein coordinates -# Stephani (13.20) p158 +""" +Vaidya metric in outgoing Eddington-Finkelstein coordinates +Stephani (13.20) p158 +""" from sympy import Function, diag, sin, symbols coords = symbols("r v theta phi", real=True) diff --git a/src/riccipy/metrics/vaidya_2.py b/src/riccipy/metrics/vaidya_2.py index 2c125a8..6342cf8 100644 --- a/src/riccipy/metrics/vaidya_2.py +++ b/src/riccipy/metrics/vaidya_2.py @@ -1,5 +1,7 @@ -# Vaidya metric in ingoing Eddington-Finkelstein coordinates -# Stephani (13.20) p158 +""" +Vaidya metric in ingoing Eddington-Finkelstein coordinates +Stephani (13.20) p158 +""" from sympy import Function, diag, sin, symbols coords = symbols("r v theta phi", real=True) diff --git a/src/riccipy/metrics/vaidya_3.py b/src/riccipy/metrics/vaidya_3.py index ad83666..cbb32e5 100644 --- a/src/riccipy/metrics/vaidya_3.py +++ b/src/riccipy/metrics/vaidya_3.py @@ -1,5 +1,7 @@ -# Vaidya metric with non-zero cosmological constant in outgoing Eddington-Finkelstein coordinates -# Stephani (13.20) p158 +""" +Vaidya metric with non-zero cosmological constant in outgoing Eddington-Finkelstein coordinates +Stephani (13.20) p158 +""" from sympy import Function, diag, sin, symbols coords = symbols("r v theta phi", real=True) diff --git a/src/riccipy/metrics/vaidya_4.py b/src/riccipy/metrics/vaidya_4.py index 264a350..fed0b18 100644 --- a/src/riccipy/metrics/vaidya_4.py +++ b/src/riccipy/metrics/vaidya_4.py @@ -1,5 +1,7 @@ -# Vaidya metric with non-zero cosmological constant in ingoing Eddington-Finkelstein coordinates -# Stephani (13.20) p158 +""" +Vaidya metric with non-zero cosmological constant in ingoing Eddington-Finkelstein coordinates +Stephani (13.20) p158 +""" from sympy import Function, diag, sin, symbols coords = symbols("r v theta phi", real=True) From 28699baa446f6a6dbdc7e3bbac83692dbbfa2f6c Mon Sep 17 00:00:00 2001 From: cjayross Date: Mon, 8 Jul 2019 04:55:38 -0500 Subject: [PATCH 33/34] removed del lines --- src/riccipy/metrics/anti_de_sitter_1.py | 1 - src/riccipy/metrics/anti_de_sitter_2.py | 1 - src/riccipy/metrics/bayin.py | 1 - src/riccipy/metrics/beckers_sinzinkayo_demaret_1.py | 1 - src/riccipy/metrics/beckers_sinzinkayo_demaret_2.py | 1 - src/riccipy/metrics/bertotti_robinson_1.py | 1 - src/riccipy/metrics/bertotti_robinson_2.py | 1 - src/riccipy/metrics/bertotti_robinson_3.py | 1 - src/riccipy/metrics/bertotti_robinson_4.py | 1 - src/riccipy/metrics/bianchi_1.py | 1 - src/riccipy/metrics/bianchi_2.py | 1 - src/riccipy/metrics/bondi_1.py | 1 - src/riccipy/metrics/bondi_2.py | 1 - src/riccipy/metrics/bondi_3.py | 1 - src/riccipy/metrics/boost_1.py | 1 - src/riccipy/metrics/boost_2.py | 1 - src/riccipy/metrics/boost_3.py | 1 - src/riccipy/metrics/buchdahl_land.py | 1 - src/riccipy/metrics/cmetric.py | 1 - src/riccipy/metrics/cross_const_curvature_1.py | 1 - src/riccipy/metrics/cross_const_curvature_2.py | 1 - src/riccipy/metrics/cross_const_curvature_3.py | 1 - src/riccipy/metrics/cross_const_curvature_4.py | 1 - src/riccipy/metrics/datta_1.py | 1 - src/riccipy/metrics/datta_2.py | 1 - src/riccipy/metrics/davidson.py | 1 - src/riccipy/metrics/de_sitter_1.py | 1 - src/riccipy/metrics/de_sitter_2.py | 1 - src/riccipy/metrics/de_sitter_3.py | 1 - src/riccipy/metrics/domain_wall.py | 1 - src/riccipy/metrics/dunn_tupper.py | 1 - src/riccipy/metrics/durgapal_1.py | 1 - src/riccipy/metrics/durgapal_2.py | 1 - src/riccipy/metrics/durgapal_3.py | 1 - src/riccipy/metrics/durgapal_fuloria.py | 1 - src/riccipy/metrics/einstein_1.py | 1 - src/riccipy/metrics/einstein_2.py | 1 - src/riccipy/metrics/einstein_3.py | 1 - src/riccipy/metrics/einstein_maxwell_1.py | 1 - src/riccipy/metrics/einstein_maxwell_2.py | 1 - src/riccipy/metrics/einstein_maxwell_3.py | 1 - src/riccipy/metrics/ellis_maccallum_1.py | 1 - src/riccipy/metrics/ellis_maccallum_2.py | 1 - src/riccipy/metrics/faulkes.py | 1 - src/riccipy/metrics/godel.py | 1 - src/riccipy/metrics/godfrey.py | 1 - src/riccipy/metrics/gott.py | 1 - src/riccipy/metrics/griffiths.py | 1 - src/riccipy/metrics/harrison_1.py | 1 - src/riccipy/metrics/harrison_2.py | 1 - src/riccipy/metrics/harrison_3.py | 1 - src/riccipy/metrics/harrison_4.py | 1 - src/riccipy/metrics/harrison_5.py | 1 - src/riccipy/metrics/harrison_6.py | 1 - src/riccipy/metrics/harrison_7.py | 1 - src/riccipy/metrics/harrison_8.py | 1 - src/riccipy/metrics/heintzmann.py | 1 - src/riccipy/metrics/kasner_1.py | 1 - src/riccipy/metrics/kasner_2.py | 1 - src/riccipy/metrics/kerr_1.py | 1 - src/riccipy/metrics/kerr_2.py | 1 - src/riccipy/metrics/kerr_3.py | 1 - src/riccipy/metrics/kerr_newman_1.py | 1 - src/riccipy/metrics/kerr_newman_2.py | 1 - src/riccipy/metrics/klein.py | 1 - src/riccipy/metrics/kottler.py | 1 - src/riccipy/metrics/koutras_mcintosh.py | 1 - src/riccipy/metrics/kowalczynski_plebanski.py | 1 - src/riccipy/metrics/levi_civita_1.py | 1 - src/riccipy/metrics/levi_civita_2.py | 1 - src/riccipy/metrics/levi_civita_3.py | 1 - src/riccipy/metrics/levi_civita_4.py | 1 - src/riccipy/metrics/levi_civita_5.py | 1 - src/riccipy/metrics/levi_civita_6.py | 1 - src/riccipy/metrics/levi_civita_7.py | 1 - src/riccipy/metrics/levi_civita_8.py | 1 - src/riccipy/metrics/lewis_papapetrou.py | 1 - src/riccipy/metrics/lrs.py | 1 - src/riccipy/metrics/mclenaghan_tariq_tupper.py | 1 - src/riccipy/metrics/mcvittie.py | 1 - src/riccipy/metrics/melvin.py | 1 - src/riccipy/metrics/minkowski_2.py | 1 - src/riccipy/metrics/minkowski_3.py | 1 - src/riccipy/metrics/nariai.py | 1 - src/riccipy/metrics/novotny_horsky.py | 1 - src/riccipy/metrics/pant_sah.py | 1 - src/riccipy/metrics/plane_symmetric.py | 1 - src/riccipy/metrics/reissner_nordstrom_1.py | 1 - src/riccipy/metrics/reissner_nordstrom_2.py | 1 - src/riccipy/metrics/robertson_walker_1.py | 1 - src/riccipy/metrics/robertson_walker_2.py | 1 - src/riccipy/metrics/robertson_walker_3.py | 1 - src/riccipy/metrics/schwarzschild_1.py | 1 - src/riccipy/metrics/schwarzschild_2.py | 1 - src/riccipy/metrics/schwarzschild_3.py | 1 - src/riccipy/metrics/schwarzschild_4.py | 1 - src/riccipy/metrics/schwarzschild_5.py | 1 - src/riccipy/metrics/schwarzschild_6.py | 1 - src/riccipy/metrics/schwarzschild_7.py | 1 - src/riccipy/metrics/schwarzschild_8.py | 1 - src/riccipy/metrics/static_spherical_1.py | 1 - src/riccipy/metrics/static_spherical_2.py | 1 - src/riccipy/metrics/szekeres_1.py | 1 - src/riccipy/metrics/szekeres_2.py | 1 - src/riccipy/metrics/tariq_tupper.py | 1 - src/riccipy/metrics/taub_1.py | 1 - src/riccipy/metrics/taub_2.py | 1 - src/riccipy/metrics/tolman_1.py | 1 - src/riccipy/metrics/tolman_2.py | 1 - src/riccipy/metrics/tolman_3.py | 1 - src/riccipy/metrics/vaidya_1.py | 1 - src/riccipy/metrics/vaidya_2.py | 1 - src/riccipy/metrics/vaidya_3.py | 1 - src/riccipy/metrics/vaidya_4.py | 1 - 114 files changed, 114 deletions(-) diff --git a/src/riccipy/metrics/anti_de_sitter_1.py b/src/riccipy/metrics/anti_de_sitter_1.py index ca8c10c..e3d2ce0 100644 --- a/src/riccipy/metrics/anti_de_sitter_1.py +++ b/src/riccipy/metrics/anti_de_sitter_1.py @@ -14,4 +14,3 @@ cos(t) ** 2 * sinh(ch) ** 2, cos(t) ** 2 * sinh(ch) ** 2 * sin(th) ** 2, ) -del t, ch, th, ph diff --git a/src/riccipy/metrics/anti_de_sitter_2.py b/src/riccipy/metrics/anti_de_sitter_2.py index 699607b..e103688 100644 --- a/src/riccipy/metrics/anti_de_sitter_2.py +++ b/src/riccipy/metrics/anti_de_sitter_2.py @@ -9,4 +9,3 @@ functions = () t, r, th, ph = coords metric = diag(-cosh(r) ** 2, 1, sinh(r) ** 2, sinh(r) ** 2 * sin(th) ** 2) -del t, r, th, ph diff --git a/src/riccipy/metrics/bayin.py b/src/riccipy/metrics/bayin.py index f69fb00..dc63bfa 100644 --- a/src/riccipy/metrics/bayin.py +++ b/src/riccipy/metrics/bayin.py @@ -16,4 +16,3 @@ metric[1, 1] = w0 ** 2 / (-r ** 4 + C1 * r ** 2 + w0 ** 2) metric[2, 2] = r ** 2 metric[3, 3] = r ** 2 * sin(th) ** 2 -del t, r, th, ph, w0, C0, C1 diff --git a/src/riccipy/metrics/beckers_sinzinkayo_demaret_1.py b/src/riccipy/metrics/beckers_sinzinkayo_demaret_1.py index b3e9484..9801b3e 100644 --- a/src/riccipy/metrics/beckers_sinzinkayo_demaret_1.py +++ b/src/riccipy/metrics/beckers_sinzinkayo_demaret_1.py @@ -11,4 +11,3 @@ k, d, m = variables expr = (k * x + d) ** (2 * m) metric = diag(-expr, expr, expr, expr) -del expr, t, x, y, z, k, d, m diff --git a/src/riccipy/metrics/beckers_sinzinkayo_demaret_2.py b/src/riccipy/metrics/beckers_sinzinkayo_demaret_2.py index 046165a..dcc9ab4 100644 --- a/src/riccipy/metrics/beckers_sinzinkayo_demaret_2.py +++ b/src/riccipy/metrics/beckers_sinzinkayo_demaret_2.py @@ -11,4 +11,3 @@ m = variables expr = x ** (2 * m) metric = diag(-expr, expr, expr, expr) -del expr, t, x, y, z, m diff --git a/src/riccipy/metrics/bertotti_robinson_1.py b/src/riccipy/metrics/bertotti_robinson_1.py index a0c3e02..4b6d946 100644 --- a/src/riccipy/metrics/bertotti_robinson_1.py +++ b/src/riccipy/metrics/bertotti_robinson_1.py @@ -12,4 +12,3 @@ functions = () t, x, y, z = coords metric = diag(-(1 + z ** 2), 1 - y ** 2, 1 / (1 - y ** 2), 1 / (1 + z ** 2)) -del t, x, y, z diff --git a/src/riccipy/metrics/bertotti_robinson_2.py b/src/riccipy/metrics/bertotti_robinson_2.py index 2a7ccf5..2b66bcd 100644 --- a/src/riccipy/metrics/bertotti_robinson_2.py +++ b/src/riccipy/metrics/bertotti_robinson_2.py @@ -13,4 +13,3 @@ t, r, th, ph = coords q = variables metric = diag(-q ** 2 / r ** 2, q ** 2 / r ** 2, q ** 2, q ** 2 * sin(th) ** 2) -del t, r, th, ph, q diff --git a/src/riccipy/metrics/bertotti_robinson_3.py b/src/riccipy/metrics/bertotti_robinson_3.py index 1736b92..3f55e8d 100644 --- a/src/riccipy/metrics/bertotti_robinson_3.py +++ b/src/riccipy/metrics/bertotti_robinson_3.py @@ -13,4 +13,3 @@ t, x, th, ph = coords k = variables metric = diag(-k ** 2 * sinh(x) ** 2, k ** 2, k ** 2, k ** 2 * sin(th) ** 2) -del t, x, th, ph, k diff --git a/src/riccipy/metrics/bertotti_robinson_4.py b/src/riccipy/metrics/bertotti_robinson_4.py index 97a2329..3eec009 100644 --- a/src/riccipy/metrics/bertotti_robinson_4.py +++ b/src/riccipy/metrics/bertotti_robinson_4.py @@ -13,4 +13,3 @@ t, x, y, z = coords om = variables metric = diag(-1, 1, cos(om * x) ** 2, cos(om * t) ** 2) -del t, x, y, z, om diff --git a/src/riccipy/metrics/bianchi_1.py b/src/riccipy/metrics/bianchi_1.py index f4fa74b..3bfdc2e 100644 --- a/src/riccipy/metrics/bianchi_1.py +++ b/src/riccipy/metrics/bianchi_1.py @@ -9,4 +9,3 @@ t, x, y, z = coords al = functions metric = diag(1, exp(-2 * al(t)), exp(al(t)), exp(al(t))) -del t, x, y, z, al diff --git a/src/riccipy/metrics/bianchi_2.py b/src/riccipy/metrics/bianchi_2.py index 86ea5d7..5b102e1 100644 --- a/src/riccipy/metrics/bianchi_2.py +++ b/src/riccipy/metrics/bianchi_2.py @@ -9,4 +9,3 @@ t, x, y, z = coords al, be, ga = functions metric = diag(1, exp(al(t)), exp(be(t)), exp(ga(t))) -del t, x, y, z, al, be, ga diff --git a/src/riccipy/metrics/bondi_1.py b/src/riccipy/metrics/bondi_1.py index 8d79cca..bb272b6 100644 --- a/src/riccipy/metrics/bondi_1.py +++ b/src/riccipy/metrics/bondi_1.py @@ -11,4 +11,3 @@ C, M = functions metric = diag(0, -C(r, v) ** 2 * (1 - 2 * M(r, v) / r), r ** 2, r ** 2 * sin(th) ** 2) metric[0, 1] = metric[1, 0] = C(r, v) -del r, v, th, ph, C, M diff --git a/src/riccipy/metrics/bondi_2.py b/src/riccipy/metrics/bondi_2.py index 306d6e6..2b45e60 100644 --- a/src/riccipy/metrics/bondi_2.py +++ b/src/riccipy/metrics/bondi_2.py @@ -11,4 +11,3 @@ C, M = functions metric = diag(0, -C(t, v) ** 2 * (1 - 2 * M(t, v) / t), t ** 2, t ** 2 * sin(th) ** 2) metric[0, 1] = metric[1, 0] = -C(r, v) -del r, v, th, ph, C, M diff --git a/src/riccipy/metrics/bondi_3.py b/src/riccipy/metrics/bondi_3.py index 850185e..26d911f 100644 --- a/src/riccipy/metrics/bondi_3.py +++ b/src/riccipy/metrics/bondi_3.py @@ -22,4 +22,3 @@ metric[3, 3] = r ** 2 * exp(-2 * ga(r, u, th)) * sin(th) ** 2 metric[0, 1] = metric[1, 0] = -exp(2 * Q(r, u, th)) metric[1, 2] = metric[2, 1] = -U(r, u, th) * r ** 2 * exp(2 * ga(r, u, th)) -del r, u, th, ph, Q, U, V, ga diff --git a/src/riccipy/metrics/boost_1.py b/src/riccipy/metrics/boost_1.py index cb18418..8b90a7b 100644 --- a/src/riccipy/metrics/boost_1.py +++ b/src/riccipy/metrics/boost_1.py @@ -10,4 +10,3 @@ t, x, y, w = coords al, be = functions metric = diag(-be(w) ** 2 * y ** 2, al(w) ** 2, be(w) ** 2, 1) -del t, x, y, w, al, be diff --git a/src/riccipy/metrics/boost_2.py b/src/riccipy/metrics/boost_2.py index c19a2de..870e3b3 100644 --- a/src/riccipy/metrics/boost_2.py +++ b/src/riccipy/metrics/boost_2.py @@ -10,4 +10,3 @@ t, x, y, w = coords al, be = functions metric = diag(-be(w) ** 2 * sinh(y) ** 2, al(w) ** 2, be(w) ** 2, 1) -del t, x, y, w, al, be diff --git a/src/riccipy/metrics/boost_3.py b/src/riccipy/metrics/boost_3.py index 8f5526b..f5ef587 100644 --- a/src/riccipy/metrics/boost_3.py +++ b/src/riccipy/metrics/boost_3.py @@ -10,4 +10,3 @@ t, x, y, w = coords al, be = functions metric = diag(-be(w) ** 2 * sin(y) ** 2, al(w) ** 2, be(w) ** 2, 1) -del t, x, y, w, al, be diff --git a/src/riccipy/metrics/buchdahl_land.py b/src/riccipy/metrics/buchdahl_land.py index 9d9a0d8..8d9f245 100644 --- a/src/riccipy/metrics/buchdahl_land.py +++ b/src/riccipy/metrics/buchdahl_land.py @@ -17,4 +17,3 @@ r ** 2, r ** 2 * sin(th) ** 2, ) -del t, r, th, ph diff --git a/src/riccipy/metrics/cmetric.py b/src/riccipy/metrics/cmetric.py index f49122d..4e1a3c4 100644 --- a/src/riccipy/metrics/cmetric.py +++ b/src/riccipy/metrics/cmetric.py @@ -15,4 +15,3 @@ 1 / ((x + y) ** 2 * h(y)), f(x) / (x + y) ** 2, ) -del t, x, y, ph, f, h diff --git a/src/riccipy/metrics/cross_const_curvature_1.py b/src/riccipy/metrics/cross_const_curvature_1.py index 199a2e2..df826b6 100644 --- a/src/riccipy/metrics/cross_const_curvature_1.py +++ b/src/riccipy/metrics/cross_const_curvature_1.py @@ -10,4 +10,3 @@ t, x, y, z = coords A, B = variables metric = diag(-B ** 2 * sin(z) ** 2, A ** 2, A ** 2 * sin(x) ** 2, B ** 2) -del t, x, y, z, A, B diff --git a/src/riccipy/metrics/cross_const_curvature_2.py b/src/riccipy/metrics/cross_const_curvature_2.py index 746d7f1..74106d6 100644 --- a/src/riccipy/metrics/cross_const_curvature_2.py +++ b/src/riccipy/metrics/cross_const_curvature_2.py @@ -10,4 +10,3 @@ t, x, y, z = coords A, B = variables metric = diag(-B ** 2 * sin(z) ** 2, A ** 2, A ** 2 * sinh(x) ** 2, B ** 2) -del t, x, y, z, A, B diff --git a/src/riccipy/metrics/cross_const_curvature_3.py b/src/riccipy/metrics/cross_const_curvature_3.py index aa151f2..eba7fd0 100644 --- a/src/riccipy/metrics/cross_const_curvature_3.py +++ b/src/riccipy/metrics/cross_const_curvature_3.py @@ -10,4 +10,3 @@ t, x, y, z = coords A, B = variables metric = diag(-B ** 2 * sinh(z) ** 2, A ** 2, A ** 2 * sin(x) ** 2, B ** 2) -del t, x, y, z, A, B diff --git a/src/riccipy/metrics/cross_const_curvature_4.py b/src/riccipy/metrics/cross_const_curvature_4.py index 8d7adcb..2926ef5 100644 --- a/src/riccipy/metrics/cross_const_curvature_4.py +++ b/src/riccipy/metrics/cross_const_curvature_4.py @@ -10,4 +10,3 @@ t, x, y, z = coords A, B = variables metric = diag(-B ** 2 * sinh(z) ** 2, A ** 2, A ** 2 * sinh(x) ** 2, B ** 2) -del t, x, y, z, A, B diff --git a/src/riccipy/metrics/datta_1.py b/src/riccipy/metrics/datta_1.py index e16a150..fa944ef 100644 --- a/src/riccipy/metrics/datta_1.py +++ b/src/riccipy/metrics/datta_1.py @@ -11,4 +11,3 @@ t, x, y, z = coords a, b = variables metric = diag(-1 / (b / t - a / t ** 2), b / t - a / t ** 2, t ** 2, t ** 2) -del t, x, y, z, a, b diff --git a/src/riccipy/metrics/datta_2.py b/src/riccipy/metrics/datta_2.py index 6fc5507..5783aa9 100644 --- a/src/riccipy/metrics/datta_2.py +++ b/src/riccipy/metrics/datta_2.py @@ -13,4 +13,3 @@ metric = diag( -expr * t ** (2 * mu ** 2), 1 / expr, expr * t ** (2 * mu ** 2), t ** 2 * expr ) -del expr, t, x, y, z, C1, C2, mu diff --git a/src/riccipy/metrics/davidson.py b/src/riccipy/metrics/davidson.py index 007252e..b74c15d 100644 --- a/src/riccipy/metrics/davidson.py +++ b/src/riccipy/metrics/davidson.py @@ -15,4 +15,3 @@ t ** Rational(-2, 3) / expr, t ** Rational(4, 3) * r ** 2 / expr, ) -del expr, t, r, z, phi diff --git a/src/riccipy/metrics/de_sitter_1.py b/src/riccipy/metrics/de_sitter_1.py index ef22b6c..11f9084 100644 --- a/src/riccipy/metrics/de_sitter_1.py +++ b/src/riccipy/metrics/de_sitter_1.py @@ -11,4 +11,3 @@ al = variables expr = al ** 2 * cosh(t / al) ** 2 metric = diag(-1, expr, expr * sin(ch) ** 2, expr * sin(ch) ** 2 * sin(th) ** 2) -del expr, t, ch, th, ph diff --git a/src/riccipy/metrics/de_sitter_2.py b/src/riccipy/metrics/de_sitter_2.py index 801ba20..96ad513 100644 --- a/src/riccipy/metrics/de_sitter_2.py +++ b/src/riccipy/metrics/de_sitter_2.py @@ -11,4 +11,3 @@ al = variables expr = exp(2 * t / al) metric = diag(-1, expr, expr, expr) -del expr, t, x, y, z, al diff --git a/src/riccipy/metrics/de_sitter_3.py b/src/riccipy/metrics/de_sitter_3.py index dc55847..1272440 100644 --- a/src/riccipy/metrics/de_sitter_3.py +++ b/src/riccipy/metrics/de_sitter_3.py @@ -10,4 +10,3 @@ La = variables expr = 1 - La * r ** 2 / 3 metric = diag(-expr, 1 / expr, r ** 2, r ** 2 * sin(th) ** 2) -del expr, t, r, th, ph, La diff --git a/src/riccipy/metrics/domain_wall.py b/src/riccipy/metrics/domain_wall.py index 1edac36..61e3f04 100644 --- a/src/riccipy/metrics/domain_wall.py +++ b/src/riccipy/metrics/domain_wall.py @@ -11,4 +11,3 @@ expr1 = (1 - k * z) ** 2 expr2 = exp(2 * k * t) metric = diag(-expr1, expr1 * expr2, expr1 * expr2, 1) -del expr1, expr2, t, x, y, z, k diff --git a/src/riccipy/metrics/dunn_tupper.py b/src/riccipy/metrics/dunn_tupper.py index 0e1ebb4..adfccf9 100644 --- a/src/riccipy/metrics/dunn_tupper.py +++ b/src/riccipy/metrics/dunn_tupper.py @@ -13,4 +13,3 @@ t ** (-2 * b) * exp(-4 * x), t ** (-2 * b) * exp(4 * x), ) -del t, x, y, z diff --git a/src/riccipy/metrics/durgapal_1.py b/src/riccipy/metrics/durgapal_1.py index f53dd29..5eda1fa 100644 --- a/src/riccipy/metrics/durgapal_1.py +++ b/src/riccipy/metrics/durgapal_1.py @@ -19,4 +19,3 @@ ) metric[2, 2] = r ** 2 metric[3, 3] = r ** 2 * sin(th) ** 2 -del t, r, th, ph, A, C, K diff --git a/src/riccipy/metrics/durgapal_2.py b/src/riccipy/metrics/durgapal_2.py index c2f2631..298941a 100644 --- a/src/riccipy/metrics/durgapal_2.py +++ b/src/riccipy/metrics/durgapal_2.py @@ -22,4 +22,3 @@ ) metric[2, 2] = r ** 2 metric[3, 3] = r ** 2 * sin(th) ** 2 -del t, r, th, ph, A, C, K diff --git a/src/riccipy/metrics/durgapal_3.py b/src/riccipy/metrics/durgapal_3.py index a5e6660..1639a8d 100644 --- a/src/riccipy/metrics/durgapal_3.py +++ b/src/riccipy/metrics/durgapal_3.py @@ -18,4 +18,3 @@ ) metric[2, 2] = r ** 2 metric[3, 3] = r ** 2 * sin(th) ** 2 -del t, r, th, ph, A, C, K diff --git a/src/riccipy/metrics/durgapal_fuloria.py b/src/riccipy/metrics/durgapal_fuloria.py index f1e9d45..2529d61 100644 --- a/src/riccipy/metrics/durgapal_fuloria.py +++ b/src/riccipy/metrics/durgapal_fuloria.py @@ -16,4 +16,3 @@ r ** 2, r ** 2 * sin(th) ** 2, ) -del expr, t, r, th, ph, B, C diff --git a/src/riccipy/metrics/einstein_1.py b/src/riccipy/metrics/einstein_1.py index 50912f7..3961bd7 100644 --- a/src/riccipy/metrics/einstein_1.py +++ b/src/riccipy/metrics/einstein_1.py @@ -11,4 +11,3 @@ K = variables expr = 1 / (1 + sqrt(x ** 2 + y ** 2 + z ** 2) / (4 * K ** 2)) ** 2 metric = diag(-1, expr, expr, expr) -del expr, t, x, y, z, K diff --git a/src/riccipy/metrics/einstein_2.py b/src/riccipy/metrics/einstein_2.py index 5559744..1e65541 100644 --- a/src/riccipy/metrics/einstein_2.py +++ b/src/riccipy/metrics/einstein_2.py @@ -10,4 +10,3 @@ t, ch, th, ph = coords La = variables metric = diag(-1 / La, 1 / La, sin(ch) ** 2 / La, sin(ch) ** 2 * sin(th) ** 2 / La) -del t, ch, th, ph, La diff --git a/src/riccipy/metrics/einstein_3.py b/src/riccipy/metrics/einstein_3.py index ea3ac81..440680a 100644 --- a/src/riccipy/metrics/einstein_3.py +++ b/src/riccipy/metrics/einstein_3.py @@ -10,4 +10,3 @@ t, r, th, ph = coords La = variables metric = diag(-1, 1 / (1 - La * r ** 2), r ** 2, r ** 2 * sin(th) ** 2) -del t, r, th, ph, La diff --git a/src/riccipy/metrics/einstein_maxwell_1.py b/src/riccipy/metrics/einstein_maxwell_1.py index 0ff5cc8..ef4d4c6 100644 --- a/src/riccipy/metrics/einstein_maxwell_1.py +++ b/src/riccipy/metrics/einstein_maxwell_1.py @@ -12,4 +12,3 @@ expr1 = cosh(log(a * rh ** m)) ** 2 expr2 = rh ** (2 * m ** 2) * b ** 2 * expr1 metric = diag(-expr2, expr2, 1 / (b ** 2 * expr1), rh ** 2 * b ** 2 * expr1) -del expr1, expr2, t, ph, rh, z, a, b, m diff --git a/src/riccipy/metrics/einstein_maxwell_2.py b/src/riccipy/metrics/einstein_maxwell_2.py index 11c2221..1575bac 100644 --- a/src/riccipy/metrics/einstein_maxwell_2.py +++ b/src/riccipy/metrics/einstein_maxwell_2.py @@ -12,4 +12,3 @@ expr1 = cosh(log(a * rh ** m)) ** 2 expr2 = rh ** (2 * m ** 2) * b ** 2 * expr1 metric = diag(-expr2, expr2, rh ** 2 * b ** 2 * expr1, 1 / (b ** 2 * expr1)) -del expr1, expr2, t, ph, rh, z, a, b, m diff --git a/src/riccipy/metrics/einstein_maxwell_3.py b/src/riccipy/metrics/einstein_maxwell_3.py index 7f781bc..ff2417e 100644 --- a/src/riccipy/metrics/einstein_maxwell_3.py +++ b/src/riccipy/metrics/einstein_maxwell_3.py @@ -12,4 +12,3 @@ expr1 = cosh(log(a * rh ** m)) ** 2 expr2 = rh ** (2 * m ** 2) * b ** 2 * expr1 metric = diag(-1 / (b ** 2 * expr1), expr2, expr2, rh ** 2 * b ** 2 * expr1) -del expr1, expr2, t, ph, rh, z, a, b, m diff --git a/src/riccipy/metrics/ellis_maccallum_1.py b/src/riccipy/metrics/ellis_maccallum_1.py index e2ae1ba..f0a246b 100644 --- a/src/riccipy/metrics/ellis_maccallum_1.py +++ b/src/riccipy/metrics/ellis_maccallum_1.py @@ -12,4 +12,3 @@ functions = () t, x, y, z = coords metric = diag(-1, 16 * t ** 2, t * exp(-4 * x), t * exp(4 * x)) -del t, x, y, z diff --git a/src/riccipy/metrics/ellis_maccallum_2.py b/src/riccipy/metrics/ellis_maccallum_2.py index 7122c6f..964cff0 100644 --- a/src/riccipy/metrics/ellis_maccallum_2.py +++ b/src/riccipy/metrics/ellis_maccallum_2.py @@ -16,4 +16,3 @@ t * exp(2 * n * x), t * exp(-2 * n * x), ) -del t, x, y, z, n diff --git a/src/riccipy/metrics/faulkes.py b/src/riccipy/metrics/faulkes.py index cbda137..bd8619c 100644 --- a/src/riccipy/metrics/faulkes.py +++ b/src/riccipy/metrics/faulkes.py @@ -14,4 +14,3 @@ metric = diag( -E(t) ** 2 / expr, expr ** 2, expr ** 2 * r ** 2, expr ** 2 * r ** 2 * sin(th) ** 2 ) -del expr, t, r, th, ph, k, E diff --git a/src/riccipy/metrics/godel.py b/src/riccipy/metrics/godel.py index 199d65b..b73c90d 100644 --- a/src/riccipy/metrics/godel.py +++ b/src/riccipy/metrics/godel.py @@ -12,4 +12,3 @@ om = variables metric = diag(-1, 1, -Rational(1, 2) * exp(2 * sqrt(2) * om * x), 1) metric[0, 2] = metric[2, 0] = -exp(sqrt(2) * om * x) -del t, x, y, z, om diff --git a/src/riccipy/metrics/godfrey.py b/src/riccipy/metrics/godfrey.py index 52b0420..f9ece85 100644 --- a/src/riccipy/metrics/godfrey.py +++ b/src/riccipy/metrics/godfrey.py @@ -12,4 +12,3 @@ a, C = variables expr = r ** (2 * a * (a - 1)) * exp(2 * (2 * a * z - z - r ** 2 / 2 + C)) metric = diag(-r ** (2 * a) * exp(2 * z), expr, expr, r ** (2 * (1 - a)) / exp(2 * z)) -del expr, t, r, z, ph, a, C diff --git a/src/riccipy/metrics/gott.py b/src/riccipy/metrics/gott.py index dda409e..a9f9bd1 100644 --- a/src/riccipy/metrics/gott.py +++ b/src/riccipy/metrics/gott.py @@ -10,4 +10,3 @@ t, r, ph, z = coords r0 = variables metric = diag(-1, 1, r0 ** 2 * sin(r / r0) ** 2, 1) -del t, r, ph, z, r0 diff --git a/src/riccipy/metrics/griffiths.py b/src/riccipy/metrics/griffiths.py index ab24906..cef856d 100644 --- a/src/riccipy/metrics/griffiths.py +++ b/src/riccipy/metrics/griffiths.py @@ -26,4 +26,3 @@ metric[1, 2] = metric[2, 1] = -a * (2 * u - y) metric[1, 3] = metric[3, 1] = -1 metric[2, 3] = metric[3, 2] = a * (v + u + 2 * y) -del u, v, x, y, a diff --git a/src/riccipy/metrics/harrison_1.py b/src/riccipy/metrics/harrison_1.py index 2b7d516..9bb6c2d 100644 --- a/src/riccipy/metrics/harrison_1.py +++ b/src/riccipy/metrics/harrison_1.py @@ -16,4 +16,3 @@ metric[1, 1] = a ** 2 * x0 ** 3 * x1 * cosh(x3) ** 3 metric[2, 2] = 1 / (x0 * x1 * cosh(x3)) metric[3, 3] = x0 ** Rational(7, 2) * expr -del expr, x0, x1, x2, x3, a diff --git a/src/riccipy/metrics/harrison_2.py b/src/riccipy/metrics/harrison_2.py index 1369ddd..3ade494 100644 --- a/src/riccipy/metrics/harrison_2.py +++ b/src/riccipy/metrics/harrison_2.py @@ -15,4 +15,3 @@ x1 * sin(x3), x1 ** Rational(3, 2) / sqrt(sin(x3)), ) -del x0, x1, x2, x3 diff --git a/src/riccipy/metrics/harrison_3.py b/src/riccipy/metrics/harrison_3.py index 852bb63..459b293 100644 --- a/src/riccipy/metrics/harrison_3.py +++ b/src/riccipy/metrics/harrison_3.py @@ -15,4 +15,3 @@ x3 ** 2, 1 / (1 - x3 ** 2) ** 4, ) -del x0, x1, x2, x3 diff --git a/src/riccipy/metrics/harrison_4.py b/src/riccipy/metrics/harrison_4.py index 58cc610..0c3c0e4 100644 --- a/src/riccipy/metrics/harrison_4.py +++ b/src/riccipy/metrics/harrison_4.py @@ -15,4 +15,3 @@ x3 ** 2, 1 / (1 - x3 ** 2) ** 4, ) -del x0, x1, x2, x3 diff --git a/src/riccipy/metrics/harrison_5.py b/src/riccipy/metrics/harrison_5.py index b9c569e..bf8b61f 100644 --- a/src/riccipy/metrics/harrison_5.py +++ b/src/riccipy/metrics/harrison_5.py @@ -15,4 +15,3 @@ x3 ** 2, 1 / (1 - x3 ** 2) ** 4, ) -del x0, x1, x2, x3 diff --git a/src/riccipy/metrics/harrison_6.py b/src/riccipy/metrics/harrison_6.py index 62c15b8..36375f9 100644 --- a/src/riccipy/metrics/harrison_6.py +++ b/src/riccipy/metrics/harrison_6.py @@ -15,4 +15,3 @@ 1 / (1 + x3 ** 2) ** 2, 1 / (1 + x3 ** 2) ** 4, ) -del x0, x1, x2, x3 diff --git a/src/riccipy/metrics/harrison_7.py b/src/riccipy/metrics/harrison_7.py index 21b7db2..ad590e7 100644 --- a/src/riccipy/metrics/harrison_7.py +++ b/src/riccipy/metrics/harrison_7.py @@ -15,4 +15,3 @@ 1 / (1 + x3 ** 2) ** 2, 1 / (1 + x3 ** 2) ** 4, ) -del x0, x1, x2, x3 diff --git a/src/riccipy/metrics/harrison_8.py b/src/riccipy/metrics/harrison_8.py index e2fc8d5..ada06c1 100644 --- a/src/riccipy/metrics/harrison_8.py +++ b/src/riccipy/metrics/harrison_8.py @@ -15,4 +15,3 @@ 1 / (1 + x3 ** 2) ** 2, 1 / (1 + x3 ** 2) ** 4, ) -del x0, x1, x2, x3 diff --git a/src/riccipy/metrics/heintzmann.py b/src/riccipy/metrics/heintzmann.py index 71d1f18..10fb742 100644 --- a/src/riccipy/metrics/heintzmann.py +++ b/src/riccipy/metrics/heintzmann.py @@ -12,4 +12,3 @@ metric = diag( -A ** 2 * (1 + a * r ** 2) ** 3, (1 + a * r ** 2) / K, r ** 2, r ** 2 * sin(th) ** 2 ) -del t, r, th, ph, A, a, K diff --git a/src/riccipy/metrics/kasner_1.py b/src/riccipy/metrics/kasner_1.py index 636a832..246d6f2 100644 --- a/src/riccipy/metrics/kasner_1.py +++ b/src/riccipy/metrics/kasner_1.py @@ -8,4 +8,3 @@ functions = () t, x, y, z = coords metric = diag(-1, t ** Rational(4, 3), t ** Rational(4, 3), t ** Rational(-2, 3)) -del t, x, y, z diff --git a/src/riccipy/metrics/kasner_2.py b/src/riccipy/metrics/kasner_2.py index 97b2102..f8e318b 100644 --- a/src/riccipy/metrics/kasner_2.py +++ b/src/riccipy/metrics/kasner_2.py @@ -8,4 +8,3 @@ functions = () t, x, y, z = coords metric = diag(-1, t ** 2, 1, 1) -del t, x, y, z diff --git a/src/riccipy/metrics/kerr_1.py b/src/riccipy/metrics/kerr_1.py index cdda20a..2240849 100644 --- a/src/riccipy/metrics/kerr_1.py +++ b/src/riccipy/metrics/kerr_1.py @@ -27,4 +27,3 @@ / expr ) metric[0, 3] = metric[3, 0] = 2 * a * M * x * (y ** 2 - 1) / expr -del expr, t, x, y, z, a, M diff --git a/src/riccipy/metrics/kerr_2.py b/src/riccipy/metrics/kerr_2.py index 5fcd013..d4aca01 100644 --- a/src/riccipy/metrics/kerr_2.py +++ b/src/riccipy/metrics/kerr_2.py @@ -28,4 +28,3 @@ / expr ) metric[0, 3] = metric[3, 0] = -2 * M * r * a * sin(th) ** 2 / expr -del expr, t, r, th, ph, a, M diff --git a/src/riccipy/metrics/kerr_3.py b/src/riccipy/metrics/kerr_3.py index 54fc2e5..c925534 100644 --- a/src/riccipy/metrics/kerr_3.py +++ b/src/riccipy/metrics/kerr_3.py @@ -27,4 +27,3 @@ metric[0, 1] = metric[1, 0] = -1 metric[0, 3] = metric[3, 0] = -2 * a * sin(th) ** 2 * M * r / expr metric[1, 3] = metric[3, 1] = a * sin(th) ** 2 -del expr, u, r, th, ph, a, M diff --git a/src/riccipy/metrics/kerr_newman_1.py b/src/riccipy/metrics/kerr_newman_1.py index 4737bc1..822eeaa 100644 --- a/src/riccipy/metrics/kerr_newman_1.py +++ b/src/riccipy/metrics/kerr_newman_1.py @@ -29,4 +29,3 @@ / expr ) metric[0, 3] = metric[3, 0] = a * (2 * M * x - Q ** 2) * (y ** 2 - 1) / expr -del expr, t, x, y, z, a, M, Q diff --git a/src/riccipy/metrics/kerr_newman_2.py b/src/riccipy/metrics/kerr_newman_2.py index 016ac0d..e4f4e8e 100644 --- a/src/riccipy/metrics/kerr_newman_2.py +++ b/src/riccipy/metrics/kerr_newman_2.py @@ -31,4 +31,3 @@ metric[0, 3] = metric[3, 0] = ( -(2 * a * sin(th) ** 2 * M * r - a * sin(th) ** 2 * Q ** 2) / expr ) -del expr, t, r, th, ph, a, M, Q diff --git a/src/riccipy/metrics/klein.py b/src/riccipy/metrics/klein.py index 0b81d92..c8bd8a9 100644 --- a/src/riccipy/metrics/klein.py +++ b/src/riccipy/metrics/klein.py @@ -9,4 +9,3 @@ t, r, th, ph = coords p0 = variables metric = diag(-sqrt(7 * p0) * r, Rational(7, 4), r ** 2, r ** 2 * sin(th) ** 2) -del t, r, th, ph, p0 diff --git a/src/riccipy/metrics/kottler.py b/src/riccipy/metrics/kottler.py index a736553..e6d51a2 100644 --- a/src/riccipy/metrics/kottler.py +++ b/src/riccipy/metrics/kottler.py @@ -10,4 +10,3 @@ M, La = variables expr = 1 - 2 * M / r - La * r ** 2 / 3 metric = diag(-expr, 1 / expr, r ** 2, r ** 2 * sin(th) ** 2) -del t, r, th, ph, M, La, expr diff --git a/src/riccipy/metrics/koutras_mcintosh.py b/src/riccipy/metrics/koutras_mcintosh.py index 3222ef7..b54a3c5 100644 --- a/src/riccipy/metrics/koutras_mcintosh.py +++ b/src/riccipy/metrics/koutras_mcintosh.py @@ -16,4 +16,3 @@ metric[3, 3] = 1 metric[0, 1] = metric[1, 0] = -(a * x + b) metric[1, 2] = metric[2, 1] = a * w -del w, u, x, y, a, b, f diff --git a/src/riccipy/metrics/kowalczynski_plebanski.py b/src/riccipy/metrics/kowalczynski_plebanski.py index 1419b5f..96239dc 100644 --- a/src/riccipy/metrics/kowalczynski_plebanski.py +++ b/src/riccipy/metrics/kowalczynski_plebanski.py @@ -15,4 +15,3 @@ metric = diag( -2 * expr1 / x ** 2, 2 / (expr2 * x ** 4), 2 * expr2, 2 / (expr1 * x ** 2) ) -del t, x, y, z, a, b, c, d, expr1, expr2 diff --git a/src/riccipy/metrics/levi_civita_1.py b/src/riccipy/metrics/levi_civita_1.py index 6f3912a..a155462 100644 --- a/src/riccipy/metrics/levi_civita_1.py +++ b/src/riccipy/metrics/levi_civita_1.py @@ -10,4 +10,3 @@ t, r, th, ph = coords M = variables metric = diag(-(1 - 2 * M / r), 1 / (1 - 2 * M / r), r ** 2, r ** 2 * sin(th) ** 2) -del t, r, th, ph, M diff --git a/src/riccipy/metrics/levi_civita_2.py b/src/riccipy/metrics/levi_civita_2.py index e721ee7..bc2ac5f 100644 --- a/src/riccipy/metrics/levi_civita_2.py +++ b/src/riccipy/metrics/levi_civita_2.py @@ -10,4 +10,3 @@ t, z, r, ph = coords M = variables metric = diag(-(2 * M / z - 1), 1 / (2 * M / z - 1), z ** 2, z ** 2 * sinh(r) ** 2) -del t, z, r, ph, M diff --git a/src/riccipy/metrics/levi_civita_3.py b/src/riccipy/metrics/levi_civita_3.py index 3ac2064..4790001 100644 --- a/src/riccipy/metrics/levi_civita_3.py +++ b/src/riccipy/metrics/levi_civita_3.py @@ -9,4 +9,3 @@ functions = () t, z, r, ph = coords metric = diag(-1 / z, z, z ** 2, z ** 2 * r ** 2) -del t, z, r, ph diff --git a/src/riccipy/metrics/levi_civita_4.py b/src/riccipy/metrics/levi_civita_4.py index 97a149e..046df6b 100644 --- a/src/riccipy/metrics/levi_civita_4.py +++ b/src/riccipy/metrics/levi_civita_4.py @@ -10,4 +10,3 @@ t, r, th, ph = coords M = variables metric = diag(-r ** 2 * sin(th) ** 2, 1 / (1 - 2 * M / r), r ** 2, 1 - 2 * M / r) -del t, r, th, ph, M diff --git a/src/riccipy/metrics/levi_civita_5.py b/src/riccipy/metrics/levi_civita_5.py index 274e27f..246a465 100644 --- a/src/riccipy/metrics/levi_civita_5.py +++ b/src/riccipy/metrics/levi_civita_5.py @@ -10,4 +10,3 @@ t, z, r, ph = coords M = variables metric = diag(-z ** 2 * sinh(r) ** 2, 1 / (2 * M / z - 1), z ** 2, 2 * M / z - 1) -del t, z, r, ph, M diff --git a/src/riccipy/metrics/levi_civita_6.py b/src/riccipy/metrics/levi_civita_6.py index f2a9d7d..2d9365a 100644 --- a/src/riccipy/metrics/levi_civita_6.py +++ b/src/riccipy/metrics/levi_civita_6.py @@ -9,4 +9,3 @@ functions = () t, z, r, ph = coords metric = diag(-r ** 2 * z ** 2, z, z ** 2, 1 / z) -del t, z, r, ph diff --git a/src/riccipy/metrics/levi_civita_7.py b/src/riccipy/metrics/levi_civita_7.py index 897eaf2..0a8b35c 100644 --- a/src/riccipy/metrics/levi_civita_7.py +++ b/src/riccipy/metrics/levi_civita_7.py @@ -9,4 +9,3 @@ functions = () t, rh, z, ph = coords metric = diag(-rh ** 4, rh ** 4, rh ** 4, 1 / rh ** 2) -del t, rh, z, ph diff --git a/src/riccipy/metrics/levi_civita_8.py b/src/riccipy/metrics/levi_civita_8.py index 8a0f9a5..4564b3b 100644 --- a/src/riccipy/metrics/levi_civita_8.py +++ b/src/riccipy/metrics/levi_civita_8.py @@ -15,4 +15,3 @@ rh ** (2 * (m ** 2 - m)), rh ** (2 * (1 - m)), ) -del t, rh, z, ph, m diff --git a/src/riccipy/metrics/lewis_papapetrou.py b/src/riccipy/metrics/lewis_papapetrou.py index 62df261..287aab1 100644 --- a/src/riccipy/metrics/lewis_papapetrou.py +++ b/src/riccipy/metrics/lewis_papapetrou.py @@ -16,4 +16,3 @@ ) metric[0, 3] = metric[3, 0] = -w(x, y) * exp(2 * s(x, y)) metric[1, 2] = metric[2, 1] = Rational(1, 2) * exp(2 * k(x, y) - 2 * s(x, y)) -del t, x, y, z, k, r, s, w diff --git a/src/riccipy/metrics/lrs.py b/src/riccipy/metrics/lrs.py index aac4857..14324c2 100644 --- a/src/riccipy/metrics/lrs.py +++ b/src/riccipy/metrics/lrs.py @@ -10,4 +10,3 @@ t, x, y, z = coords k = variables metric = diag(-1, t ** (2 / k), t ** (1 - 1 / k), t ** (1 - 1 / k)) -del t, x, y, z, k diff --git a/src/riccipy/metrics/mclenaghan_tariq_tupper.py b/src/riccipy/metrics/mclenaghan_tariq_tupper.py index 9296ec6..a14710b 100644 --- a/src/riccipy/metrics/mclenaghan_tariq_tupper.py +++ b/src/riccipy/metrics/mclenaghan_tariq_tupper.py @@ -12,4 +12,3 @@ t, x, y, ph = coords metric = diag(-1, a ** 2 / x ** 2, a ** 2 / x ** 2, x ** 2 - 4 * y ** 2) metric[0, 3] = metric[3, 0] = 2 * y -del t, x, y, ph diff --git a/src/riccipy/metrics/mcvittie.py b/src/riccipy/metrics/mcvittie.py index 42a832f..1016b87 100644 --- a/src/riccipy/metrics/mcvittie.py +++ b/src/riccipy/metrics/mcvittie.py @@ -11,4 +11,3 @@ t, x, y, z = coords M, Q = variables metric = diag(-(M / z + Q ** 2 / z ** 2), z ** 2, z ** 2, 1 / (M / z + Q ** 2 / z ** 2)) -del t, x, y, z, M, Q diff --git a/src/riccipy/metrics/melvin.py b/src/riccipy/metrics/melvin.py index 6de407d..0d6ef9c 100644 --- a/src/riccipy/metrics/melvin.py +++ b/src/riccipy/metrics/melvin.py @@ -13,4 +13,3 @@ B0 = variables expr = (1 + B0 ** 2 * rh ** 2 / 4) ** 2 metric = diag(-expr, expr, expr, rh ** 2 / expr) -del expr, t, rh, z, ph, B0 diff --git a/src/riccipy/metrics/minkowski_2.py b/src/riccipy/metrics/minkowski_2.py index 536a25e..1619cad 100644 --- a/src/riccipy/metrics/minkowski_2.py +++ b/src/riccipy/metrics/minkowski_2.py @@ -8,4 +8,3 @@ functions = () t, r, th, ph = coords metric = diag(-1, 1, r ** 2, r ** 2 * sin(th) ** 2) -del t, r, th, ph diff --git a/src/riccipy/metrics/minkowski_3.py b/src/riccipy/metrics/minkowski_3.py index 6d1576b..cbd56bd 100644 --- a/src/riccipy/metrics/minkowski_3.py +++ b/src/riccipy/metrics/minkowski_3.py @@ -12,4 +12,3 @@ metric[2, 2] = (a * u - Rational(1, 2) * v / a + c) ** 2 metric[3, 3] = (a * u - Rational(1, 2) * v / a + c) ** 2 * sin(th) ** 2 metric[0, 1] = metric[1, 0] = -1 -del u, v, th, ph, a, b diff --git a/src/riccipy/metrics/nariai.py b/src/riccipy/metrics/nariai.py index 3e47256..dfca266 100644 --- a/src/riccipy/metrics/nariai.py +++ b/src/riccipy/metrics/nariai.py @@ -13,4 +13,3 @@ expr1 = x ** 2 + y ** 2 + z ** 2 expr2 = a(t) * cos(log(sqrt(expr1) / la)) + b(t) * sin(log(sqrt(expr1) / la)) metric = diag(-expr2, la ** 2 / expr1, la ** 2 / expr1, la ** 2 / expr1) -del expr1, expr2, t, x, y, z, la, a, b diff --git a/src/riccipy/metrics/novotny_horsky.py b/src/riccipy/metrics/novotny_horsky.py index 6dcb47c..70a0443 100644 --- a/src/riccipy/metrics/novotny_horsky.py +++ b/src/riccipy/metrics/novotny_horsky.py @@ -15,4 +15,3 @@ sin(z) ** Rational(4, 3), 1 / a ** 2, ) -del t, x, y, z, a diff --git a/src/riccipy/metrics/pant_sah.py b/src/riccipy/metrics/pant_sah.py index aefc24d..7f5c065 100644 --- a/src/riccipy/metrics/pant_sah.py +++ b/src/riccipy/metrics/pant_sah.py @@ -10,4 +10,3 @@ t, r, th, ph = coords A, n = variables metric = diag(-A * r ** (2 * n), n ** 2 + 1, r ** 2, r ** 2 * sin(th) ** 2) -del t, r, th, ph, A, n diff --git a/src/riccipy/metrics/plane_symmetric.py b/src/riccipy/metrics/plane_symmetric.py index 0135e6f..4c96f59 100644 --- a/src/riccipy/metrics/plane_symmetric.py +++ b/src/riccipy/metrics/plane_symmetric.py @@ -10,4 +10,3 @@ t, x, y, z = coords al, be = functions metric = diag(-1, exp(2 * be(t)), exp(2 * be(t)), exp(2 * al(t))) -del t, x, y, z, al, be diff --git a/src/riccipy/metrics/reissner_nordstrom_1.py b/src/riccipy/metrics/reissner_nordstrom_1.py index cdc2322..bb5141a 100644 --- a/src/riccipy/metrics/reissner_nordstrom_1.py +++ b/src/riccipy/metrics/reissner_nordstrom_1.py @@ -12,4 +12,3 @@ M, Q = variables expr = 1 - 2 * M / r + Q ** 2 / r ** 2 metric = diag(-expr, 1 / expr, r ** 2, r ** 2 * sin(th) ** 2) -del expr, t, r, th, ph, M, Q diff --git a/src/riccipy/metrics/reissner_nordstrom_2.py b/src/riccipy/metrics/reissner_nordstrom_2.py index 7bebcf3..843437f 100644 --- a/src/riccipy/metrics/reissner_nordstrom_2.py +++ b/src/riccipy/metrics/reissner_nordstrom_2.py @@ -12,4 +12,3 @@ M, Q, La = variables expr = 1 - 2 * M / r + Q ** 2 / r ** 2 - La * r ** 2 / 3 metric = diag(-expr, 1 / expr, r ** 2, r ** 2 * sin(th) ** 2) -del expr, t, r, th, ph, M, Q diff --git a/src/riccipy/metrics/robertson_walker_1.py b/src/riccipy/metrics/robertson_walker_1.py index 6bba855..e658039 100644 --- a/src/riccipy/metrics/robertson_walker_1.py +++ b/src/riccipy/metrics/robertson_walker_1.py @@ -14,4 +14,3 @@ metric = diag( -1, a(t) ** 2, a(t) ** 2 * sin(r) ** 2, a(t) ** 2 * sin(r) ** 2 * sin(th) ** 2 ) -del t, r, th, ph, a diff --git a/src/riccipy/metrics/robertson_walker_2.py b/src/riccipy/metrics/robertson_walker_2.py index 3d6d51e..ddf119e 100644 --- a/src/riccipy/metrics/robertson_walker_2.py +++ b/src/riccipy/metrics/robertson_walker_2.py @@ -12,4 +12,3 @@ t, r, th, ph = coords a = functions metric = diag(-1, a(t) ** 2, a(t) ** 2 * r ** 2, a(t) ** 2 * r ** 2 * sin(th) ** 2) -del t, r, th, ph, a diff --git a/src/riccipy/metrics/robertson_walker_3.py b/src/riccipy/metrics/robertson_walker_3.py index b5927b1..09aa667 100644 --- a/src/riccipy/metrics/robertson_walker_3.py +++ b/src/riccipy/metrics/robertson_walker_3.py @@ -13,4 +13,3 @@ A0 = variables expr = A0 ** 2 * (1 - cos(nu)) ** 2 metric = diag(-expr, expr, expr * sin(ch) ** 2, expr * sin(ch) ** 2 * sin(th) ** 2) -del expr, nu, ch, th, ph, A0 diff --git a/src/riccipy/metrics/schwarzschild_1.py b/src/riccipy/metrics/schwarzschild_1.py index d67cf5f..002d030 100644 --- a/src/riccipy/metrics/schwarzschild_1.py +++ b/src/riccipy/metrics/schwarzschild_1.py @@ -11,4 +11,3 @@ t, r, th, ph = coords M = variables metric = diag(-(1 - 2 * M / r), 1 / (1 - 2 * M / r), r ** 2, r ** 2 * sin(th) ** 2) -del t, r, th, ph, M diff --git a/src/riccipy/metrics/schwarzschild_2.py b/src/riccipy/metrics/schwarzschild_2.py index 3ac1bec..adc6a3e 100644 --- a/src/riccipy/metrics/schwarzschild_2.py +++ b/src/riccipy/metrics/schwarzschild_2.py @@ -13,4 +13,3 @@ M = variables metric = diag(0, -(1 - 2 * M / r), r ** 2, r ** 2 * sin(th) ** 2) metric[0, 1] = metric[1, 0] = -1 -del r, u, th, ph, M diff --git a/src/riccipy/metrics/schwarzschild_3.py b/src/riccipy/metrics/schwarzschild_3.py index d91a8d4..29c2c25 100644 --- a/src/riccipy/metrics/schwarzschild_3.py +++ b/src/riccipy/metrics/schwarzschild_3.py @@ -13,4 +13,3 @@ M = variables metric = diag(0, -(1 - 2 * M / r), r ** 2, r ** 2 * sin(th) ** 2) metric[0, 1] = metric[1, 0] = 1 -del r, v, th, ph, M diff --git a/src/riccipy/metrics/schwarzschild_4.py b/src/riccipy/metrics/schwarzschild_4.py index 3fdcf6e..6f45bf4 100644 --- a/src/riccipy/metrics/schwarzschild_4.py +++ b/src/riccipy/metrics/schwarzschild_4.py @@ -15,4 +15,3 @@ expr * r ** 2, expr * r ** 2 * sin(th) ** 2, ) -del expr, t, r, th, ph, M diff --git a/src/riccipy/metrics/schwarzschild_5.py b/src/riccipy/metrics/schwarzschild_5.py index 948d51e..ba81001 100644 --- a/src/riccipy/metrics/schwarzschild_5.py +++ b/src/riccipy/metrics/schwarzschild_5.py @@ -16,4 +16,3 @@ expr2, expr2, ) -del expr1, expr2, t, x, y, z, M diff --git a/src/riccipy/metrics/schwarzschild_6.py b/src/riccipy/metrics/schwarzschild_6.py index 684257d..1787fd4 100644 --- a/src/riccipy/metrics/schwarzschild_6.py +++ b/src/riccipy/metrics/schwarzschild_6.py @@ -13,4 +13,3 @@ Rational(1, 2) * w ** 2 / (M * expr), 0, expr ** 2, expr ** 2 * sin(th) ** 2 ) metric[0, 1] = metric[1, 0] = 1 -del expr, u, w, th, ph, M diff --git a/src/riccipy/metrics/schwarzschild_7.py b/src/riccipy/metrics/schwarzschild_7.py index 8d2b55e..c404355 100644 --- a/src/riccipy/metrics/schwarzschild_7.py +++ b/src/riccipy/metrics/schwarzschild_7.py @@ -15,4 +15,3 @@ expr ** Rational(2, 3), expr ** Rational(2, 3) * sin(th) ** 2, ) -del expr, t, r, th, ph, M diff --git a/src/riccipy/metrics/schwarzschild_8.py b/src/riccipy/metrics/schwarzschild_8.py index 6524315..f219dd8 100644 --- a/src/riccipy/metrics/schwarzschild_8.py +++ b/src/riccipy/metrics/schwarzschild_8.py @@ -14,4 +14,3 @@ r ** 2, r ** 2 * sin(th) ** 2, ) -del t, r, th, ph, A, B, R diff --git a/src/riccipy/metrics/static_spherical_1.py b/src/riccipy/metrics/static_spherical_1.py index 8325c58..ca0069a 100644 --- a/src/riccipy/metrics/static_spherical_1.py +++ b/src/riccipy/metrics/static_spherical_1.py @@ -10,4 +10,3 @@ t, r, th, ph = coords al, be = functions metric = diag(-exp(2 * al(r)), exp(2 * be(r)), r ** 2, r ** 2 * sin(th) ** 2) -del t, r, th, ph, al, be diff --git a/src/riccipy/metrics/static_spherical_2.py b/src/riccipy/metrics/static_spherical_2.py index e6a5892..afa8c5e 100644 --- a/src/riccipy/metrics/static_spherical_2.py +++ b/src/riccipy/metrics/static_spherical_2.py @@ -15,4 +15,3 @@ exp(2 * be(r)) * r ** 2, exp(2 * be(r)) * r ** 2 * sin(th) ** 2, ) -del t, r, th, ph, al, be diff --git a/src/riccipy/metrics/szekeres_1.py b/src/riccipy/metrics/szekeres_1.py index 049e80d..13fe54a 100644 --- a/src/riccipy/metrics/szekeres_1.py +++ b/src/riccipy/metrics/szekeres_1.py @@ -11,4 +11,3 @@ metric = diag( -x ** 6, x ** 4 * cos(2 * t) ** 2, x ** 2 / cos(2 * t), x ** 2 / cos(2 * t) ) -del t, x, y, z diff --git a/src/riccipy/metrics/szekeres_2.py b/src/riccipy/metrics/szekeres_2.py index 4b3d27a..fd8931d 100644 --- a/src/riccipy/metrics/szekeres_2.py +++ b/src/riccipy/metrics/szekeres_2.py @@ -14,4 +14,3 @@ exp(2 * x) * cosh(2 * t), exp(2 * x) * cosh(2 * t), ) -del t, x, y, z diff --git a/src/riccipy/metrics/tariq_tupper.py b/src/riccipy/metrics/tariq_tupper.py index c672dc7..d06ee36 100644 --- a/src/riccipy/metrics/tariq_tupper.py +++ b/src/riccipy/metrics/tariq_tupper.py @@ -10,4 +10,3 @@ functions = () t, x, y, z = coords metric = diag(-1, 4 * t ** 2 / 3, t / exp(2 * x), t * exp(2 * x)) -del t, x, y, z diff --git a/src/riccipy/metrics/taub_1.py b/src/riccipy/metrics/taub_1.py index 3e83920..e64c42b 100644 --- a/src/riccipy/metrics/taub_1.py +++ b/src/riccipy/metrics/taub_1.py @@ -11,4 +11,3 @@ t, x, y, z = coords mu = variables metric = diag(-(z - 3) ** 2, z ** 2, z ** 2, 3 / (mu * z ** 2)) -del t, x, y, z, mu diff --git a/src/riccipy/metrics/taub_2.py b/src/riccipy/metrics/taub_2.py index e2879ca..4b6a6c1 100644 --- a/src/riccipy/metrics/taub_2.py +++ b/src/riccipy/metrics/taub_2.py @@ -9,4 +9,3 @@ functions = () t, x, y, z = coords metric = diag(-1 / sqrt(z), z, z, 1 / sqrt(z)) -del t, x, y, z diff --git a/src/riccipy/metrics/tolman_1.py b/src/riccipy/metrics/tolman_1.py index f4ee5ac..628a1d9 100644 --- a/src/riccipy/metrics/tolman_1.py +++ b/src/riccipy/metrics/tolman_1.py @@ -15,4 +15,3 @@ r ** 2, r ** 2 * sin(th) ** 2, ) -del t, r, th, ph, A, B, R diff --git a/src/riccipy/metrics/tolman_2.py b/src/riccipy/metrics/tolman_2.py index 22b8c9b..c9920ab 100644 --- a/src/riccipy/metrics/tolman_2.py +++ b/src/riccipy/metrics/tolman_2.py @@ -15,4 +15,3 @@ r ** 2, r ** 2 * sin(th) ** 2, ) -del t, r, th, ph, A, B, n diff --git a/src/riccipy/metrics/tolman_3.py b/src/riccipy/metrics/tolman_3.py index ecbb7d2..63a8b91 100644 --- a/src/riccipy/metrics/tolman_3.py +++ b/src/riccipy/metrics/tolman_3.py @@ -16,4 +16,3 @@ ) ) metric = diag(-B ** 2 * expr2 ** 2, 1 / expr1, r ** 2, r ** 2 * sin(th) ** 2) -del expr1, expr2, t, r, th, ph, A, B, C, R diff --git a/src/riccipy/metrics/vaidya_1.py b/src/riccipy/metrics/vaidya_1.py index 2efa352..d86d769 100644 --- a/src/riccipy/metrics/vaidya_1.py +++ b/src/riccipy/metrics/vaidya_1.py @@ -11,4 +11,3 @@ M = functions metric = diag(0, -(1 - 2 * M(v) / r), r ** 2, r ** 2 * sin(th) ** 2) metric[0, 1] = metric[1, 0] = -1 -del r, v, th, ph, M diff --git a/src/riccipy/metrics/vaidya_2.py b/src/riccipy/metrics/vaidya_2.py index 6342cf8..d42df77 100644 --- a/src/riccipy/metrics/vaidya_2.py +++ b/src/riccipy/metrics/vaidya_2.py @@ -11,4 +11,3 @@ M = functions metric = diag(0, -(1 - 2 * M(v) / r), r ** 2, r ** 2 * sin(th) ** 2) metric[0, 1] = metric[1, 0] = 1 -del r, v, th, ph, M diff --git a/src/riccipy/metrics/vaidya_3.py b/src/riccipy/metrics/vaidya_3.py index cbb32e5..c631414 100644 --- a/src/riccipy/metrics/vaidya_3.py +++ b/src/riccipy/metrics/vaidya_3.py @@ -13,4 +13,3 @@ 0, -(1 - 2 * M(v) / r - Lambda * r ** 2 / 3), r ** 2, r ** 2 * sin(th) ** 2 ) metric[0, 1] = metric[1, 0] = -1 -del r, v, th, ph, M diff --git a/src/riccipy/metrics/vaidya_4.py b/src/riccipy/metrics/vaidya_4.py index fed0b18..404f366 100644 --- a/src/riccipy/metrics/vaidya_4.py +++ b/src/riccipy/metrics/vaidya_4.py @@ -13,4 +13,3 @@ 0, -(1 - 2 * M(v) / r - Lambda * r ** 2 / 3), r ** 2, r ** 2 * sin(th) ** 2 ) metric[0, 1] = metric[1, 0] = 1 -del r, v, th, ph, M From 66f1a979170e867378d467966b39308157c82c46 Mon Sep 17 00:00:00 2001 From: cjayross Date: Mon, 8 Jul 2019 19:53:50 -0500 Subject: [PATCH 34/34] fixed typo in static_spherical_1 --- src/riccipy/metrics/static_spherical_1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/riccipy/metrics/static_spherical_1.py b/src/riccipy/metrics/static_spherical_1.py index ca0069a..35109ed 100644 --- a/src/riccipy/metrics/static_spherical_1.py +++ b/src/riccipy/metrics/static_spherical_1.py @@ -6,7 +6,7 @@ coords = symbols("t r theta phi", real=True) variables = () -functions = symbolic("alpha beta", cls=Function) +functions = symbols("alpha beta", cls=Function) t, r, th, ph = coords al, be = functions metric = diag(-exp(2 * al(r)), exp(2 * be(r)), r ** 2, r ** 2 * sin(th) ** 2)