Matrix coercion for modularity hipot