Imported from https://github.com/craigastewart/qe_sim_interp