Homogenization of quantum metamaterial