def test__get_required_tasks(qoi): _qoidb_filename_in = "pypospack.qoi.yaml" from pypospack.qoi import QoiDatabase from pypospack.qoi import QoiManager _qoi_type = qoi _qoi_structure = 'MgO_NaCl' _qoi_name = "{}.{}".format(_qoi_structure, _qoi_type) _qoi_structures = OrderedDict() _qoi_structures['ideal'] = 'MgO_NaCl' _qoidb_QoiDatabase = QoiDatabase() _qoidb_QoiDatabase.add_qoi(qoi_name=_qoi_name, qoi_type=_qoi_type, structures=_qoi_structures, target=4.5) qoimanager = QoiManager(qoi_database=_qoidb_QoiDatabase, fullauto=False) qoimanager.configure() qoimanager.determine_tasks() _task_type = 'lmps_min_all' _qoi_task_name = "{}.{}".format(_qoi_structures['ideal'], _task_type) assert isinstance(qoimanager.tasks, OrderedDict) assert _qoi_task_name in qoimanager.tasks assert qoimanager.tasks[_qoi_task_name]['task_type'] == _task_type assert qoimanager.tasks[_qoi_task_name]['task_structure'] \ == _qoi_structures['ideal']
def write_configuration_file(qoi_name,qoi_type,structures,target): qoidb = QoiDatabase() qoidb.add_qoi( qoi_name=qoi_name, qoi_type=qoi_type, structures=structures, target=target ) potential = OrderedDict() potential['potential_type'] = 'buckingham' potential['symbols'] = ['Mg','O'] potential['cutoff_global'] = 10.0 structures = OrderedDict() structures['structure_directory'] = 'test_PypospackEngine' structures['structures'] = OrderedDict() structures['structures']['MgO_NaCl'] = 'MgO_NaCl_unit.gga.relax.vasp' configuration = PyposmatConfigurationFile() configuration.qois = qoidb.qois configuration.potential = potential configuration.structures = structures configuration.write(filename='pyposmat.config.in')
import pytest from collections import OrderedDict from pypospack.pyposmat import PyposmatConfigurationFile from pypospack.qoi import QoiDatabase import MgO MgO_qoi_db = QoiDatabase() MgO_qoi_db.add_qoi(qoi_name='MgO_NaCl.fr_a', qoi_type='point_defect', structures=OrderedDict([('defect', 'MgO_NaCl_fr_a'), ('ideal', 'MgO_NaCl')]), target=10.978) print(80 * '-') print('{:^80}'.format('QUANTITIES OF INTEREST')) print(80 * '-') print(MgO_qoi_db.qois) MgO_structure_db = OrderedDict() MgO_structure_db['structure_directory'] = 'test__DefectFormationEnergy' MgO_structure_db['structures'] = OrderedDict() MgO_structure_db['structures']['MgO_NaCl'] = 'MgO_NaCl_unit.gga.relax.vasp' MgO_structure_db['structures']['MgO_NaCl_fr_a'] = 'MgO_NaCl_fr_a.vasp' print(80 * '-') print('{:^80}'.format('STRUCTURE DATABASE')) print(80 * '-') print('Structure directory:{}'.format(MgO_structure_db['structure_directory'])) print(20 * '-' + ' ' + 59 * '-') print('{:^20} {:^59}'.format('structure_name', 'structure_filename'))
#------------------------------------------------------------------------------ structure_db = OrderedDict() structure_db['structure_directory'] = 'structure_db' structure_db['structures'] = OrderedDict() structure_db['structures']['MgO_NaCl'] = 'MgO_NaCl_unit.gga.relax.vasp' structure_db['structures']['MgO_NaCl_prim'] = 'MgO_NaCl_prim.gga.relax.vasp' structure_db['structures']['MgO_NaCl_fr_a'] = 'MgO_NaCl_333_fr_a.vasp' structure_db['structures']['MgO_NaCl_fr_c'] = 'MgO_NaCl_333_fr_c.vasp' structure_db['structures']['MgO_NaCl_sch'] = 'MgO_NaCl_333_sch.vasp' structure_db['structures']['MgO_NaCl_001s'] = 'MgO_NaCl_001s.vasp' #------------------------------------------------------------------------------ # FITTING DATABASE #------------------------------------------------------------------------------ qoi_db = QoiDatabase() qoi_db.add_qoi(qoi_name='MgO_NaCl.a0', qoi_type='a11_min_all', structures=OrderedDict([('ideal', 'MgO_NaCl')]), target=4.246) qoi_db.add_qoi(qoi_name='MgO_NaCl.c11', qoi_type='c11', structures=OrderedDict([('ideal', 'MgO_NaCl')]), target=277.00) qoi_db.add_qoi(qoi_name='MgO_NaCl.c12', qoi_type='c12', structures=OrderedDict([('ideal', 'MgO_NaCl')]), target=91.67) qoi_db.add_qoi(qoi_name='MgO_NaCl.c44', qoi_type='c44', structures=OrderedDict([('ideal', 'MgO_NaCl')]), target=144.01) qoi_db.add_qoi(qoi_name='MgO_NaCl.B', qoi_type='bulk_modulus',
structure_db['structures'][ 'Al_fcc_111_unit'] = 'Al_fcc_111_unit.gga.relaxed.vasp' structure_db['structures']['Al_fcc_100_s'] = 'Al_fcc_100_surf.vasp' structure_db['structures']['Al_fcc_110_s'] = 'Al_fcc_110_surf.vasp' structure_db['structures']['Al_fcc_111_s'] = 'Al_fcc_111_surf.vasp' structure_db['structures']['Al_fcc_isf'] = 'Al_fcc_isf.vasp' structure_db['structures']['Al_fcc_esf'] = 'Al_fcc_esf.vasp' structure_db['structures']['Al_fcc_vac'] = 'Al_fcc_sc_333_vac.vasp' structure_db['structures']['Al_fcc_o_int'] = 'Al_fcc_sc_333_o_int.vasp' structure_db['structures']['Al_fcc_i_int'] = 'Al_fcc_sc_333_t_int.vasp' #------------------------------------------------------------------------------ # FITTING DATABASE #------------------------------------------------------------------------------ qoi_db = QoiDatabase() qoi_db.add_qoi(qoi_name='Al_fcc.E_coh', qoi_type='Ecoh_min_all', structures=OrderedDict([('ideal', 'Al_fcc')]), target=-3.36) qoi_db.add_qoi(qoi_name='Al_fcc.a0', qoi_type='a11_min_all', structures=OrderedDict([('ideal', 'Al_fcc')]), target=4.05) qoi_db.add_qoi(qoi_name='Al_fcc.c11', qoi_type='c11', structures=OrderedDict([('ideal', 'Al_fcc')]), target=114.) qoi_db.add_qoi(qoi_name='Al_fcc.c12', qoi_type='c12', structures=OrderedDict([('ideal', 'Al_fcc')]), target=62.) qoi_db.add_qoi(qoi_name='Al_fcc.c44', qoi_type='c44',
'Ni_fcc_111_unit'] = 'Ni_fcc_111_unit.gga.relaxed.vasp' structure_db['structures']['Ni_fcc_100_s'] = 'Ni_fcc_100_surf.vasp' structure_db['structures']['Ni_fcc_110_s'] = 'Ni_fcc_110_surf.vasp' structure_db['structures']['Ni_fcc_111_s'] = 'Ni_fcc_111_surf.vasp' structure_db['structures']['Ni_fcc_isf'] = 'Ni_fcc_isf.vasp' structure_db['structures']['Ni_fcc_esf'] = 'Ni_fcc_esf.vasp' structure_db['structures']['Ni_fcc_vac'] = 'Ni_fcc_sc_333_vac.vasp' structure_db['structures']['Ni_fcc_o_int'] = 'Ni_fcc_sc_333_o_int.vasp' structure_db['structures']['Ni_fcc_i_int'] = 'Ni_fcc_sc_333_t_int.vasp' #------------------------------------------------------------------------------ # FITTING DATABASE #------------------------------------------------------------------------------ qoi_db = QoiDatabase() qoi_db.add_qoi( qoi_name='Ni_fcc.E_coh', qoi_type='Ecoh_min_all', structures=OrderedDict([('ideal', 'Ni_fcc')]), target=-4.45 # eV/atom ) qoi_db.add_qoi( qoi_name='Ni_fcc.a0', qoi_type='a11_min_all', structures=OrderedDict([('ideal', 'Ni_fcc')]), target=3.52 # Angs ) qoi_db.add_qoi( qoi_name='Ni_fcc.c11', qoi_type='c11', structures=OrderedDict([('ideal', 'Ni_fcc')]), target=261. #GPa ) qoi_db.add_qoi(
Ni_structure_db['structures']['Ni_fcc_110'] = 'Ni_fcc_110.vasp' Ni_structure_db['structures']['Ni_bcc'] = 'Ni_bcc.vasp' Ni_structure_db['structures']['Ni_hcp'] = 'Ni_hcp.vasp' Ni_structure_db['structures']['Ni_sc'] = 'Ni_sc.vasp' Ni_structure_db['structures']['Ni_fcc_100_s'] = 'Ni_fcc_100_s.vasp' Ni_structure_db['structures']['Ni_fcc_110_s'] = 'Ni_fcc_110_s.vasp' Ni_structure_db['structures']['Ni_fcc_111_s'] = 'Ni_fcc_111_s.vasp' Ni_structure_db['structures']['Ni_fcc_usf'] = 'Ni_fcc_usf.vasp' Ni_structure_db['structures']['Ni_fcc_ssf'] = 'Ni_fcc_ssf.vasp' #------------------------------------------------------------------------------ # FITTING DATABASE #------------------------------------------------------------------------------ Ni_qoi_db = QoiDatabase() Ni_qoi_db.add_qoi(qoi_name='Ni_fcc.E_coh', qoi_type='Ecoh_min_all', structures=OrderedDict([('ideal', 'Ni_fcc')]), target=-5.7771) Ni_qoi_db.add_qoi(qoi_name='Ni_fcc.a0', qoi_type='a11_min_all', structures=OrderedDict([('ideal', 'Ni_fcc')]), target=3.508) Ni_qoi_db.add_qoi(qoi_name='Ni_fcc.c11', qoi_type='c11', structures=OrderedDict([('ideal', 'Ni_fcc')]), target=276.) Ni_qoi_db.add_qoi(qoi_name='Ni_fcc.c12', qoi_type='c12', structures=OrderedDict([('ideal', 'Ni_fcc')]), target=159.) Ni_qoi_db.add_qoi(qoi_name='Ni_fcc.c44', qoi_type='c44',
structure_db['structures'][ 'Ni_fcc_111_unit'] = 'Ni_fcc_111_unit.gga.relaxed.vasp' structure_db['structures']['Ni_fcc_100_s'] = 'Ni_fcc_100_surf.vasp' structure_db['structures']['Ni_fcc_110_s'] = 'Ni_fcc_110_surf.vasp' structure_db['structures']['Ni_fcc_111_s'] = 'Ni_fcc_111_surf.vasp' structure_db['structures']['Ni_fcc_isf'] = 'Ni_fcc_isf.vasp' structure_db['structures']['Ni_fcc_esf'] = 'Ni_fcc_esf.vasp' structure_db['structures']['Ni_fcc_vac'] = 'Ni_fcc_sc_333_vac.vasp' structure_db['structures']['Ni_fcc_o_int'] = 'Ni_fcc_sc_333_o_int.vasp' structure_db['structures']['Ni_fcc_i_int'] = 'Ni_fcc_sc_333_t_int.vasp' #------------------------------------------------------------------------------ # FITTING DATABASE #------------------------------------------------------------------------------ qoi_db = QoiDatabase() qoi_db.add_qoi(qoi_name='Ni_fcc.E_coh', qoi_type='Ecoh_min_all', structures=OrderedDict([('ideal', 'Ni_fcc')]), target=-4.45) qoi_db.add_qoi(qoi_name='Ni_fcc.a0', qoi_type='a11_min_all', structures=OrderedDict([('ideal', 'Ni_fcc')]), target=3.52) qoi_db.add_qoi(qoi_name='Ni_fcc.c11', qoi_type='c11', structures=OrderedDict([('ideal', 'Ni_fcc')]), target=261.) qoi_db.add_qoi(qoi_name='Ni_fcc.c12', qoi_type='c12', structures=OrderedDict([('ideal', 'Ni_fcc')]), target=151.) qoi_db.add_qoi(qoi_name='Ni_fcc.c44', qoi_type='c44',
# refers to the structure file which is contained in # Si_structures/Si_dia_unit.vasp #----------------------------------------------------------------------------- # DEFINE POTENTIAL FORMALISM #----------------------------------------------------------------------------- potential_formalism = OrderedDict() potential_formalism['potential_type'] = 'stillingerweber' potential_formalism['symbols'] = ['Si'] #potential_formalism['cutoff_global'] = 10.0 #----------------------------------------------------------------------------- # QOI DEFINITIONS #----------------------------------------------------------------------------- qoi_db = QoiDatabase() qoi_db.add_qoi(qoi_name='Si_dia.a0', qoi_type='a11_min_all', structures=OrderedDict([('ideal', 'Si_dia')]), target=5.431) qoi_db.add_qoi(qoi_name='Si_dia.c12', qoi_type='c12', structures=OrderedDict([('ideal', 'Si_dia')]), target=75.00) qoi_db.add_qoi(qoi_name='Si_dia.c44', qoi_type='c44', structures=OrderedDict([('ideal', 'Si_dia')]), target=56.00) qoi_db.add_qoi(qoi_name='Si_dia.B', qoi_type='bulk_modulus', structures=OrderedDict([('ideal', 'Si_dia')]), target=100.00) #<----------------- qoi performance constraints qoi_constraints = OrderedDict()
structure_db['structures'][ 'Al_fcc_111_unit'] = 'Al_fcc_111_unit.gga.relaxed.vasp' structure_db['structures']['Al_fcc_100_s'] = 'Al_fcc_100_surf.vasp' structure_db['structures']['Al_fcc_110_s'] = 'Al_fcc_110_surf.vasp' structure_db['structures']['Al_fcc_111_s'] = 'Al_fcc_111_surf.vasp' structure_db['structures']['Al_fcc_isf'] = 'Al_fcc_isf.vasp' structure_db['structures']['Al_fcc_esf'] = 'Al_fcc_esf.vasp' structure_db['structures']['Al_fcc_vac'] = 'Al_fcc_sc_333_vac.vasp' structure_db['structures']['Al_fcc_o_int'] = 'Al_fcc_sc_333_o_int.vasp' structure_db['structures']['Al_fcc_i_int'] = 'Al_fcc_sc_333_t_int.vasp' #------------------------------------------------------------------------------ # FITTING DATABASE #------------------------------------------------------------------------------ qoi_db = QoiDatabase() qoi_db.add_qoi(qoi_name='Al_fcc.E_coh', qoi_type='Ecoh_min_all', structures=OrderedDict([('ideal', 'Al_fcc')]), target=-3.36) qoi_db.add_qoi(qoi_name='Al_fcc.a0', qoi_type='a11_min_all', structures=OrderedDict([('ideal', 'Al_fcc')]), target=4.05) #qoi_db.add_qoi( # qoi_name='Al_fcc.c11', # qoi_type='c11', # structures=OrderedDict([('ideal','Al_fcc')]), # target=114.) #qoi_db.add_qoi( # qoi_name='Al_fcc.c12', # qoi_type='c12', # structures=OrderedDict([('ideal','Al_fcc')]), # target=62.)
NiAl_eam__Mishin2009 = OrderedDict() NiAl_eam__Mishin2009['potential_type'] = 'eam' NiAl_eam__Mishin2009['symbols'] = ['Ni,Al'] NiAl_eam__Mishin2009['setfl_filename'] = os.path.join('potential_db','Mishin-Ni-Al-2009.eam.alloy') NiAl_eam__Mishin2009['reference'] = 'Purja Pun and Y. Mishin (2009). Phil. Mag., 89(34-36)' Ni_fcc_isf = OrderedDict() Ni_fcc_isf['qoi_name'] = 'Ni_fcc.isf' Ni_fcc_isf['qoi_type'] = 'E_stacking_fault' Ni_fcc_isf['structures'] = OrderedDict([('defect','Ni_fcc_isf'),('ideal','Ni_fcc_111_unit')]) Ni_fcc_isf['target'] = 100. Ni_qoi_db = QoiDatabase() Ni_qoi_db.add_qoi( qoi_name=Ni_fcc_isf['qoi_name'], qoi_type=Ni_fcc_isf['qoi_type'], structures=Ni_fcc_isf['structures'], target=Ni_fcc_isf['target']) Ni_structure_db = OrderedDict() Ni_structure_db['structure_directory'] = 'structure_db' Ni_structure_db['structures'] = OrderedDict() Ni_structure_db['structures']['Ni_fcc_111_unit'] = 'Ni_fcc_111_unit.gga.relaxed.vasp' Ni_structure_db['structures']['Ni_fcc_isf'] = 'Ni_fcc_isf.vasp' Ni_structure_db['structures']['Ni_fcc_esf'] = 'Ni_fcc_esf.vasp' Ni_structure_db['structures']['Ni_fcc_usf'] = 'Ni_fcc_usf.vasp' test_data = [ (NiAl_eam__Mishin2009,Ni_qoi_db,Ni_structure_db) ]
structure_db['structures']['Si_dia'] = 'Si_dia_unit.vasp' structure_db['structures']['Si_vac'] = 'Si_dia_333_vac.vasp' # in this case 'Si_dia' is the short name which the rest of the file # refers to the structure file which is contained in # Si_structures/Si_dia_unit.vasp #----------------------------------------------------------------------------- # QOI DEFINITIONS #----------------------------------------------------------------------------- # L. Pizzagalli et al, J. J. Phys.: Condens. Matter 25 (2013) 055801 # doi:10.1088/0953-8984/25/5/055801 # reference values from Table 2 and Table 3 qoi_db = QoiDatabase() qoi_db.add_qoi( qoi_name='Si_dia.E_coh', qoi_type='Ecoh_min_all', structures=OrderedDict([('ideal','Si_dia')]), target=-4.63) qoi_db.add_qoi( qoi_name='Si_dia.a0', qoi_type='a11_min_all', structures=OrderedDict([('ideal','Si_dia')]), target=5.43) qoi_db.add_qoi( qoi_name="Si_dia.c11", qoi_type='c11', structures=OrderedDict([('ideal','Si_dia')]), target=166.) qoi_db.add_qoi( qoi_name='Si_dia.c12', qoi_type='c12',
# STRUCTURE DATABASE DEFINITION #------------------------------------------------------------------------------ structure_db = OrderedDict() structure_db['structure_directory'] = 'structure_db' structure_db['structures'] = OrderedDict() structure_db['structures']['MgO_NaCl'] = 'MgO_NaCl_unit.gga.relax.vasp' structure_db['structures']['MgO_NaCl_fr_a'] = 'MgO_NaCl_333_fr_a.vasp' structure_db['structures']['MgO_NaCl_fr_c'] = 'MgO_NaCl_333_fr_c.vasp' structure_db['structures']['MgO_NaCl_sch'] = 'MgO_NaCl_333_sch.vasp' structure_db['structures']['MgO_NaCl_001s'] = 'MgO_NaCl_001s.vasp' #------------------------------------------------------------------------------ # FITTING DATABASE #------------------------------------------------------------------------------ qoi_db = QoiDatabase() qoi_db.add_qoi(qoi_name='MgO_NaCl.p11', qoi_type='p_11_min_none', structures=OrderedDict([('ideal', 'MgO_NaCl')]), target=4.246) #------------------------------------------------------------------------------ # QOI CONSTRAINTS # QOI constraints are performed in the order they are iterated through in # in the dictionary. # # If you want to implement new constraints, they should be implemented in # pypospack.pyposmat.data.DataAnalyzer # filter_by_qoi_err: # key - the qoi_name as in the qoi_db # value - the maximum allowable absolute error # filter_by_pareto: # filters out dominated points if set to True #------------------------------------------------------------------------------ qoi_constraints = OrderedDict()
# STRUCTURE DATABASE DEFINITION #------------------------------------------------------------------------------ structure_db = OrderedDict() structure_db['structure_directory'] = 'structure_db' structure_db['structures'] = OrderedDict() structure_db['structures']['MgO_NaCl'] = 'MgO_NaCl_unit.gga.relax.vasp' structure_db['structures']['MgO_NaCl_fr_a'] = 'MgO_NaCl_333_fr_a.vasp' structure_db['structures']['MgO_NaCl_fr_c'] = 'MgO_NaCl_333_fr_c.vasp' structure_db['structures']['MgO_NaCl_sch'] = 'MgO_NaCl_333_sch.vasp' structure_db['structures']['MgO_NaCl_001s'] = 'MgO_NaCl_001s.vasp' #------------------------------------------------------------------------------ # FITTING DATABASE #------------------------------------------------------------------------------ qoi_db = QoiDatabase() qoi_db.add_qoi(qoi_name='MgO_NaCl.a0', qoi_type='a1_min_all', structures=OrderedDict([('ideal', 'MgO_NaCl')]), target=4.246) #------------------------------------------------------------------------------ # QOI CONSTRAINTS # QOI constraints are performed in the order they are iterated through in # in the dictionary. # # If you want to implement new constraints, they should be implemented in # pypospack.pyposmat.data.DataAnalyzer # filter_by_qoi_err: # key - the qoi_name as in the qoi_db # value - the maximum allowable absolute error # filter_by_pareto: # filters out dominated points if set to True #------------------------------------------------------------------------------ qoi_constraints = OrderedDict()
from pypospack.qoi import QoiDatabase from pypospack.qoi import QoiManager from pypospack.qoi import PhaseOrderCalculation potential= OrderedDict() potential['potential_type'] = 'eam' potential['symbols'] = ['Ni'] potential['setfl_filename'] = os.path.join( pypospack.utils.get_pypospack_root_directory(), 'data/potentials/Ni__eam/Mishin-Ni-Al-2009.eam.alloy' ) qoi_db = QoiDatabase() qoi_db.add_qoi( qoi_name='E_Ni_fcc_hcp', qoi_type='phase_order', structures=OrderedDict([('low','Ni_fcc'),('high','Ni_hcp')]), target=0.24 ) structure_db = OrderedDict() structure_db['structure_directory'] = os.path.join( pypospack.utils.get_pypospack_root_directory(), 'data/Ni_structure_db') structure_db['structures'] = OrderedDict() structure_db['structures']['Ni_fcc'] = 'Ni_fcc_100_unit.gga.relaxed.vasp' structure_db['structures']['Ni_hcp'] = 'Ni_hcp_ortho.vasp' task_list = OrderedDict() task_list['Ni_fcc.lmps_min_all'] = OrderedDict([ ('task_type','lmps_min_all'),('task_structure','Ni_fcc')]) task_list['Ni_hcp.lmps_min_all'] = OrderedDict([
import pytest from collections import OrderedDict from pypospack.pyposmat.data import PyposmatConfigurationFile from pypospack.qoi import QoiDatabase from pypospack.qoi import ThermalExpansion MgO_qoi_db = QoiDatabase() MgO_qoi_db.add_qoi(qoi_name='MgO_NaCl.th_exp', qoi_type='thermal_expansion_coefficient', structures=OrderedDict([('ideal', 'MgO_NaCl')]), target=0., qoi_options={ 'temperature_min': 0, 'temperature_max': 1000, 'temperature_step': 100 }) print(MgO_qoi_db.to_string()) MgO_structure_db = OrderedDict() MgO_structure_db[ 'structure_directory'] = '../../../structure_db/MgO_structure_db' MgO_structure_db['structures'] = OrderedDict() MgO_structure_db['structures']['MgO_NaCl'] = 'MgO_NaCl_unit.gga.relax.vasp' print(80 * '-') print('{:^80}'.format('STRUCTURE DATABASE')) print(80 * '-') print('Structure directory:{}'.format(MgO_structure_db['structure_directory'])) print(20 * '-' + ' ' + 59 * '-') print('{:^20} {:^59}'.format('structure_name', 'structure_filename')) print(20 * '-' + ' ' + 59 * '-')
MgO_LewisCatlow['parameters'] = OrderedDict() MgO_LewisCatlow['parameters']['chrg_Mg'] = +2.0 MgO_LewisCatlow['parameters']['chrg_O'] = -2.0 MgO_LewisCatlow['parameters']['MgMg_A'] = 0.0 MgO_LewisCatlow['parameters']['MgMg_rho'] = 0.5 MgO_LewisCatlow['parameters']['MgMg_C'] = 0.0 MgO_LewisCatlow['parameters']['MgO_A'] = 821.6 MgO_LewisCatlow['parameters']['MgO_rho'] = 0.3242 MgO_LewisCatlow['parameters']['MgO_C'] = 0.0 MgO_LewisCatlow['parameters']['OO_A'] = 2274.00 MgO_LewisCatlow['parameters']['OO_rho'] = 0.1490 MgO_LewisCatlow['parameters']['OO_C'] = 27.88 MgO_qoi_db_gga = QoiDatabase() MgO_qoi_db_gga.add_qoi(qoi_name='MgO_NaCl.a0', qoi_type='a11_min_all', structures=OrderedDict([('ideal', 'MgO_NaCl')]), target=4.246) MgO_qoi_db_gga.add_qoi(qoi_name='MgO_NaCl.c11', qoi_type='c11', structures=OrderedDict([('ideal', 'MgO_NaCl')]), target=277.00) MgO_qoi_db_gga.add_qoi(qoi_name='MgO_NaCl.c12', qoi_type='c12', structures=OrderedDict([('ideal', 'MgO_NaCl')]), target=91.67) MgO_qoi_db_gga.add_qoi(qoi_name='MgO_NaCl.c44', qoi_type='c44', structures=OrderedDict([('ideal', 'MgO_NaCl')]), target=144.01) MgO_qoi_db_gga.add_qoi(qoi_name='MgO_NaCl.B', qoi_type='bulk_modulus',
# <---------------- STRUCTURE DATABASE Si_sw_structures = OrderedDict() Si_sw_structures['structure_directory'] = 'test__PyposmatMonteCarloSampler' Si_sw_structures['structures'] = OrderedDict() Si_sw_structures['structures']['Si_dia'] = 'Si_dia_unit.vasp' #<00--------------- QOI DATABASE #Si reference database # LDA-DFT reference data, originally from: # Pizzagalli et al. Phil. Mag A (2008) A 83 1191 # Taken from table # Pizzagalli et al. J Phys. Condens. Matter (2013) 055801 Si_sw_qoi_db = QoiDatabase() # <----------------- STRUCTURAL PROPERTIES Si_sw_qoi_db.add_qoi(qoi_name='Si_dia.Ecoh', qoi_type='Ecoh_min_all', structures=OrderedDict([('ideal', 'Si_dia')]), target=-4.63) Si_sw_qoi_db.add_qoi(qoi_name='Si_dia.a0', qoi_type='a11_min_all', structures=OrderedDict([('ideal', 'Si_dia')]), target=5.43) # <----------------- ELASTIC PROPERTIES Si_sw_qoi_db.add_qoi(qoi_name='Si_dia.c11', qoi_type='c11', structures=OrderedDict([('ideal', 'Si_dia')]), target=166.0) Si_sw_qoi_db.add_qoi(qoi_name='Si_dia.c12', qoi_type='c12', structures=OrderedDict([('ideal', 'Si_dia')]), target=64.0) Si_sw_qoi_db.add_qoi(qoi_name='Si_dia.c44',
from pypospack.pyposmat import PyposmatDataFile from pypospack.pyposmat import PyposmatEngine from pypospack.pyposmat import PyposmatConfigurationFile #from pypospack.pyposmat import QoiDatabase from pypospack.qoi import QoiDatabase from pypospack.io.filesystem import OrderedDictYAMLLoader import MgO calc_elastic_properties = False calc_point_defects = True # <---------------- making a configuration file MgO_qoi_db = QoiDatabase() MgO_qoi_db.add_qoi( qoi_name='MgO_NaCl.a0', qoi_type='a11_min_all', structures=OrderedDict([('ideal','MgO_NaCl')]), target=4.246) # <----------------- ELASTIC PROPERTIES if calc_elastic_properties: MgO_qoi_db.add_qoi( qoi_name='MgO_NaCl.c11', qoi_type='c11', structures=OrderedDict([('ideal','MgO_NaCl')]), target=277.00) MgO_qoi_db.add_qoi( qoi_name='MgO_NaCl.c12', qoi_type='c12', structures=OrderedDict([('ideal','MgO_NaCl')]), target=91.67)
structure_db['structures'][ 'Ni_fcc_111_unit'] = 'Ni_fcc_111_unit.gga.relaxed.vasp' structure_db['structures']['Ni_fcc_100_s'] = 'Ni_fcc_100_surf.vasp' structure_db['structures']['Ni_fcc_110_s'] = 'Ni_fcc_110_surf.vasp' structure_db['structures']['Ni_fcc_111_s'] = 'Ni_fcc_111_surf.vasp' structure_db['structures']['Ni_fcc_isf'] = 'Ni_fcc_isf.vasp' structure_db['structures']['Ni_fcc_esf'] = 'Ni_fcc_esf.vasp' structure_db['structures']['Ni_fcc_vac'] = 'Ni_fcc_sc_333_vac.vasp' structure_db['structures']['Ni_fcc_o_int'] = 'Ni_fcc_sc_333_o_int.vasp' structure_db['structures']['Ni_fcc_i_int'] = 'Ni_fcc_sc_333_t_int.vasp' #------------------------------------------------------------------------------ # FITTING DATABASE #------------------------------------------------------------------------------ qoi_db = QoiDatabase() qoi_db.add_qoi(qoi_name='Ni_fcc.E_coh', qoi_type='Ecoh_min_all', structures=OrderedDict([('ideal', 'Ni_fcc')]), target=-5.7771) qoi_db.add_qoi(qoi_name='Ni_fcc.a0', qoi_type='a11_min_all', structures=OrderedDict([('ideal', 'Ni_fcc')]), target=3.508) qoi_db.add_qoi(qoi_name='Ni_fcc.c11', qoi_type='c11', structures=OrderedDict([('ideal', 'Ni_fcc')]), target=276.) qoi_db.add_qoi(qoi_name='Ni_fcc.c12', qoi_type='c12', structures=OrderedDict([('ideal', 'Ni_fcc')]), target=159.) qoi_db.add_qoi(qoi_name='Ni_fcc.c44', qoi_type='c44',
import MgO calc_elastic_properties = False calc_point_defects = True # <---------------- making a configuration file MgO_qoi_db = QoiDatabase() #MgO_qoi_db.add_qoi( # qoi_name='MgO_NaCl.a0', # qoi_type='a11_min_all', # structures=OrderedDict([('ideal','MgO_NaCl')]), # target=4.246) # <----------------- ELASTIC PROPERTIES if calc_elastic_properties: MgO_qoi_db.add_qoi(qoi_name='MgO_NaCl.c11', qoi_type='c11', structures=OrderedDict([('ideal', 'MgO_NaCl')]), target=277.00) MgO_qoi_db.add_qoi(qoi_name='MgO_NaCl.c12', qoi_type='c12', structures=OrderedDict([('ideal', 'MgO_NaCl')]), target=91.67) MgO_qoi_db.add_qoi(qoi_name='MgO_NaCl.c44', qoi_type='c44', structures=OrderedDict([('ideal', 'MgO_NaCl')]), target=144.01) MgO_qoi_db.add_qoi(qoi_name='MgO_NaCl.B', qoi_type='bulk_modulus', structures=OrderedDict([('ideal', 'MgO_NaCl')]), target=153.45) MgO_qoi_db.add_qoi(qoi_name='MgO_NaCl.G', qoi_type='shear_modulus',
potential_definition['potential_type'] = 'eam' potential_definition['symbols'] = ['Ni'] potential_definition['setfl_filename'] = os.path.join( 'potential_db', 'Mishin-Ni-Al-2009.eam.alloy' ) #potential_definition['setfl_filename'] = os.path.join( # 'potential_db', # 'Ni99.eam.alloy' # ) qoi_db = QoiDatabase() qoi_db.add_qoi( qoi_name='Ni_fcc.esf', qoi_type='E_stacking_fault', structures=OrderedDict([ ('defect','Ni_fcc_esf'), ('ideal','Ni_fcc_111_unit')]), target=7.80e-3) qoi_db.add_qoi( qoi_name='Ni_fcc.isf', qoi_type='E_stacking_fault', structures=OrderedDict([ ('defect','Ni_fcc_isf'), ('ideal','Ni_fcc_111_unit')]), target=1.45e-02) qoi_db.add_qoi( qoi_name='Ni_fcc.usf', qoi_type='E_stacking_fault', structures=OrderedDict([ ('defect','Ni_fcc_usf'),
structure_db['structures'] = OrderedDict() structure_db['structures']['Si_dia'] = 'Si_dia_unit.vasp' structure_db['structures']['Si_vac'] = 'Si_dia_333_vac.vasp' # in this case 'Si_dia' is the short name which the rest of the file # refers to the structure file which is contained in # Si_structures/Si_dia_unit.vasp #----------------------------------------------------------------------------- # QOI DEFINITIONS #----------------------------------------------------------------------------- # L. Pizzagalli et al, J. J. Phys.: Condens. Matter 25 (2013) 055801 # doi:10.1088/0953-8984/25/5/055801 # reference values from Table 2 and Table 3 qoi_db = QoiDatabase() qoi_db.add_qoi(qoi_name='Si_dia.a0', qoi_type='a11_min_all', structures=OrderedDict([('ideal', 'Si_dia')]), target=5.43) qoi_db.add_qoi(qoi_name="Si_dia.c11", qoi_type='c11', structures=OrderedDict([('ideal', 'Si_dia')]), target=166.) qoi_db.add_qoi(qoi_name='Si_dia.c12', qoi_type='c12', structures=OrderedDict([('ideal', 'Si_dia')]), target=64.00) qoi_db.add_qoi(qoi_name='Si_dia.c44', qoi_type='c44', structures=OrderedDict([('ideal', 'Si_dia')]), target=80.00) qoi_db.add_qoi(qoi_name='Si_dia.B', qoi_type='bulk_modulus',
structure_db['structures'][ 'Ni_fcc_111_unit'] = 'Ni_fcc_111_unit.gga.relaxed.vasp' structure_db['structures']['Ni_fcc_100_s'] = 'Ni_fcc_100_surf.vasp' structure_db['structures']['Ni_fcc_110_s'] = 'Ni_fcc_110_surf.vasp' structure_db['structures']['Ni_fcc_111_s'] = 'Ni_fcc_111_surf.vasp' structure_db['structures']['Ni_fcc_isf'] = 'Ni_fcc_isf.vasp' structure_db['structures']['Ni_fcc_esf'] = 'Ni_fcc_esf.vasp' structure_db['structures']['Ni_fcc_vac'] = 'Ni_fcc_sc_333_vac.vasp' structure_db['structures']['Ni_fcc_o_int'] = 'Ni_fcc_sc_333_o_int.vasp' structure_db['structures']['Ni_fcc_i_int'] = 'Ni_fcc_sc_333_t_int.vasp' #------------------------------------------------------------------------------ # FITTING DATABASE #------------------------------------------------------------------------------ qoi_db = QoiDatabase() qoi_db.add_qoi(qoi_name='Ni_fcc.E_coh', qoi_type='Ecoh_min_all', structures=OrderedDict([('ideal', 'Ni_fcc')]), target=-4.45) qoi_db.add_qoi(qoi_name='Ni_fcc.a0', qoi_type='a11_min_all', structures=OrderedDict([('ideal', 'Ni_fcc')]), target=3.52) #qoi_db.add_qoi( # qoi_name='Ni_fcc.c11', # qoi_type='c11', # structures=OrderedDict([('ideal','Ni_fcc')]), # target=261.) #qoi_db.add_qoi( # qoi_name='Ni_fcc.c12', # qoi_type='c12', # structures=OrderedDict([('ideal','Ni_fcc')]), # target=151.)
# STRUCTURE DATABASE DEFINITION #------------------------------------------------------------------------------ structure_db = OrderedDict() structure_db['structure_directory'] = _pyposmat_structure_directory structure_db['structures'] = OrderedDict() structure_db['structures']['MgO_NaCl'] = 'MgO_NaCl_unit.vasp' structure_db['structures']['MgO_NaCl_001s'] = 'MgO_NaCl_001s.vasp' structure_db['structures']['MgO_NaCl_fr_a'] = 'MgO_NaCl_333_fr_a.vasp' structure_db['structures']['MgO_NaCl_fr_c'] = 'MgO_NaCl_333_fr_c.vasp' structure_db['structures']['MgO_NaCl_sch'] = 'MgO_NaCl_333_sch.vasp' #------------------------------------------------------------------------------ # FITTING DATABASE #------------------------------------------------------------------------------ qoi_db = QoiDatabase() qoi_db.add_qoi(qoi_name="MgO_NaCl.a0", qoi_type="a11_min_all", structures=OrderedDict([('ideal', 'MgO_NaCl')]), target=4.246) qoi_db.add_qoi(qoi_name="MgO_NaCl.c11", qoi_type="c11", structures=OrderedDict([('ideal', 'MgO_NaCl')]), target=277.0) qoi_db.add_qoi(qoi_name="MgO_NaCl.c12", qoi_type="c12", structures=OrderedDict([('ideal', 'MgO_NaCl')]), target=91.67) qoi_db.add_qoi(qoi_name="MgO_NaCl.c44", qoi_type="c44", structures=OrderedDict([('ideal', 'MgO_NaCl')]), target=144.01) qoi_db.add_qoi(qoi_name="MgO_NaCl.fr_a", qoi_type="E_formation",
def test__write(): _yaml_filename_in = 'pypospack.qoi.yaml' _yaml_filename_out = 'pypospack.qoi.yaml.out' from pypospack.qoi import QoiDatabase qoidb = QoiDatabase() qoidb.read(filename=_yaml_filename_in) qoidb.write(filename=_yaml_filename_out) qoidb.read(filename=_yaml_filename_out) if __name__ == '__main__': qoi_db = QoiDatabase() qoi_db.add_qoi(\ name = 'MgO_NaCl.a0', qoi_type = 'a0_min_all', structures = ['MgO_NaCl'], target = 4.246) qoi_db.add_qoi(\ name = 'MgO_NaCl.c11', qoi_type = 'c11', structures = ['MgO_NaCl'], target = 277.00) qoi_db.add_qoi(\ name = 'MgO_NaCl.c12', qoi_type = 'c12', structures = ['MgO_NaCl'], target = 91.67) qoi_db.add_qoi(\ name = 'MgO_NaCl.c44', qoi_type = 'c44',