Suppose that we have a fourth order tensor ${\bf{A}}$
$${\bf{A}}=A_{ijkl} {\bf{e}}_i \otimes {\bf{e}}_j \otimes {\bf{e}}_k \otimes {\bf{e}}_l$$
in the orthonormal basis $\{{\bf{e}}_1,{\bf{e}}_2,{\bf{e}}_3\}$ for $\mathbb{R}^3$. Here, we have used Einstein summation convention which assume sum over any repeated index. Then we define the inverse of ${\bf{A}}$ denoted by ${\bf{B}}$ as follows
$${\bf{A}} : {\bf{B}} = {\bf{B}} : {\bf{A}} = {\bf{I}}$$
where ${\bf{I}}$ is the fourth order identity tensor
$$\begin{align} {\bf{I}} &=I_{ijkl} {\bf{e}}_i \otimes {\bf{e}}_j \otimes {\bf{e}}_k \otimes {\bf{e}}_l\\ &=\delta_{ik} \delta_{jl} {\bf{e}}_i \otimes {\bf{e}}_j \otimes {\bf{e}}_k \otimes {\bf{e}}_l \end{align}$$
where $\delta_{ij}$ is the Kronecker's Delta
$$\delta_{ij}= \begin{cases} 1 & i=j \\ 0 & i \ne j \end{cases}$$
and $:$ is the double contraction defined by
$${\bf{A}} : {\bf{B}}=A_{ijmn}B_{mnkl} {\bf{e}}_i \otimes {\bf{e}}_j \otimes {\bf{e}}_k \otimes {\bf{e}}_l$$
I want to write a code to compute ${\bf{B}}$. However, I could not find any good resource on the net that gives the elements of ${\bf{B}}$ in terms of the elements of ${\bf{A}}$. How should I compute ${\bf{B}} = {\bf{A}}^{-1}$?
An application of this can be found in the theory of elasticity, where the fourth order tensor have the following symmetries
$$A_{ijkl}=A_{jikl}=A_{ijlk}=A_{klij}.$$
That would be great if you can also touch upon this.
This is a few years late, but I've been workin gwith these types of tensors for a while now, so better late than never, eh? The OP mentioned elasticity, this post answers the question in the case of three dimensions. Since we deal with tensors that have very special symmetry properties, we need not resort to such a gigantic unfolding as in Miller's response - there will be far fewer than $d^4$ components to collect.
Call the space of all rank-4 tensors with $(12)$,$(34)$, and $(13)(24)$ symmetries SYM. The first two symmetries reduce the number of independent components to $_dC_2$ for each pair of indices, which we organize in a square matrix of size $\frac{d(d-1)}{2}\times\frac{d(d-1)}{2}$. The $(13)(24)$ symmetry implies this matrix is symmetric, leaving us with $\frac{d(d+1)}{2}$ independent components. If we can find a matrix representation $\mathcal D: \text{SYM}\rightarrow GL(\frac{d(d+1)}{2})$ that preserves multiplication across double dot products i.e. $\mathcal D(\boldsymbol{A})=\mathcal D(\boldsymbol{B}:\boldsymbol{C})=\mathcal D(\boldsymbol{B})\cdot\mathcal D(\boldsymbol{C})$, then we'll be able to solve the inverse problem by just mapping it to a place where we know the answer.
Fortunately for us in $d=3$ Mandel form has been developed for just this. We map our tensors to matrices via
$$ \mathcal{D}(A)= \begin{bmatrix} A_{1111} & A_{1122} & A_{1133} & \sqrt{2}A_{1123} & \sqrt{2}A_{1131} & \sqrt{2}A_{1112}\\ & A_{2222} & A_{2233} & \sqrt{2}A_{2223} & \sqrt{2}A_{2231} & \sqrt{2}A_{2212}\\ & & A_{3333} & \sqrt{2}A_{3323} & \sqrt{2}A_{3331} & \sqrt{2}A_{3312}\\ & & & 2A_{2323} & 2A_{2331} & 2A_{2312}\\ & & & & 2A_{3131} & 2A_{3112}\\ & & & & & 2A_{1212}\\ \end{bmatrix}. $$
We'll need to introduce the symmetrization tensor $\mathrm{S}\in\text{SYM}$ which acts to symmetrize the indices it double contracts with, $\mathrm{S}:\hat{e}_i\otimes\hat{e}_j=\frac{1}{2}\left(\hat{e}_i\otimes\hat{e}_j+\hat{e}_j\otimes\hat{e}_i\right)$. It's Mandel form is the identity matrix, $\mathcal{D}(\mathrm{S})=\mathrm{1}_6$, and acts trivially on all $A\in$ SYM, $S:A=A=A:S$. Then we have
$$ A:A^{-1} = \mathbf{I} $$
Symmetrizing we get
$$ S:A:A^{-1} = A:A^{-1} = S. $$
We did this to ensure all objects are in SYM so that we can take the Mandel representation
$$ \mathcal{D}(A:A^{-1}) = \mathcal{D}(A)\cdot\mathcal{D}(A^{-1})=1_6\\ \Downarrow\\ \mathcal{D}(A^{-1}) = \mathcal{D}(A)^{-1} $$
Let's see how this works in practice for the isotropic elasticity tensor, $$ \mathcal D(\mathbf{E})= \begin{bmatrix} \kappa+\frac{4}{3}\mu & \kappa-\frac{2}{3}\mu & \kappa-\frac{2}{3}\mu & 0 & 0 & 0\\ \kappa-\frac{2}{3}\mu & \kappa+\frac{4}{3}\mu & \kappa-\frac{2}{3}\mu & 0 & 0 & 0\\ \kappa-\frac{2}{3}\mu & \kappa-\frac{2}{3}\mu & \kappa+\frac{4}{3}\mu & 0 & 0 & 0\\ 0 & 0 & 0 & 2\mu & 0 & 0\\ 0 & 0 & 0 & 0 & 2\mu & 0\\ 0 & 0 & 0 & 0 & 0 & 2\mu \end{bmatrix} $$ where $\kappa$ is the bulk modulus and $\mu$ the shear modulus. We take the inverse of the matrix $$ \mathcal{D}(\mathbf{E}^{-1})=\mathcal{D}(\mathbf{E})^{-1}= \begin{bmatrix} \frac{1}{9} \left(\frac{1}{\kappa }+\frac{3}{\mu }\right) & \frac{1}{9}\left(\frac{1}{ \kappa }-\frac{3}{2 \mu }\right) & \frac{1}{9}\left(\frac{1}{\kappa }-\frac{3}{2 \mu }\right) & 0 & 0 & 0 \\ \frac{1}{9}\left(\frac{1}{ \kappa }-\frac{3}{2 \mu }\right) & \frac{1}{9} \left(\frac{1}{\kappa }+\frac{3}{\mu }\right) & \frac{1}{9}\left(\frac{1}{ \kappa }-\frac{3}{2 \mu }\right) & 0 & 0 & 0 \\ \frac{1}{9}\left(\frac{1}{ \kappa }-\frac{3}{2 \mu }\right) & \frac{1}{9}\left(\frac{1}{ \kappa }-\frac{3}{2 \mu }\right) & \frac{1}{9} \left(\frac{1}{\kappa }+\frac{3}{\mu }\right) & 0 & 0 & 0 \\ 0 & 0 & 0 & \frac{1}{2 \mu } & 0 & 0 \\ 0 & 0 & 0 & 0 & \frac{1}{2 \mu } & 0 \\ 0 & 0 & 0 & 0 & 0 & \frac{1}{2 \mu } \\ \end{bmatrix} $$ from which we can read off the rank-4 tensor components.