We use analytical and numerical techniques to design a cylindrical lens with a gradient index of refraction. In our device, we design the desired index distribution by using a photonic crystal with slowly-varying lattice parameters. © 2007 Optical Society of America.