import copy


def swap(s, i, j):
    """
    Swaps the positions of the given atoms.

    s: structure_class
    i: int
        The index of the first atom.
    j: int
        The index of the second atom.

    Returns
    -------
    s: structure_class
    """

    tmpPos = copy.copy(s.structure[j].position)
    s.structure[j].position = copy.copy(s.structure[i].position)
    s.structure[i].position = copy.copy(tmpPos)
    return s