Dot logic with grad and nabla_grad

How is this evaluated in Fenics

dot( grad(u), grad(v))

If u and v are vectors.

From tensors algebra, it should be:

$$\partial_{x_k} u_i \partial_{x_j} v_k$$

But I think what Fenics is doing:

$$\partial_{x_k} u_i \partial_{x_k} v_j$$

With grad, I think it is contracting on the second index.

If someone has experimented it before can tell what exact operation is done and we make sure if it’s what is expected

See: How ufl.nabla_grad works? - #2 by dokken

and grad docs

Thank you for your reply. From documentation it is clear that nabla_grad is the transpose of grad. But my question was not about that. I was asking about the dot operator with two grads.

Mathematically the dot between two second order tensors should be equivalent to the matrix multiplication. But what I think Fenics is doing

$grad(u) \cdot grad(v) = A \cdot B.T$

Dot products are described in detail in: Form language — Unified Form Language (UFL) 2025.1.0 documentation