In the following code,
{u,v,x}::Coordinate.
f::Coordinate.
{a,b,c,d,e,g,h,p,r#}::Indices(full,values={u,v,x},position=independent).
\partial{#}::PartialDerivative.
\nabla{#}::Derivative.
g_{a b}::Metric.
g^{a b}::InverseMetric.
g_a^b::KroneckerDelta.
g^a_b::KroneckerDelta.
g^{a b}::Symmetric.
g_{a b}::Symmetric.
{n_u,n_v,\gamma,w,\alpha,\lambda,A,B,C}::Depends({u,v,f,x}).
{u,v}::Weight(label=field,value=1);
{f}::Weight(label=field,value=2);
metric:={g_{u v}=1,
g_{v u}=1,g_{v v}=-u**2\alpha,g_{v x}=u w,
g_{x v}=u w,g_{x x}=\gamma};
complete(_,$g^{a b}$);
from cdb.sympy.calculus import *
lamb:=(g^{a b}\partial_a{u v}\partial_b{u v})**{-1/2} ;
evaluate(_,metric,rhsonly=True);
substitute(_,$v->f/u$)
simplify(_);
substitute(_,$\alpha->a,w**2\gamma**{-1}->b$);
series(_,$f$,0,5/2);
substitute(_,$\bigO(A??)->0$)
keep_weight(_,$field=1$);
The final result is not right. There seems to be something wrong here.