Beispiel #1
0
    def initialize_relaxation_list(self):

        self.vasp_relaxations_list = []

        eigen_structure = EigenStructure(
            reference_structure=self.reference_structure, hessian=self.hessian)

        for i, eigen_chromosome in enumerate(self.eigen_chromosomes_list):

            if (self.max_minima != None) and (i >= self.max_minima):
                break

            if (i % (len(self.eigen_chromosomes_list) / 10) == 0):
                mx = self.max_minima if self.max_minima else len(
                    self.eigen_chromosomes_list)
                print str(i) + "/" + str(mx)

            eigen_structure.set_eigen_chromosome(eigen_chromosome)

            initial_structure = eigen_structure.get_distorted_structure()

            self.vasp_relaxations_list.append(
                VaspRelaxation(
                    path=self.get_extended_path(
                        "rank_" + str(i) + "_" +
                        "_".join(str(x) for x in eigen_chromosome)),
                    initial_structure=initial_structure,
                    input_dictionary=self.vasp_relaxation_inputs_dictionary))

        print
	def get_mock_energy(self, structure):

		eigen_structure = EigenStructure(reference_structure=self.reference_structure, hessian=self.hessian, distorted_structure = structure)

		chromosome = eigen_structure.get_list_representation()


		e_1 = chromosome[0]
		e_2 = chromosome[1]
		e_3 = chromosome[2]
		e_4 = chromosome[3]
		e_5 = chromosome[4]
		e_6 = chromosome[5]

		u_1 = chromosome[6]
		u_2 = chromosome[7]

		return 0.234*e_3**2 + -0.52113*e_4**2 + 0.0*e_5**2 + 400.23*e_3*e_4 + 0.00034*e_4*e_5 + 3.2*u_1**2 + 0.001*u_1*u_2 + 0.0*u_2**2 + 7034.0234944959*u_1*u_2*e_4 + 93.0*u_2**2*e_5 + 1.8*u_1**4 + -9345.02*e_3*u_1**2 + 0.445*u_2**4
    def get_pure_eigen_chromosome_components_from_distorted_structures_list(
            self, distorted_structures_list):

        eigen_chromosome_pure_components_list = []

        for distorted_structure in distorted_structures_list:
            eigen_structure = EigenStructure(
                reference_structure=self.reference_structure,
                hessian=self.hessian,
                distorted_structure=distorted_structure)

            eigen_chromosome = eigen_structure.get_list_representation()

            if np.count_nonzero(eigen_chromosome) > 1:
                raise Exception("There should only be one non-zero component")

            eigen_chromosome_pure_components_list.append(sum(eigen_chromosome))

        return eigen_chromosome_pure_components_list
Beispiel #4
0
    def update(self):
        print "in minima relax update"

        self.completed_relaxations_data_list = []

        eigen_structure = EigenStructure(
            reference_structure=self.reference_structure, hessian=self.hessian)
        for i, vasp_relaxation in enumerate(self.vasp_relaxations_list):

            vasp_relaxation.update()

            print "Updating minima relaxation at " + vasp_relaxation.path + "  Status is " + vasp_relaxation.get_status_string(
            )

            if vasp_relaxation.complete:
                # eigen_structure = EigenStructure(reference_structure=self.reference_structure, hessian=self.hessian, distorted_structure=vasp_relaxation.final_structure)
                eigen_structure.set_strains_and_amplitudes_from_distorted_structure(
                    vasp_relaxation.final_structure)

                self.completed_relaxations_data_list.append([
                    vasp_relaxation, self.eigen_chromosomes_list[i],
                    eigen_structure.get_list_representation()
                ])
def term_acceptance_function(expansion_term):

	variables = expansion_term.get_active_variables()

	if not expansion_term.is_pure_type('strain')

	#remove all terms with in-plane strain variables in them - these are fixed to 0 for (100) epitaxy
	for variable in variables:
		if variable.type_string == 'strain' and variable.index in [0, 1, 5]:
			return False

	#assume no forces or stresses on the cell
	if expansion_term.order == 1: 
		return False

	#only expand to second order w.r.t. strain
	if expansion_term.is_pure_type('strain') and expansion_term.order > 2:
		return False

	#for perovskite structure under arbitrary homogeneous strain, displacement terms are centrosymmetric
	if expansion_term.is_centrosymmetric():
		return False

	#only go to fourth order in single variable dsiplacement terms - don't do fourth order cross terms
	if expansion_term.order == 4 and not expansion_term.has_single_variable():
		return False

	return True


