Correlation of the magnetic field and the intra-cluster gas density in galaxy clusters