예제 #1
0
    Schwarzschild,
)


@pytest.mark.parametrize(
    "metric_instance",
    [
        AlcubierreWarp(),
        AntiDeSitter(),
        AntiDeSitterStatic(),
        DeSitter(),
        Schwarzschild(),
        Schwarzschild(c=1, sch=2),
        Kerr(),
        KerrNewman(),
        Minkowski(),
        MinkowskiCartesian(),
        MinkowskiPolar(),
        CMetric(),
        Davidson(),
        Godel(),
        BesselGravitationalWave(),
        BarriolaVilekin(),
        BertottiKasner(),
        Ernst(),
        JanisNewmanWinicour(),
        ReissnerNordstorm(),
    ],
)
def test_all_predefined_metrics(metric_instance):
    assert isinstance(metric_instance, MetricTensor)
예제 #2
0
def test_Minkowski_equality():
    # Minkowski and MinkowskiCartesian are same
    assert simplify_sympy_array(
        MinkowskiCartesian().tensor()) == simplify_sympy_array(
            Minkowski().tensor())
예제 #3
0
### "custom-pprint"
def pprint(expr):
    # unicode doesn't always play nicely with LaTeX
    sympy.pprint(expr, use_unicode=False)


### "Schwarzschild"
sch = Schwarzschild()
t = sch.tensor()
pprint(t)
### @end
assert isinstance(sch, einsteinpy.symbolic.metric.MetricTensor)
snippets['Schwarzschild'] = latex(t)

### "Minkowski"
mink = Minkowski(c=1)
t = mink.tensor()
pprint(t)
### @end
assert isinstance(sch, einsteinpy.symbolic.metric.MetricTensor)
snippets['Minkowski'] = latex(t)

### "DeSitter"
mink = DeSitter()
t = mink.tensor()
pprint(t)
### @end
assert isinstance(sch, einsteinpy.symbolic.metric.MetricTensor)
snippets['DeSitter'] = latex(t)

### "AntiDeSitter"