Unifying code in hamiltonians