Identifying the gate unitary of a pulse sequence