taylor_expansion = TaylorExpansion(variables_list=variables, term_acceptance_function=term_acceptance_function)

print
print "Number of terms:", len(taylor_expansion)


print '\n\t\t',
print taylor_expansion
print '\n'*3




base_path = "./"


perturbation_magnitudes_dictionary = {'strain': 0.01, 'displacement': 0.2}


a = 3.79
Nx = 1
Ny = 1
Nz = 1

vasp_run_inputs_dictionary = {
	'kpoint_scheme': 'Monkhorst',
	'kpoint_subdivisions_list': [8, 8, 8],
	'encut': 900,
	'addgrid': True
}

relaxation_input_dictionary= {
    'external_relaxation_count': 3,
    'isif': [6],
    'kpoint_schemes_list': [vasp_run_inputs_dictionary['kpoint_scheme']],
    'kpoint_subdivisions_lists': [vasp_run_inputs_dictionary['kpoint_subdivisions_list']],
    'ediff': [0.00001, 1e-7, 1e-9],
    'encut': [vasp_run_inputs_dictionary['encut']],
    'submission_script_modification_keys_list': ['100'],
    'lwave': [True]
}


initial_structure=Perovskite(supercell_dimensions=[Nx, Ny, Nz], lattice=[[a*Nx, 0.0, 0.0], [0.0, a*Ny, 0.0], [0.0, 0.0, a*Nz*1.02]], species_list=['Sr', 'Ti', 'O'])


relaxation = VaspRelaxation(path=Path.join(base_path, 'relaxation'), initial_structure=initial_structure, input_dictionary=relaxation_input_dictionary)


if not relaxation.complete:
	relaxation.update()
else:
	
	relaxed_structure = relaxation.final_structure

	force_calculation_path = Path.join(base_path, 'dfpt_force_calculation')

	kpoints = Kpoints(scheme_string=vasp_run_inputs_dictionary['kpoint_scheme'], subdivisions_list=vasp_run_inputs_dictionary['kpoint_subdivisions_list'])
	incar = IncarMaker.get_dfpt_hessian_incar({'encut': vasp_run_inputs_dictionary['encut']})

	input_set = VaspInputSet(relaxed_structure, kpoints, incar, auto_change_lreal=False, auto_change_npar=False)

	dfpt_force_run = VaspRun(path=force_calculation_path, input_set=input_set)

	if not dfpt_force_run.complete:
		dfpt_force_run.update()
	else:

		hessian = Hessian(dfpt_force_run.outcar)

		eigen_structure = EigenStructure(reference_structure=relaxed_structure, hessian=hessian)
		eigen_structure.print_eigen_components()



		de_path = Path.join(base_path, 'term_coefficient_calculations')
		derivative_evaluator = DerivativeEvaluator(path=de_path, reference_structure=relaxed_structure, hessian=hessian, taylor_expansion=taylor_expansion, 
			reference_completed_vasp_relaxation_run=relaxation, vasp_run_inputs_dictionary=vasp_run_inputs_dictionary, perturbation_magnitudes_dictionary=perturbation_magnitudes_dictionary)

		derivative_evaluator.update()

		print derivative_evaluator.taylor_expansion
Beispiel #6
0
                                 lattice=[[a * Nx, 0.0,
                                           0.0], [0.0, a * Ny, 0.0],
                                          [0.0, 0.0, a * Nz]],
                                 species_list=['Sr', 'Ti', 'O'])

# print eigen_structure
# print eigen_structure.eigen_components_list[component_index]
# eigen_structure.print_eigen_components()

component_indices = range(3 * reference_structure.site_count)

stored_energy = None
increment = 0.05

