diff --git a/examples/active_learning_qe/allegro_train_input/train/input.yaml b/examples/active_learning_qe/allegro_train_input/train/input.yaml new file mode 100644 index 00000000..148b47c0 --- /dev/null +++ b/examples/active_learning_qe/allegro_train_input/train/input.yaml @@ -0,0 +1,60 @@ +root: results/spinel +run_name: run +seed: 123 +dataset_seed: 456 + +# network +num_basis: 8 +BesselBasis_trainable: true +PolynomialCutoff_p: 6 +l_max: 1 +r_max: 8.0 +parity: o3_full +num_layers: 2 +# num_features: 16 + +env_embed_multiplicity: 16 +embed_initial_edge: true +two_body_latent_mlp_latent_dimensions: [32, 64] +two_body_latent_mlp_nonlinearity: silu +latent_mlp_latent_dimensions: [64, 64] +latent_mlp_nonlinearity: silu +latent_mlp_initialization: uniform +latent_resnet: true +env_embed_mlp_latent_dimensions: [] +env_embed_mlp_nonlinearity: null +env_embed_mlp_initialization: uniform +edge_eng_mlp_latent_dimensions: [16] +edge_eng_mlp_nonlinearity: null +edge_eng_mlp_initialization: uniform + +model_builders: + - allegro.model.Allegro + - PerSpeciesRescale + - RescaleEnergyEtc + + +dataset: ase +dataset_file_name: structure.xyz +chemical_symbols: + - Mg + - Al + +# logging +wandb: false +# verbose: debug + +# training +n_train: 80% +n_val: 20% +batch_size: 5 +train_val_split: random +#shuffle: true +metrics_key: validation_loss +use_ema: true +ema_decay: 0.99 +ema_use_num_updates: true +max_epochs: 100 +learning_rate: 0.01 +# loss function +loss_coeffs: total_energy diff --git a/examples/active_learning_qe/input.toml b/examples/active_learning_qe/input-aenet.toml similarity index 97% rename from examples/active_learning_qe/input.toml rename to examples/active_learning_qe/input-aenet.toml index 507ba15b..a97450d6 100644 --- a/examples/active_learning_qe/input.toml +++ b/examples/active_learning_qe/input-aenet.toml @@ -30,10 +30,12 @@ ignore_species = [] [train] type = 'aenet' base_input_dir = './aenet_train_input' -exe_command = ['generate.x-2.0.4-ifort_serial', 'srun train.x-2.0.4-ifort_intelmpi'] ignore_species = ["O"] vac_map = [] restart = false +[train.exe_command] +generate = 'generate.x-2.0.4-ifort_serial' +train = 'srun train.x-2.0.4-ifort_intelmpi' [config] unitcell = [[8.1135997772, 0.0000000000, 0.0000000000], diff --git a/examples/active_learning_qe/input-mlip-3.toml b/examples/active_learning_qe/input-mlip-3.toml new file mode 100644 index 00000000..de760c6d --- /dev/null +++ b/examples/active_learning_qe/input-mlip-3.toml @@ -0,0 +1,123 @@ +[sampling] +nreplicas = 8 +nprocs_per_replica = 1 +kTstart = 600.0 +kTend = 2000.0 +nsteps = 6400 # Number of steps for sampling +RXtrial_frequency = 4 +sample_frequency = 16 +print_frequency = 1 +reload = false + +[sampling.solver] +type = 'mlip_3' +path= 'mlp' +base_input_dir = './baseinput' +perturb = 0.0 +run_scheme = 'subprocess' +ignore_species = ["O"] + +[mlref] +nreplicas = 8 +ndata = 5 + +[mlref.solver] +type = 'qe' +base_input_dir = './baseinput_ref' +perturb = 0.05 +ignore_species = [] + +[train] +type = 'mlip_3' +base_input_dir = './mlip-3_train_input' +ignore_species = ["O"] +vac_map = [] +restart = false +[train.exe_command] +train = 'mlp' + +[config] +unitcell = [[8.1135997772, 0.0000000000, 0.0000000000], + [0.0000000000, 8.1135997772, 0.0000000000], + [0.0000000000, 0.0000000000, 8.1135997772]] +supercell = [1,1,1] + +[[config.base_structure]] +type = "O" +coords = [ + [0.237399980, 0.237399980, 0.237399980], + [0.762599945, 0.762599945, 0.762599945], + [0.512599945, 0.012600004, 0.737399936], + [0.487399966, 0.987399936, 0.262599975], + [0.012600004, 0.737399936, 0.512599945], + [0.987399936, 0.262599975, 0.487399966], + [0.737399936, 0.512599945, 0.012600004], + [0.262599975, 0.487399966, 0.987399936], + [0.987399936, 0.487399966, 0.262599975], + [0.012600004, 0.512599945, 0.737399936], + [0.487399966, 0.262599975, 0.987399936], + [0.512599945, 0.737399936, 0.012600004], + [0.262599975, 0.987399936, 0.487399966], + [0.737399936, 0.012600004, 0.512599945], + [0.237399980, 0.737399936, 0.737399936], + [0.762599945, 0.262599975, 0.262599975], + [0.512599945, 0.512599945, 0.237399980], + [0.487399966, 0.487399966, 0.762599945], + [0.012600004, 0.237399980, 0.012600004], + [0.987399936, 0.762599945, 0.987399936], + [0.987399936, 0.987399936, 0.762599945], + [0.012600004, 0.012600004, 0.237399980], + [0.487399966, 0.762599945, 0.487399966], + [0.512599945, 0.237399980, 0.512599945], + [0.737399936, 0.237399980, 0.737399936], + [0.262599975, 0.762599945, 0.262599975], + [0.237399980, 0.512599945, 0.512599945], + [0.762599945, 0.487399966, 0.487399966], + [0.762599945, 0.987399936, 0.987399936], + [0.237399980, 0.012600004, 0.012600004], + [0.737399936, 0.737399936, 0.237399980], + [0.262599975, 0.262599975, 0.762599945], + ] + +[[config.defect_structure]] +coords = [ + [0.000000000, 0.000000000, 0.000000000], + [0.749999940, 0.249999985, 0.499999970], + [0.249999985, 0.749999940, 0.499999970], + [0.249999985, 0.499999970, 0.749999940], + [0.749999940, 0.499999970, 0.249999985], + [0.499999970, 0.749999940, 0.249999985], + [0.499999970, 0.249999985, 0.749999940], + [0.000000000, 0.499999970, 0.499999970], + [0.749999940, 0.749999940, 0.000000000], + [0.249999985, 0.249999985, 0.000000000], + [0.249999985, 0.000000000, 0.249999985], + [0.749999940, 0.000000000, 0.749999940], + [0.499999970, 0.000000000, 0.499999970], + [0.000000000, 0.749999940, 0.749999940], + [0.000000000, 0.249999985, 0.249999985], + [0.499999970, 0.499999970, 0.000000000], + [0.374999970, 0.374999970, 0.374999970], + [0.624999940, 0.624999940, 0.624999940], + [0.374999970, 0.874999940, 0.874999940], + [0.624999940, 0.124999993, 0.124999993], + [0.874999940, 0.874999940, 0.374999970], + [0.124999993, 0.124999993, 0.624999940], + [0.874999940, 0.374999970, 0.874999940], + [0.124999993, 0.624999940, 0.124999993], + ] +[[config.defect_structure.groups]] +name = 'Al' +# species = ['Al'] # default +# coords = [[[0,0,0]]] # default +num = 16 #432 #16000 +[[config.defect_structure.groups]] +name = 'Mg' +# species = ['Mg'] # default +# coords = [[[0,0,0]]] # default +num = 8 #216 #8000 + + +[observer] +reference_structure = "MgAl2O4.vasp" +ignored_species = ["Al", "O"] diff --git a/examples/active_learning_qe/input-nequip.toml b/examples/active_learning_qe/input-nequip.toml new file mode 100644 index 00000000..c5a1db73 --- /dev/null +++ b/examples/active_learning_qe/input-nequip.toml @@ -0,0 +1,121 @@ +[sampling] +nreplicas = 8 +nprocs_per_replica = 1 +kTstart = 600.0 +kTend = 2000.0 +nsteps = 6400 # Number of steps for sampling +RXtrial_frequency = 4 +sample_frequency = 16 +print_frequency = 1 +reload = false + +[sampling.solver] +type = 'nequip' +base_input_dir = './baseinput' +perturb = 0.0 +ignore_species = ["O"] + +[mlref] +nreplicas = 8 +ndata = 5 + +[mlref.solver] +type = 'qe' +base_input_dir = './baseinput_ref' +perturb = 0.05 +ignore_species = [] + +[train] +type = 'nequip' +base_input_dir = './allegro_train_input' +ignore_species = ["O"] +vac_map = [] +restart = false +[train.exe_command] +train = 'nequip-train' + +[config] +unitcell = [[8.1135997772, 0.0000000000, 0.0000000000], + [0.0000000000, 8.1135997772, 0.0000000000], + [0.0000000000, 0.0000000000, 8.1135997772]] +supercell = [1,1,1] + +[[config.base_structure]] +type = "O" +coords = [ + [0.237399980, 0.237399980, 0.237399980], + [0.762599945, 0.762599945, 0.762599945], + [0.512599945, 0.012600004, 0.737399936], + [0.487399966, 0.987399936, 0.262599975], + [0.012600004, 0.737399936, 0.512599945], + [0.987399936, 0.262599975, 0.487399966], + [0.737399936, 0.512599945, 0.012600004], + [0.262599975, 0.487399966, 0.987399936], + [0.987399936, 0.487399966, 0.262599975], + [0.012600004, 0.512599945, 0.737399936], + [0.487399966, 0.262599975, 0.987399936], + [0.512599945, 0.737399936, 0.012600004], + [0.262599975, 0.987399936, 0.487399966], + [0.737399936, 0.012600004, 0.512599945], + [0.237399980, 0.737399936, 0.737399936], + [0.762599945, 0.262599975, 0.262599975], + [0.512599945, 0.512599945, 0.237399980], + [0.487399966, 0.487399966, 0.762599945], + [0.012600004, 0.237399980, 0.012600004], + [0.987399936, 0.762599945, 0.987399936], + [0.987399936, 0.987399936, 0.762599945], + [0.012600004, 0.012600004, 0.237399980], + [0.487399966, 0.762599945, 0.487399966], + [0.512599945, 0.237399980, 0.512599945], + [0.737399936, 0.237399980, 0.737399936], + [0.262599975, 0.762599945, 0.262599975], + [0.237399980, 0.512599945, 0.512599945], + [0.762599945, 0.487399966, 0.487399966], + [0.762599945, 0.987399936, 0.987399936], + [0.237399980, 0.012600004, 0.012600004], + [0.737399936, 0.737399936, 0.237399980], + [0.262599975, 0.262599975, 0.762599945], + ] + +[[config.defect_structure]] +coords = [ + [0.000000000, 0.000000000, 0.000000000], + [0.749999940, 0.249999985, 0.499999970], + [0.249999985, 0.749999940, 0.499999970], + [0.249999985, 0.499999970, 0.749999940], + [0.749999940, 0.499999970, 0.249999985], + [0.499999970, 0.749999940, 0.249999985], + [0.499999970, 0.249999985, 0.749999940], + [0.000000000, 0.499999970, 0.499999970], + [0.749999940, 0.749999940, 0.000000000], + [0.249999985, 0.249999985, 0.000000000], + [0.249999985, 0.000000000, 0.249999985], + [0.749999940, 0.000000000, 0.749999940], + [0.499999970, 0.000000000, 0.499999970], + [0.000000000, 0.749999940, 0.749999940], + [0.000000000, 0.249999985, 0.249999985], + [0.499999970, 0.499999970, 0.000000000], + [0.374999970, 0.374999970, 0.374999970], + [0.624999940, 0.624999940, 0.624999940], + [0.374999970, 0.874999940, 0.874999940], + [0.624999940, 0.124999993, 0.124999993], + [0.874999940, 0.874999940, 0.374999970], + [0.124999993, 0.124999993, 0.624999940], + [0.874999940, 0.374999970, 0.874999940], + [0.124999993, 0.624999940, 0.124999993], + ] +[[config.defect_structure.groups]] +name = 'Al' +# species = ['Al'] # default +# coords = [[[0,0,0]]] # default +num = 16 #432 #16000 +[[config.defect_structure.groups]] +name = 'Mg' +# species = ['Mg'] # default +# coords = [[[0,0,0]]] # default +num = 8 #216 #8000 + + +[observer] +reference_structure = "MgAl2O4.vasp" +ignored_species = ["Al", "O"] diff --git a/examples/active_learning_qe/mlip-3_train_input/train/input.almtp b/examples/active_learning_qe/mlip-3_train_input/train/input.almtp new file mode 100644 index 00000000..09cf1fb8 --- /dev/null +++ b/examples/active_learning_qe/mlip-3_train_input/train/input.almtp @@ -0,0 +1,17 @@ +MTP +version = 1.1.0 +potential_name = MTP1m +species_count = 3 +potential_tag = +radial_basis_type = RBChebyshev + min_dist = 2.3 + max_dist = 5 + radial_basis_size = 8 + radial_funcs_count = 2 +alpha_moments_count = 8 +alpha_index_basic_count = 5 +alpha_index_basic = {{0, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}, {1, 0, 0, 0}} +alpha_index_times_count = 5 +alpha_index_times = {{0, 0, 1, 5}, {1, 1, 1, 6}, {2, 2, 1, 6}, {3, 3, 1, 6}, {0, 5, 1, 7}} +alpha_scalar_moments = 5 +alpha_moment_mapping = {0, 4, 5, 6, 7} \ No newline at end of file diff --git a/examples/active_learning_qe_lammps/input.toml b/examples/active_learning_qe_lammps/input.toml index a4ebb29d..b671a7f4 100644 --- a/examples/active_learning_qe_lammps/input.toml +++ b/examples/active_learning_qe_lammps/input.toml @@ -30,10 +30,12 @@ ignore_species = [] [train] type = 'aenet' base_input_dir = './aenet_train_input' -exe_command = ['generate.x-2.0.4-ifort_serial', 'srun train.x-2.0.4-ifort_intelmpi'] ignore_species = ["O"] vac_map = [] restart = false +[train.exe_command] +generate = 'generate.x-2.0.4-ifort_serial' +train = 'srun train.x-2.0.4-ifort_intelmpi' [config] unitcell = [[8.1135997772, 0.0000000000, 0.0000000000], diff --git a/examples/active_learning_vasp/input.toml b/examples/active_learning_vasp/input.toml index 81d348d3..17cc0851 100644 --- a/examples/active_learning_vasp/input.toml +++ b/examples/active_learning_vasp/input.toml @@ -31,10 +31,12 @@ ignore_species = [] [train] type = 'aenet' base_input_dir = './aenet_train_input' -exe_command = ['generate.x-2.0.4-ifort_serial', 'srun train.x-2.0.4-ifort_intelmpi'] ignore_species = ["O"] vac_map = [] restart = false +[train.exe_command] +generate = 'generate.x-2.0.4-ifort_serial' +train = 'srun train.x-2.0.4-ifort_intelmpi' [config] unitcell = [[8.1135997772, 0.0000000000, 0.0000000000],