Mechanism of ion desorption by electronic transitions: A density-functional study.