for component_index in component_indices:
    eigen_structure = EigenStructure(reference_structure=reference_structure,
                                     hessian=hessian)

    component_path = Path.join(base_path,
                               "component_index_" + str(component_index))

    Path.make(component_path)

    print "Component index is " + str(
        component_index) + ", eigenvalue is " + str(
            eigen_structure.eigen_components_list[component_index].eigenvalue)

    if component_index == component_indices[0]:
        start_range = 0
    else:
        start_range = 1
	def get_distorted_structure_from_eigen_chromosome(self, eigen_chromosome):

		eigen_structure = EigenStructure(reference_structure=self.reference_structure, hessian=self.hessian)
		eigen_structure.set_eigen_chromosome(eigen_chromosome)
		return eigen_structure.get_distorted_structure()
    def get_displacement_second_derivative(self, path, structure,
                                           displacement_variable_1_index,
                                           displacement_variable_2_index):
        """
		Determines the second derivative of the energy w.r.t. the given displacement variable for structure.

		Returns None if not done yet
		"""

        displacement_factor = self.displacement_finite_differences_step_size

        central_difference_coefficients_dictionary = {}
        #central_difference_coefficients_dictionary['1'] =  {'factors':[0.0, -1.0, 8.0, -8.0, 1.0], 'perturbations_list': [[2.0], [1.0], [-1.0], [-2.0]]}

        #central_difference_coefficients_dictionary['1'] =  {'factors':[0.0, 1.0, -1.0], 'perturbations_list': [[1.0], [-1.0]]}

        central_difference_coefficients_dictionary['1'] = {
            'factors': [0.0, 1.0, -1.0],
            'perturbations_list': [[1.0]]
        }  #NOTE!! assumes centrosymmetry - only works if atoms are at ideal perov positions

        perturbed_structures_list = []

        for perturbation_magnitude in central_difference_coefficients_dictionary[
                '1']['perturbations_list']:
            eigen_structure = EigenStructure(
                reference_structure=self.reference_structure,
                hessian=self.hessian,
                distorted_structure=structure)

            eigen_structure[
                displacement_variable_1_index +
                6] = perturbation_magnitude[0] * displacement_factor

            perturbed_structures_list.append(
                eigen_structure.get_distorted_structure())

        vasp_static_run_set = VaspStaticRunSet(
            path=path,
            structures_list=perturbed_structures_list,
            vasp_run_inputs_dictionary=self.vasp_run_inputs_dictionary,
            wavecar_path=self.reference_completed_vasp_relaxation_run.
            get_wavecar_path())

        if vasp_static_run_set.complete:

            vasp_static_run_set.delete_wavecars_of_completed_runs()

            term_factors_list = central_difference_coefficients_dictionary[
                '1']['factors']

            force_sum = self.get_force_sums(
                vasp_static_run_set, displacement_variable_2_index
            )[0]  #THIS ASSUMES CENTROSYMMETRY AND ONLY ONE ELEMENT IN FORCE SUMS LIST

            force_sums_list = [
                0.0, force_sum, -1.0 * force_sum
            ]  ################assumes centrosymmetry and one element in force sumes list

            numerator = sum(
                map(lambda x, y: -x * y, term_factors_list, force_sums_list))
            #denominator = 12.0*displacement_factor
            denominator = 2.0 * displacement_factor

            return numerator / denominator

        else:
            vasp_static_run_set.update()

            return None
