I know that for a 1D function, I can calculate the numerical derivative at every point, (x1,y1)
$\DeclareMathOperator{\d}{d\!} (x_1,y_1)$, with dy/dx$\d y/\d x$ where dy = y2 - y0
$\d y = y_2 - y_0$ and dx = x2 - x0
$\d x = x_2 - x_0$. If my step size is small enough, the slope can be approximated as linear.
I know that the derivative of a tensor, Asay $A$, with dimensions nxn$n\times n$, with respect to another tensor, Bsay $B$, with dimensions nxn$n\times n$, will yield a 4th rank tensor of dimension nxnxnxn$n\times n\times n\times n$.
The question is on extending the linear approximation to tensor:
If I just want a rough estimate of the derivative of A$A$ with respect to B$B$, dA/dB$\d A/\d B$, is it ok to calculate the components of dA/dB$\d A/\d B$ following the numerical differentiation formula above? iI.e. for n = 6$n = 6$, I have:
dA/dB(1,1,1,1) = (A2(1,1) - A1(1,1)) / (B2(1,1) - B1(1,1))
dA/dB(1,2,1,1) = (A2(1,2) - A1(1,2)) / (B2(1,1) - B1(1,1))
dA/dB(1,3,1,1) = (A2(1,3) - A1(1,3)) / (B2(1,1) - B1(1,1))
$$ \begin{matrix} \dfrac{\d A}{\d B}(1,1,1,1) = \dfrac{A_2(1,1) - A_1(1,1)}{B_2(1,1) - B_1(1,1)}\\ \dfrac{\d A}{\d B}(1,2,1,1) = \dfrac{A_2(1,2) - A_1(1,2)}{B_2(1,1) - B_1(1,1)}\\ \dfrac{\d A}{\d B}(1,3,1,1) = \dfrac{A_2(1,3) - A_1(1,3)}{B_2(1,1) - B_1(1,1)} \end{matrix} $$ ... and so on, where A1$A_1$ and A2$A_2$ are the tensors A$A$ at two consecutive time steps.
Thanks in advance!