Rydberg excitation in one dimensional system and optical lattices