geometric/tests/test_batch_opt.py
def optimizeMols(self, schemas):
        """ Optmize all molecules as represented by the schemas.
        
            return
            ------
            list of optimized Molecule's
        """
        optimizers = self._initOptimizer(schemas)
        res = []
        
        # Optimization Loop, while not all have completed optimization
        while len(optimizers) > 0:
            nextOptObjs = []
            
            # take one step, energy and gradient must have been stored in optObj
            for optimizer in optimizers:    
                optimizer.step()

            self._batchComputeEnergyAndForces(optimizers)

            # evaluate step
            for optimizer in optimizers:    
                if optimizer.state == gt.OPT_STATE.NEEDS_EVALUATION:
                    
                    optimizer.evaluateStep() 
                    if optimizer.state in [gt.OPT_STATE.CONVERGED, gt.OPT_STATE.FAILED]:
                        logger.info("Optmization convereged!")
                        res.append(optimizer.progress)
                        continue
                nextOptObjs.append(optimizer)
            if len(nextOptObjs) == 0: break  ######## All Done
             
            # step and evaluation completed, next step for remaining conformations
            optimizers = nextOptObjs
            
        return res
 Optmize all molecules as represented by the schemas.
        
            return
            ------
            list of optimized Molecule's
        
Optmize all molecules as represented by the schemas.
return

list of optimized Molecule's
Optmize all molecules as represented by the schemas . return list of optimized Molecule ' s
def optimizeMols(self, schemas):
        optimizers = self._initOptimizer(schemas)
        res = []
        while len(optimizers) > 0:
            nextOptObjs = []
            for optimizer in optimizers:    
                optimizer.step()
            self._batchComputeEnergyAndForces(optimizers)
            for optimizer in optimizers:    
                if optimizer.state == gt.OPT_STATE.NEEDS_EVALUATION:
                    optimizer.evaluateStep() 
                    if optimizer.state in [gt.OPT_STATE.CONVERGED, gt.OPT_STATE.FAILED]:
                        logger.info("Optmization convereged!")
                        res.append(optimizer.progress)
                        continue
                nextOptObjs.append(optimizer)
            if len(nextOptObjs) == 0: break  
            optimizers = nextOptObjs
        return res
def optimizeMols ( self , schemas ) : optimizers = self . _initOptimizer ( schemas ) res = [ ] while len ( optimizers ) > 0 : nextOptObjs = [ ] for optimizer in optimizers : optimizer . step ( ) self . _batchComputeEnergyAndForces ( optimizers ) for optimizer in optimizers : if optimizer . state == gt . OPT_STATE . NEEDS_EVALUATION : optimizer . evaluateStep ( ) if optimizer . state in [ gt . OPT_STATE . CONVERGED , gt . OPT_STATE . FAILED ] : logger . info ( "Optmization convereged!" ) res . append ( optimizer . progress ) continue nextOptObjs . append ( optimizer ) if len ( nextOptObjs ) == 0 : break optimizers = nextOptObjs return res
Optmize all molecules as represented by the schemas.
Optmize all molecules as represented by the schemas .
""" Optmize all molecules as represented by the schemas.
        
            return
            ------
            list of optimized Molecule's
        """ # Optimization Loop, while not all have completed optimization # take one step, energy and gradient must have been stored in optObj # evaluate step ######## All Done # step and evaluation completed, next step for remaining conformations
self
schemas