We theoretically study specific schemes for performing a fundamental two-qubit quantum gate via controlled atomic collisions by switching microscopic potentials. In particular we calculate the fidelity of a gate operation for a configuration where a potential barrier between two atoms is instantaneously removed and restored after a certain time. Possible implementations could be based on microtraps created by magnetic and electric fields, or potentials induced by laser light.