Ghost/Create_epsmap.py
def dielscan(options,args):
    """Do a scan of the dielectric constant"""
    indi_errors={}
    results={}
    all_ghosts={}
    for method in ['coulomb','PBE']:
        all_ghosts[method]={}
        txt='Method: %s' %method
        print method,
        import sys
        sys.stdout.flush()
        for absent in ['use']: #,'dontuse']:
            options.smoothe=False
            if method=='PBE':
                options.pbe=True
            elif method=='sPBE':
                options.pbe=True
                options.smoothe=True
            else:
                options.pbe=False
            if absent=='use':
                options.use_absent=True
            else:
                options.use_absent=False
            xs=[]
            ys=[]
            best_eps=None
            best_score=10000.0
            for eps in range(5,300,5): 
                xs.append(eps/10.0)
                X=iterative_epsmap(eps/10.0,options)
                score=X.get_score()
                if score<best_score:
                    best_eps=eps
                    best_score=score
                ys.append(score)
                #
                # Store all the calculated ghosts
                #
                import copy
                all_ghosts[method][eps]=copy.deepcopy(X.current_ghosts)
    #
    # Save ghosts
    #
    import os
    use_name=os.path.split(options.pdb)[1]
    picklefile=os.path.join(topdir,'all_ghosts_%s.pickle' %use_name)
    fd=open(picklefile,'w')
    import pickle
    pickle.dump(all_ghosts,fd)
    fd.close()
    return

    #
    # -----
    #
Do a scan of the dielectric constant
Do a scan of the dielectric constant
Do a scan of the dielectric constant
def dielscan(options,args):
    indi_errors={}
    results={}
    all_ghosts={}
    for method in ['coulomb','PBE']:
        all_ghosts[method]={}
        txt='Method: %s' %method
        print method,
        import sys
        sys.stdout.flush()
        for absent in ['use']: 
            options.smoothe=False
            if method=='PBE':
                options.pbe=True
            elif method=='sPBE':
                options.pbe=True
                options.smoothe=True
            else:
                options.pbe=False
            if absent=='use':
                options.use_absent=True
            else:
                options.use_absent=False
            xs=[]
            ys=[]
            best_eps=None
            best_score=10000.0
            for eps in range(5,300,5): 
                xs.append(eps/10.0)
                X=iterative_epsmap(eps/10.0,options)
                score=X.get_score()
                if score<best_score:
                    best_eps=eps
                    best_score=score
                ys.append(score)
                 Store all the calculated ghosts
                import copy
                all_ghosts[method][eps]=copy.deepcopy(X.current_ghosts)
     Save ghosts
    import os
    use_name=os.path.split(options.pdb)[1]
    picklefile=os.path.join(topdir,'all_ghosts_%s.pickle' %use_name)
    fd=open(picklefile,'w')
    import pickle
    pickle.dump(all_ghosts,fd)
    fd.close()
    return
     -----
def dielscan ( options , args ) : indi_errors = { } results = { } all_ghosts = { } for method in [ 'coulomb' , 'PBE' ] : all_ghosts [ method ] = { } txt = 'Method: %s' % method print method , import sys sys . stdout . flush ( ) for absent in [ 'use' ] : options . smoothe = False if method == 'PBE' : options . pbe = True elif method == 'sPBE' : options . pbe = True options . smoothe = True else : options . pbe = False if absent == 'use' : options . use_absent = True else : options . use_absent = False xs = [ ] ys = [ ] best_eps = None best_score = 10000.0 for eps in range ( 5 , 300 , 5 ) : xs . append ( eps / 10.0 ) X = iterative_epsmap ( eps / 10.0 , options ) score = X . get_score ( ) if score < best_score : best_eps = eps best_score = score ys . append ( score ) import copy all_ghosts [ method ] [ eps ] = copy . deepcopy ( X . current_ghosts ) import os use_name = os . path . split ( options . pdb ) [ 1 ] picklefile = os . path . join ( topdir , 'all_ghosts_%s.pickle' % use_name ) fd = open ( picklefile , 'w' ) import pickle pickle . dump ( all_ghosts , fd ) fd . close ( ) return
Do a scan of the dielectric constant
Do a scan of the dielectric constant
"""Do a scan of the dielectric constant""" #,'dontuse']: # # Store all the calculated ghosts # # # Save ghosts # # # ----- #
options
args