def analysis():
    fname = "work/analysis/save.pickle"
    with open(fname, 'rb') as rbfile:
        conditions = pickle.load(rbfile)
    # path = "/Users/enoki/Researches/Analysis/Codes/01_testRun/montecarlo/AlCu/voldep/4.0"
    # system = FCCXtal.from_pickle_ecis(os.path.join(path, 'cluster.pickle'),
    #                                arrange='random', conc=0.5, size=2)
    system = FCCXtal(size=2)
    print(conditions['maximum_state'][0])
    system.cell = conditions['maximum_state'][1]
    system.make_poscar('work/analysis/POSCAR_max')

    print(conditions['minimum_state'][0])
    system.cell = conditions['minimum_state'][1]
    # system.load_poscar('work/analysis/POSCAR_min2', 1, 0)
    # system.load_poscar('work/analysis/POSCAR_min2', 0, 1)

    # print(system.get_energy())

    # mc = MonteCarlo(system, 0)

    # mc.loop_fcc_micro_single(50000)
    # print(system.get_energy())
    system.make_poscar('work/analysis/POSCAR_min')
    return

    system.cell = conditions['current_state']
    print(system.get_energy())
    print(system.get_conc())
    system.adjast_conc_fine(0.5)
    print(system.get_energy())
    print(system.get_conc())

    system.cell[:, :, :, :] = 0
    system.cell[:, :, 0, :] = 1
    system.cell[:, :, 1, :] = 1

    print(system.get_conc())
    print(system.get_energy())

    path = "/Users/enoki/Researches/Analysis/Codes/01_testRun/montecarlo/AlCu/voldep/4.0"
    system = FCCXtal.from_pickle_ecis(os.path.join(path, 'cluster.pickle'),
                                   arrange='random', conc=0.5, size=2)
    system.cell[:, :, :, :] = 0
    system.cell[:, :, 0, :] = 1

    print(system.get_conc())
    print(system.get_energy())

    system.cell[:, :, :, :] = 0
    system.cell[0, 0, 0, :] = 1
    system.cell[1, 1, 0, :] = 1
    print(system.get_conc())
    print(system.get_energy())

    system.make_poscar('work/analysis/POSCAR_top_state')