def run_misfit_strain(path, misfit_strain, input_dictionary,
                      initial_relaxation_input_dictionary, dfpt_incar_settings,
                      derivative_evaluation_vasp_run_inputs_dictionary,
                      minima_relaxation_input_dictionary,
                      epitaxial_relaxation_input_dictionary):

    Path.make(path)
    guessed_minima_data_path = Path.join(path, 'guessed_chromosomes')

    species_list = input_dictionary['species_list']
    reference_lattice_constant = input_dictionary['reference_lattice_constant']
    Nx = input_dictionary['supercell_dimensions_list'][0]
    Ny = input_dictionary['supercell_dimensions_list'][1]
    Nz = input_dictionary['supercell_dimensions_list'][2]
    displacement_finite_differences_step_size = input_dictionary[
        'displacement_finite_differences_step_size']
    perturbation_magnitudes_dictionary = input_dictionary[
        'perturbation_magnitudes_dictionary']

    a = reference_lattice_constant * (1.0 + misfit_strain)

    initial_structure = Perovskite(
        supercell_dimensions=[Nx, Ny, Nz],
        lattice=[[a * Nx, 0.0, 0.0], [0.0, a * Ny, 0.0],
                 [
                     0.0, 0.0, reference_lattice_constant * Nz *
                     (1.0 + 0.3 * (1.0 - (a / reference_lattice_constant)))
                 ]],
        species_list=species_list)
    relaxation = VaspRelaxation(
        path=Path.join(path, 'relaxation'),
        initial_structure=initial_structure,
        input_dictionary=initial_relaxation_input_dictionary)

    if not relaxation.complete:
        relaxation.update()
        return False

    relaxed_structure = relaxation.final_structure

    relaxed_structure_path = Path.join(path, 'output_relaxed_structure')
    relaxed_structure.to_poscar_file_path(relaxed_structure_path)

    force_calculation_path = Path.join(path, 'dfpt_force_calculation')

    kpoints = Kpoints(scheme_string=kpoint_scheme,
                      subdivisions_list=kpoint_subdivisions_list)
    incar = IncarMaker.get_dfpt_hessian_incar(dfpt_incar_settings)
    input_set = VaspInputSet(relaxed_structure,
                             kpoints,
                             incar,
                             auto_change_lreal=False,
                             auto_change_npar=False)
    input_set.incar['lepsilon'] = True

    dfpt_force_run = VaspRun(path=force_calculation_path, input_set=input_set)

    if not dfpt_force_run.complete:
        dfpt_force_run.update()
        return False

    hessian = Hessian(dfpt_force_run.outcar)

    if input_dictionary['write_hessian_data']:
        hessian.print_eigenvalues_to_file(
            Path.join(path, 'output_eigen_values'))
        hessian.print_eigen_components_to_file(
            Path.join(path, 'output_eigen_components'))
        hessian.print_mode_effective_charge_vectors_to_file(
            Path.join(path, 'output_mode_effective_charge_vectors'),
            relaxed_structure)

        eigen_structure = EigenStructure(reference_structure=relaxed_structure,
                                         hessian=hessian)

        mode_structures_path = Path.join(path, 'mode_rendered_structures')
        Path.make(mode_structures_path)

        mode_charge_file = File(
            Path.join(path, 'output_mode_effective_charge_vectors'))

        sorted_eigen_pairs = hessian.get_sorted_hessian_eigen_pairs_list()
        for i, structure in enumerate(
                eigen_structure.get_mode_distorted_structures_list(
                    amplitude=0.6)):
            if i > 30:
                break
            structure.to_poscar_file_path(
                Path.join(
                    mode_structures_path, 'u' + str(i + 1) + '_' +
                    str(round(sorted_eigen_pairs[i].eigenvalue, 2)) + '.vasp'))

            structure.lattice = Lattice([[8.0, 0.0, 0.0], [0.0, 8.0, 0.0],
                                         [0.0, 0.0, 8.0]])

            mode_charge_file[i] += '    ' + structure.get_spacegroup_string(
                symprec=0.2) + '  ' + structure.get_spacegroup_string(
                    symprec=0.1) + '  ' + structure.get_spacegroup_string(
                        symprec=0.001)

        mode_charge_file.write_to_path()
    #sys.exit()

    ################################################### random structure searcher
    if True:
        rand_path = Path.join(path, 'random_trials')
        Path.make(rand_path)

        num_guesses = 1
        num_modes = 12
        max_amplitude = 0.6

        if misfit_strain == 0.02:
            eigen_structure = EigenStructure(
                reference_structure=relaxed_structure, hessian=hessian)

            for i in range(num_guesses):
                trial_path = Path.join(rand_path, str(i))

                if not Path.exists(trial_path):
                    initial_structure_trial = eigen_structure.get_random_structure(
                        mode_count_cutoff=num_modes,
                        max_amplitude=max_amplitude)
                    trial_relaxation = VaspRelaxation(
                        path=trial_path,
                        initial_structure=initial_structure_trial,
                        input_dictionary=minima_relaxation_input_dictionary)
                else:
                    trial_relaxation = VaspRelaxation(path=trial_path)

                print "Updating random trial relaxation at " + trial_relaxation.path + "  Status is " + trial_relaxation.get_status_string(
                )
                trial_relaxation.update()

                if trial_relaxation.complete:
                    print "Trial " + str(i)
                    print trial_relaxation.get_data_dictionary()

        return None
    ###################################################

    if not Path.exists(guessed_minima_data_path):
        variable_specialty_points_dictionary = input_dictionary[
            'variable_specialty_points_dictionary_set'][
                misfit_strain] if input_dictionary.has_key(
                    misfit_strain) else {}

        derivative_evaluation_path = Path.join(
            path, 'expansion_coefficient_calculations')
        derivative_evaluator = DerivativeEvaluator(
            path=derivative_evaluation_path,
            reference_structure=relaxed_structure,
            hessian=hessian,
            reference_completed_vasp_relaxation_run=relaxation,
            vasp_run_inputs_dictionary=
            derivative_evaluation_vasp_run_inputs_dictionary,
            perturbation_magnitudes_dictionary=
            perturbation_magnitudes_dictionary,
            displacement_finite_differences_step_size=
            displacement_finite_differences_step_size,
            status_file_path=Path.join(path, 'output_derivative_plot_data'),
            variable_specialty_points_dictionary=
            variable_specialty_points_dictionary,
            max_displacement_variables=input_dictionary[
                'max_displacement_variables'])

        derivative_evaluator.update()

    else:
        minima_path = Path.join(path, 'minima_relaxations')

        minima_relaxer = MinimaRelaxer(
            path=minima_path,
            reference_structure=relaxed_structure,
            reference_completed_vasp_relaxation_run=relaxation,
            hessian=hessian,
            vasp_relaxation_inputs_dictionary=
            minima_relaxation_input_dictionary,
            eigen_chromosome_energy_pairs_file_path=guessed_minima_data_path,
            log_base_path=path,
            max_minima=input_dictionary['max_minima'])

        minima_relaxer.update()
        minima_relaxer.print_status_to_file(
            Path.join(path, 'output_minima_relaxations_status'))

        if minima_relaxer.complete:
            print "Minima relaxer complete: sorting the relaxations to find the lowest energy structure."
            #minima_relaxer.print_selected_uniques_to_file(file_path=Path.join(path, 'output_selected_unique_minima_relaxations'))
            sorted_uniques = minima_relaxer.get_sorted_unique_relaxation_data_list(
            )

            return sorted_uniques
