def test_flrw(self): """Test Predefined FLRW metric""" assert repr(metric.flrw(cartesian=True)) == ('-c**2*TensorProduct(dt, dt) + a(t)**2*(TensorProduct(dx, dx) + ' 'TensorProduct(dy, dy) + TensorProduct(dz, dz))') assert repr(metric.flrw()) == ('-c**2*TensorProduct(dt, dt) + ' 'a(t)**2*(r**2*(sin(\\theta)**2*TensorProduct(d\\varphi, d\\varphi) + ' 'TensorProduct(d\\theta, d\\theta)) + TensorProduct(dr, dr)/(-k*r**2 + 1))') assert repr(metric.flrw(curvature_constant=1)) == ('-c**2*TensorProduct(dt, dt) + ' 'a(t)**2*(r**2*(sin(\\theta)**2*TensorProduct(d\\varphi, d\\varphi) + ' 'TensorProduct(d\\theta, d\\theta)) + TensorProduct(dr, dr)/(1 - r**2))')
def test_flrw_einstein_k(self): """FLRW Einstein""" g = metric.flrw() G_tt = curvature.einstein_tensor_component(0, 0, g) assert str( clean_expr(G_tt)) == '3*(k + Derivative(a(t), t)**2)/a(t)**2'
def test_flrw_ricci_scalar_cartesian(self): """FLRW Ricci Cartesian""" g = metric.flrw(cartesian=True) R = curvature.ricci_scalar(g) assert str( clean_expr(R) ) == '6*(a(t)*Derivative(a(t), (t, 2)) + Derivative(a(t), t)**2)/a(t)**2'
def test_flrw_ricci_cartesian(self): """FLRW Ricci Cartesian""" g = metric.flrw(cartesian=True) R_tt = curvature.ricci_tensor_component(0, 0, g) R_xx = curvature.ricci_tensor_component(1, 1, g) R_yy = curvature.ricci_tensor_component(2, 2, g) R_zz = curvature.ricci_tensor_component(3, 3, g) assert str(clean_expr(R_tt)) == '-3*Derivative(a(t), (t, 2))/a(t)' assert str( clean_expr(R_xx) ) == 'a(t)*Derivative(a(t), (t, 2)) + 2*Derivative(a(t), t)**2' assert str( clean_expr(R_yy) ) == 'a(t)*Derivative(a(t), (t, 2)) + 2*Derivative(a(t), t)**2' assert str( clean_expr(R_zz) ) == 'a(t)*Derivative(a(t), (t, 2)) + 2*Derivative(a(t), t)**2'
def met(self): """Make metric for other tests""" return metric.flrw(cartesian=True)
def test_flrw_einstein_cartesian(self): """FLRW Einstein""" g = metric.flrw(cartesian=True) G_tt = curvature.einstein_tensor_component(0, 0, g) assert str(clean_expr(G_tt)) == '3*Derivative(a(t), t)**2/a(t)**2'
def test_flrw_christoffel_symbols(self): """Test FLRW Christoffel Symbols""" g = metric.flrw(cartesian=True) G_t_xx = curvature.christoffel_symbol_component(0, 1, 1, g) assert str(clean_expr(G_t_xx)) == 'a(t)*Derivative(a(t), t)'
def met(self): """Make metric for other tests""" return metric.flrw()