How to get a inner product with tensors?

Please encapsulate your code in ``` for proper formatting, and reduce the size of your code by removing all lines of the code that is after the error message to make it more readable for others.
See Read before posting: How do I get my question answered? on how to post a minimal working example. There are for instance many packages that you are loading that is not required for the code to run.