Beispiel #10
0
    def print_status_to_file(self, file_path):
        print "in print_status_to_file"

        file = File()

        spg_symprecs = [0.1, 0.01, 0.001]

        file += "Complete: " + str(self.complete)
        file += ""

        reference_energy = self.reference_completed_vasp_relaxation_run.get_final_energy(
            per_atom=False)
        eigen_structure = EigenStructure(
            reference_structure=self.reference_structure, hessian=self.hessian)
        for i, vasp_relaxation in enumerate(self.vasp_relaxations_list):

            mx = len(self.vasp_relaxations_list)
            if (i % (mx / 10) == 0):
                mx = self.max_minima if self.max_minima else len(
                    self.eigen_chromosomes_list)
                print str(i) + "/" + str(mx)

            file += '-' * 38 + " Structure Guess " + str(i) + ' ' + '-' * 38
            file += ''

            if vasp_relaxation.complete:
                eigen_structure.set_strains_and_amplitudes_from_distorted_structure(
                    vasp_relaxation.final_structure)

                eigen_structure_list_representation = eigen_structure.get_list_representation(
                )

                self.completed_relaxations_data_list.append([
                    vasp_relaxation, self.eigen_chromosomes_list[i],
                    eigen_structure_list_representation
                ])

                file += "DFT Energy Change        " + str(
                    vasp_relaxation.get_final_energy(per_atom=False) -
                    reference_energy)
                file += "Space Group " + " ".join([
                    vasp_relaxation.final_structure.get_spacegroup_string(
                        symprec) for symprec in spg_symprecs
                ])
                file += "Guessed Energy Change  " + str(
                    self.predicted_energies_list[i])
                file += "Guessed Chromosome"
                file += misc.get_formatted_chromosome_string(
                    self.eigen_chromosomes_list[i])
                file += "Final Chromosome"

                file += misc.get_formatted_chromosome_string(
                    eigen_structure_list_representation)

            else:
                file += "Guessed Energy Change  " + str(
                    self.predicted_energies_list[i])
                file += "Guessed Chromosome"
                file += misc.get_formatted_chromosome_string(
                    self.eigen_chromosomes_list[i])
                file += "Incomplete"
            file += ''

        file.write_to_path(file_path)

        print "out of print_status_to_file\n"
