SMS: Tensor calculus