Principal component analysis applied to gradient fields in band gap optimization problems for metamaterials