def percentage_same(minima_path_a,
                    minima_path_b,
                    foldnameInversePower,
                    ctol=1e-10,
                    minima_l=2000000):
    """
    Checks the percentage of minima that are same in path a and path b, and returns the fraction of minima
    that are not the same.
    """
    abs_path_a = BASE_DIRECTORY + "/" + foldnameInversePower + "/" + minima_path_a
    abs_path_b = BASE_DIRECTORY + "/" + foldnameInversePower + "/" + minima_path_b
    print(abs_path_b)
    print(abs_path_a)
    minima_database_path = (BASE_DIRECTORY + "/" + foldnameInversePower + "/" +
                            MINIMA_DATABASE_NAME)
    data_a = CheckSameMinimum.load_map(
        abs_path_a,
        max_minima_l=minima_l,
        minima_database_path=minima_database_path)
    data_b = CheckSameMinimum.load_map(
        abs_path_b,
        max_minima_l=minima_l,
        minima_database_path=minima_database_path)
    op_a_arr = data_a.order_params
    print(op_a_arr)
    op_b_arr = data_b.order_params
    print(op_b_arr)
    return (sum(op_a_arr == op_b_arr)) / len(op_b_arr)
Exemple #2
0
    # quench_type= ''

    # quench_type = "cvode_ex"
    # quench_type = 'correct_minima'

    data_fold_path = BASE_DIRECTORY + "/" + foldnameInversePower + "/" + quench_type

    z_list = os.listdir(data_fold_path + "/z_data_30_l6_2")
    print(z_list)
    minima_l = 200000
    print("loading data from")
    print(data_fold_path)
    for z in z_list:
        data = CheckSameMinimum.load_map(
            data_fold_path + "/z_data_30_l6_2/" + z,
            max_minima_l=minima_l,
            minima_database_path=minima_database_path,
        )

        print(
            np.load(data_fold_path + "/z_data_30_l6_2/" + z +
                    "/order_params200000.npy"))
        print(len(data.minimalist))
        print(data.minimalist)
        print(data.initial_coords)
        print(minima_database_path)
        initial_coords = data.initial_coords
        order_params = data.order_params
        minimalist = data.minimalist

        print(order_params)