lime/ToBeErased/FranckCondon/ParallelModes.py
def depthFirstSearch(threshold, Modes, values, E_electronic):
    """ Threshold is the threshold Franck-Condon after which we assign the value 0. 
        Modes is a list of modes.
        values is a list of values the modes can have (e.g. n = 0,1,2,3)

        Returns a tuple (ListOfEnergies, ListOfIntensities).
    """
    ListOfIntensities = []
    ListOfEnergies = []
    jobserver = pp.Server()
    mode0 = Modes[0]
    jobs = [0]*len(values) # will store jobs
    print "NumModes =", len(Modes)
    for n in values:
        FC = mode0.FrankCondons[n]
        if FC >= threshold:
            energy = E_electronic + mode0.excitedEnergy(n) - mode0.groundEnergy
            node = Node(0, mode0.FrankCondons[n], energy)
            jobs[n] = jobserver.submit(oneThread,
                                       (node, threshold, Modes, values, E_electronic),
                                       )
    results = [f() for f in jobs]        
    map(ListOfEnergies.append, [es for (es, ins) in results])
    map(ListOfIntensities.append, [ins for (es, ins) in results])
    return (ListOfEnergies, ListOfIntensities)
 Threshold is the threshold Franck-Condon after which we assign the value 0. 
        Modes is a list of modes.
        values is a list of values the modes can have (e.g. n = 0,1,2,3)

        Returns a tuple (ListOfEnergies, ListOfIntensities).
    
Threshold is the threshold Franck-Condon after which we assign the value 0.
Modes is a list of modes.
values is a list of values the modes can have


Threshold is the threshold Franck - Condon after which we assign the value 0 . Modes is a list of modes . values is a list of values the modes can have
def depthFirstSearch(threshold, Modes, values, E_electronic):
    ListOfIntensities = []
    ListOfEnergies = []
    jobserver = pp.Server()
    mode0 = Modes[0]
    jobs = [0]*len(values) 
    print "NumModes =", len(Modes)
    for n in values:
        FC = mode0.FrankCondons[n]
        if FC >= threshold:
            energy = E_electronic + mode0.excitedEnergy(n) - mode0.groundEnergy
            node = Node(0, mode0.FrankCondons[n], energy)
            jobs[n] = jobserver.submit(oneThread,
                                       (node, threshold, Modes, values, E_electronic),
                                       )
    results = [f() for f in jobs]        
    map(ListOfEnergies.append, [es for (es, ins) in results])
    map(ListOfIntensities.append, [ins for (es, ins) in results])
    return (ListOfEnergies, ListOfIntensities)
def depthFirstSearch ( threshold , Modes , values , E_electronic ) : ListOfIntensities = [ ] ListOfEnergies = [ ] jobserver = pp . Server ( ) mode0 = Modes [ 0 ] jobs = [ 0 ] * len ( values ) print "NumModes =" , len ( Modes ) for n in values : FC = mode0 . FrankCondons [ n ] if FC >= threshold : energy = E_electronic + mode0 . excitedEnergy ( n ) - mode0 . groundEnergy node = Node ( 0 , mode0 . FrankCondons [ n ] , energy ) jobs [ n ] = jobserver . submit ( oneThread , ( node , threshold , Modes , values , E_electronic ) , ) results = [ f ( ) for f in jobs ] map ( ListOfEnergies . append , [ es for ( es , ins ) in results ] ) map ( ListOfIntensities . append , [ ins for ( es , ins ) in results ] ) return ( ListOfEnergies , ListOfIntensities )
Threshold is the threshold Franck-Condon after which we assign the value 0.
Threshold is the threshold Franck - Condon after which we assign the value 0 .
""" Threshold is the threshold Franck-Condon after which we assign the value 0. 
        Modes is a list of modes.
        values is a list of values the modes can have (e.g. n = 0,1,2,3)

        Returns a tuple (ListOfEnergies, ListOfIntensities).
    """ # will store jobs
threshold
Modes
values
E_electronic