I'm working on an extension to General Relativity that uses Finsler geometry. The main difference is that a Finsler metric can depend not just on position, (denoted by $x^a$, say), but also on the tangent vector $y^a$ of a worldline passing through x. (Think of the generic $y^a$ as all possible velocities $dx^a(s)/ds$ of all worldlines that pass through $x$.)

In short, whereas the usual Riemannian metric is just position-dependent, i.e., $g_{ab}(x)$, the Finsler metric is something like $g_{ab}(x,y)$.

The Finsler metric is obtained from a scalar "fundamental function" $F = F(x,y)$, which is 1-homogeneous in y, as follows:

$$g_{ab}(x,y) = 1/2 \partial^2 F^2 / \partial y^a \partial y^b$$

Later, to compute a generalized connections and curvatures, the $\partial y^a$ need to be used in expressions that also have ordinary derivatives $\partial x^a$. (The 2 kinds of derivative commute, so that's ok.)

So I need to be able to write derivatives wrt the $y^a$ variables, (and evaluate concrete expressions in these accordingly through SymPy), but then be able to match the a,b indices on the $y$'s onto the "$g$" on the LHS.

So,... can Cadabra2 handle this somehow?

Cheers.