Add state x state TPM conversion, move index2state from matlab to utils