submesh_batch_add_matrix, submesh_batch_dotp_matrix should be rewriten
These routines take two batches but assume some property of one of the batch, in particular for the spinor dimension. This implies that the order of the argument matters, which is very dangerous.