Beispiel #11
0
    def __init__(self,
                 path,
                 reference_structure,
                 reference_completed_vasp_relaxation_run,
                 hessian,
                 vasp_relaxation_inputs_dictionary,
                 eigen_chromosome_energy_pairs_file_path,
                 log_base_path,
                 max_minima=None):
        """
		eigen_chromosome_energy_pairs_list should look like [[predicted energy change, guessed eigen_chromosome], [...],...]

		vasp_relaxation_inputs_dictionary should look like:

		vasp_relaxation_inputs_dictionary = 
		{
			'external_relaxation_count': 4,
			'kpoint_schemes_list': ['Gamma'],
			'kpoint_subdivisions_lists': [[1, 1, 1], [1, 1, 2], [2, 2, 4]],
			'submission_script_modification_keys_list': ['100', 'standard', 'standard_gamma'], #optional - will default to whatever queue adapter gives
			'submission_node_count_list': [1, 2],
			'ediff': [0.001, 0.00001, 0.0000001],
			'encut': [200, 400, 600, 800],
			'isif' : [5, 2, 3]
			#any other incar parameters with value as a list
		}

		max_minima controls how many minima are relaxed. If None, all are relaxed
		"""

        minima_file = File(eigen_chromosome_energy_pairs_file_path)

        eigen_chromosome_energy_pairs_list = [
        ]  #[[predicted_energy_difference_1, [e1, e2, e3, e4, ...]], [predicted_energy_difference_2, [e1, ...]]]

        for line in minima_file:
            energy_difference = float((line.strip()).split(',')[0])
            eigen_chromosome = [
                float(x) for x in (line.strip()).split(',')[1].split(' ')[1:]
            ]

            eigen_chromosome_energy_pairs_list.append(
                [energy_difference, eigen_chromosome])

        self.path = path
        self.reference_structure = reference_structure
        self.reference_completed_vasp_relaxation_run = reference_completed_vasp_relaxation_run
        self.hessian = hessian
        self.eigen_pairs_list = hessian.get_sorted_hessian_eigen_pairs_list()
        self.vasp_relaxation_inputs_dictionary = copy.deepcopy(
            vasp_relaxation_inputs_dictionary)
        self.max_minima = max_minima

        sorted_eigen_chromosome_energy_pairs_list = sorted(
            eigen_chromosome_energy_pairs_list, key=lambda x: x[0])

        guesses_log_path = Path.join(log_base_path, 'output_guesses_log')
        if not Path.exists(guesses_log_path):
            file = File()

            sorted_hessian_eigen_pairs_list = hessian.get_sorted_hessian_eigen_pairs_list(
            )
            total = len(sorted_eigen_chromosome_energy_pairs_list)
            eigen_structure = EigenStructure(
                reference_structure=self.reference_structure,
                hessian=self.hessian)

            for i, eigen_chromosome_energy_pair in enumerate(
                    sorted_eigen_chromosome_energy_pairs_list):
                print "Writing guess log " + str(i + 1) + " of " + str(total)
                eigen_structure.set_eigen_chromosome(
                    eigen_chromosome_energy_pair[1])

                initial_structure = eigen_structure.get_distorted_structure()

                spg = initial_structure.get_spacegroup_string(0.001)

                file += str(eigen_chromosome_energy_pair[0]
                            ) + '   ' + misc.get_formatted_chromosome_string(
                                eigen_chromosome_energy_pair[1]) + '  ' + spg

            file.write_to_path(guesses_log_path)

        full_guesses_list_file = File(
            guesses_log_path
        )  #lines look like   -0.550084   [ 0.000  0.000 -0.009  0.000  0.000  0.000      0.605  0.605  0.000  0.000  0.000  0.000  0.000  0.000 ]  Amm2 (38)

        unique_guesses_file = File()

        final_pairs_list = []
        energies_list = []
        seen_before_dictionary = {}
        print 'Analyzing unique pairs in minima relax'
        for line in full_guesses_list_file:
            energy = float(su.remove_extra_spaces(line.split('[')[0]))
            chromosome = [
                float(x) for x in su.remove_extra_spaces(
                    line[line.find('[') + 1:line.find(']')]).split(' ')
            ]
            spg = su.remove_extra_spaces(line.split(']')[1])

            key = str(energy) + '_' + spg

            if key in seen_before_dictionary:
                continue
            else:
                seen_before_dictionary[key] = True
                eigen_chromosome_energy_pair = [energy, chromosome]
                energies_list.append(eigen_chromosome_energy_pair[0])
                final_pairs_list.append(eigen_chromosome_energy_pair)

                unique_guesses_file += str(
                    eigen_chromosome_energy_pair[0]
                ) + '   ' + misc.get_formatted_chromosome_string(
                    eigen_chromosome_energy_pair[1]) + '  ' + spg

        unique_guesses_file.write_to_path(
            Path.join(log_base_path, 'output_unique_guesses_log'))

        # #remove redundant energies from list
        # final_pairs_list = []
        # energies_list = []
        # for eigen_chromosome_energy_pair in sorted_eigen_chromosome_energy_pairs_list:
        # 	if eigen_chromosome_energy_pair[0] in energies_list:
        # 		continue
        # 	else:
        # 		energies_list.append(eigen_chromosome_energy_pair[0])
        # 		final_pairs_list.append(eigen_chromosome_energy_pair)

        # print "Final pairs list: "
        # print final_pairs_list

        self.predicted_energies_list = [
            eigen_chromosome_energy_pair[0]
            for eigen_chromosome_energy_pair in final_pairs_list
        ]
        self.eigen_chromosomes_list = [
            eigen_chromosome_energy_pair[1]
            for eigen_chromosome_energy_pair in final_pairs_list
        ]

        self.completed_relaxations_data_list = [
        ]  #list of lists with each component like [relaxation, initial chromosome, final chromosome]

        self.vasp_relaxations_list = None

        Path.make(path)

        print "Initializing minima relaxation runs"
        self.initialize_relaxation_list()
