def _backend(self): """ Function for generating the C++ backend reperesentation of this object. :returns: The C++ LatticeModel based on the parameters given to this class on construction. """ if self.__backend is None: # Setup the C++ objects we need. cpp_config = self.__configuration._backend() cpp_lattice_map = self.__configuration._latticeMap() cpp_interactions = self.__interactions._backend( self.__configuration.possibleTypes(), cpp_lattice_map.nBasis(), self.__configuration) # Construct a timer. self.__cpp_timer = Backend.SimulationTimer() # Construct the backend object. self.__backend = Backend.LatticeModel(cpp_config, self.__cpp_timer, cpp_lattice_map, cpp_interactions) # Return. return self.__backend