def swap_bits(s,i,j):
	""" Swap bits i, j in integer s.

	Parameters
	-----------
	s: int
		spin configuration stored in bit representation.
	i: int
		lattice site position to be swapped with the corresponding one in j.
	j: int
		lattice site position to be swapped with the corresponding one in i.

	"""
	x = ( (s>>i)^(s>>j) ) & 1
	return s^( (x<<i)|(x<<j) )