The Rank of Circulant Matrices