code: def as_dict(self):
          
          d = {"@module": self.__class__.__module__,
               "@class": self.__class__.__name__}
          # print("in as_dict", type(self.x), type(self.c), type(self.xc))
          if self.x is not None: d["x"] = self.x.as_dict()
          if self.c is not None: d["c"] = self.c.as_dict()
          if self.xc is not None: d["xc"] = self.xc.as_dict()
          return d
docs: Makes XcFunc obey the general json interface used in pymatgen for easier serialization.