ChatGPT - Hamiltonian flow algorithm