Hi paul.
Following your approach
{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];
v:=[v^{0}=12, v^{1}=-11];
ex:=g_{a b} v^{a};
You can assing the evaluated expression to a variable using python
's notation (the =
asignation, not the :=
from cadabra
)
evaluate(ex,join(g,v), rhsonly=True);
w = _;
If you want to loop the components of the resulting expression, I'd use (again) python
's notation
import cdb.core.component as comp
for xx in range(2):
comp.get_component(w, Ex(f"{xx}"));
Hope this would be useful.
Dox.