random_chromosomes = [[
    0.0, 0.0, 0.05, 0.02, -0.01, 0.0, 0.0, 0.0, 0.0, 0.2, 0.15, -0.08, 0.2, 0.1
],
                      [
                          0.0, 0.0, -0.1, 0.2, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5,
                          0.65, -0.8, 0.1, 0.0, 0.0, 0.0, 0.6, 0.0, -0.8
                      ],
                      [
                          0.0, 0.0, 0.02, 0.02, 0.02, 0.0, 0.0, 0.0, 0.0, 0.0,
                          0.0, 0.0, 0.0, 0.02, 0.06, 0.1, 0.3, 0.5, -0.6, 0.3,
                          0.2
                      ]]

for chromosome_index, chromosome in enumerate(random_chromosomes):
    eigen_structure = EigenStructure(reference_structure=reference_structure,
                                     hessian=hessian)

    relaxation_path = Path.join(base_path,
                                "chromosome_index_" + str(chromosome_index))

    Path.make(relaxation_path)

    eigen_structure.set_eigen_chromosome(chromosome)

    print "Chromosome index is " + str(
        chromosome_index) + "\n\t initial eigenstructure is " + str(
            eigen_structure)

    distorted_structure = eigen_structure.get_distorted_structure()

    relax = VaspRelaxation(path=relaxation_path,
dfpt_force_run.update()

if not dfpt_force_run.complete:
    sys.exit()

hessian = Hessian(dfpt_force_run.outcar)

if input_dictionary['write_hessian_data']:
    hessian.print_eigenvalues_to_file(Path.join(path, 'output_eigen_values'))
    hessian.print_eigen_components_to_file(
        Path.join(path, 'output_eigen_components'))
    hessian.print_mode_effective_charge_vectors_to_file(
        Path.join(path, 'output_mode_effective_charge_vectors'),
        relaxed_structure)

    eigen_structure = EigenStructure(reference_structure=relaxed_structure,
                                     hessian=hessian)

    mode_structures_path = Path.join(path, 'mode_rendered_structures')
    Path.make(mode_structures_path)

    mode_charge_file = File(
        Path.join(path, 'output_mode_effective_charge_vectors'))

    sorted_eigen_pairs = hessian.get_sorted_hessian_eigen_pairs_list()
    for i, structure in enumerate(
            eigen_structure.get_mode_distorted_structures_list(amplitude=0.6)):
        if i > 30:
            break
        structure.to_poscar_file_path(
            Path.join(
                mode_structures_path, 'u' + str(i + 1) + '_' +