I am able to compute g(v,v) but have to repeat the definition of the component definitions (values or functions). Below is the is the code that "works" but it is strange that I have to repeat the definition of g and v in the line
evaluate(ex, $g_{0 0}=28, g_{0 1}=2, g_{1 0}=3, g_{1 1}=-1,
v^{0}=12, v^{1}=-11 , v^{0}=12, v^{1}=-11$, rhsonly=True)
I want to write something like
evaluate(ex, [g, v])
or prefereably
evaluate(g(v,v))
############################
#CODE
{m,n,a,b,c,d,q,r,s}::Indices(values={0,1}).
g_{a b}::Metric.
g^{a b}::InverseMetric.
g:={g_{0 0}=28, g_{0 1}=2, g_{1 0}=3, g_{1 1}=-1}.
display(g)
display("......................0")
v:={v^{0}=12, v^{1}=-11}.
display(v)
display("......................1")
ex:=g_{a b} v^{b}.
display(ex)
display("......................2")
evaluate(ex, $v^{0}=12, v^{1}=-11$, rhsonly=True)
display(ex)
display("......................3")
ex:=g_{a b} v^{b}.
evaluate(ex, $g_{0 0}=28, g_{0 1}=2, g_{1 0}=3, g_{1 1}=-1, v^{0}=12, v^{1}=-11$, rhsonly=True)
display(ex)
display("......................4")
ex:=g_{a b} v^{a} v^{b}.
display(ex)
display("......................5")
evaluate(ex, $g_{0 0}=28, g_{0 1}=2, g_{1 0}=3, g_{1 1}=-1, v^{0}=12, v^{1}=-11 , v^{0}=12, v^{1}=-11$, rhsonly=True)
display(ex)
display("......................6")