def single_event_2_criteria(list_of_path, list_of_energy, box_dim):
    """
	this function takes the data of single event, i.e. the configurational data
	and the energy data to check if this event satisfy the stage 1 two criteria
	return True if satisfied, False otherwise
	
	criteria 1:
	the saddle state energy should be larger than the energy of both initial and final state
	exclude the searches E(sad-init) <0 or E(sad - fin) <0
	
	criteria 2:
	If both the energy difference AND distance between the final state and initial state 
	are small, then the final state is identical to the initial state, should be eliminated
	in details, this happens if dE < 0.02 (eV) AND distance < 1
	"""

    init_config = Configuration(list_of_path[0], box_dim)
    fin_config = Configuration(list_of_path[2], box_dim)

    # criteria 1
    if list_of_energy[1] - list_of_energy[0] < 0 or list_of_energy[
            1] - list_of_energy[2] < 0:
        return False

    #criteria 2
    distance = Configuration.distance_pbc(init_config, fin_config)
    if distance < 1 and abs(list_of_energy[2] - list_of_energy[0]) < 0.02:
        return False
    else:
        return True
Exemple #2
0
def basin_config_distance_activation_energy(path_to_test_dir, event_state):
	"""
	each test is corresponding to the triggering of a single atom, which search the
	potential energy trajectory around that basin of that atom located
	
	event_state is a list of ordered states (corresponding to their appearance order), 
	each event state contains the strings of all states, init_state, sad_state, fin_state, 
	with intermediate states that can be obtained from ART output
	
	Input:
		
		event_state: a list
			a list of strs with each str being an state, e,g min1000
	
	Returns:
	
		config_distance: a list
			a list of distances from current state to the initial state
		
		eng_barrier: a list
			a list of energy barriers from current state to the initial state
	"""
	i=0
	config_distance, eng_barrier = []
	for state in event_state:
		
		if i == 0:
			init = state
			path_to_init_file = path_to_test_dir + '/' + init + ".dump"
			init_config = Configuration(path_to_init_file)
			config_distance.append(0)
			eng_barrier.append(0)
		else:
			path_to_state_file = path_to_test_dir + '/' + state + ".dump"
			
			state_config = Configuration(path_to_state_file)
			
			state_act_eng = state_energy_barrier(path_to_test_dir, init, state)
			
			state_distance = Configuration.distance_pbc(state_config, init_config)
			
			config_distance.append(state_distance)
			
			eng_barrier.append(state_act_eng)
	return (config_distance, eng_barrier)