Arbitrary mode-n convolution of physical tensors with applications in optics