aiida_lsmo.workchains package

Subpackages

Submodules

aiida_lsmo.workchains.binding_site module

BindingSite workchain.

class aiida_lsmo.workchains.binding_site.BindingSiteWorkChain(*args: Any, **kwargs: Any)[source]

Bases: WorkChain

A workchain that combines SimAnnealing & Cp2kBindingEnergy

__abstractmethods__ = frozenset({})
__module__ = 'aiida_lsmo.workchains.binding_site'
_abc_impl = <_abc_data object>
classmethod define(spec)[source]

Define workflow specification.

return_results()[source]

Return exposed outputs and info.

run_cp2k_binding_energy()[source]

Pass the ouptput molecule’s geometry to Cp2kBindingEnergy.

run_sim_annealing()[source]

Run SimAnnealing

aiida_lsmo.workchains.cp2k_binding_energy module

Binding energy workchain

class aiida_lsmo.workchains.cp2k_binding_energy.Cp2kBindingEnergyWorkChain(*args: Any, **kwargs: Any)[source]

Bases: WorkChain

Submits Cp2kBase work chain for structure + molecule system, first optimizing the geometry of the molecule and later computing the BSSE corrected interaction energy. This work chain is inspired to Cp2kMultistage, and shares some logics and data from it.

__abstractmethods__ = frozenset({})
__module__ = 'aiida_lsmo.workchains.cp2k_binding_energy'
_abc_impl = <_abc_data object>
_spec = <aiida.engine.processes.workchains.workchain.WorkChainSpec object>
classmethod define(spec)[source]

Define the specification of the process, including its inputs, outputs and known exit codes.

A metadata input namespace is defined, with optional ports that are not stored in the database.

inspect_and_update_settings_geo_opt()[source]

Inspect the settings_{idx} calculation and check if it is needed to update the settings and resubmint the calculation.

results()[source]

Gather final outputs of the workchain.

run_bsse()[source]

Update parameters and run BSSE calculation. BSSE assumes that the molecule has no charge and unit multiplicity: this can be customized from builder.cp2k_base.cp2k.parameters.

run_geo_opt()[source]

Prepare inputs, submit and direct output to context.

setup()[source]

Setup initial parameters.

should_run_geo_opt()[source]

Returns True if it is the first iteration or the settings are not ok.

aiida_lsmo.workchains.cp2k_binding_energy.get_loaded_molecule(loaded_structure, input_molecule)[source]

Return only the molecule’s atoms in the unit cell as a StructureData object.

aiida_lsmo.workchains.cp2k_binding_energy.get_output_parameters(**cp2k_out_dict)[source]

Extracts important results to include in the output_parameters.

aiida_lsmo.workchains.cp2k_multistage module

Multistage work chain.

class aiida_lsmo.workchains.cp2k_multistage.Cp2kMultistageWorkChain(*args: Any, **kwargs: Any)[source]

Bases: WorkChain

Submits Cp2kBase workchains for ENERGY, GEO_OPT, CELL_OPT and MD jobs iteratively The protocol_yaml file contains a series of settings_x and stage_x: the workchains starts running the settings_0/stage_0 calculation, and, in case of a failure, changes the settings untill the SCF of stage_0 converges. Then it uses the same settings to run the next stages (i.e., stage_1, etc.).

__abstractmethods__ = frozenset({})
__module__ = 'aiida_lsmo.workchains.cp2k_multistage'
_abc_impl = <_abc_data object>
classmethod define(spec)[source]

Define the specification of the process, including its inputs, outputs and known exit codes.

A metadata input namespace is defined, with optional ports that are not stored in the database.

inspect_and_update_settings_stage0()[source]

Inspect the stage0/settings_{idx} calculation and check if it is needed to update the settings and resubmint the calculation.

inspect_and_update_stage()[source]

Update geometry, parent folder and the new &MOTION settings.

results()[source]

Gather final outputs of the workchain.

run_stage()[source]

Check for restart, prepare input, submit and direct output to context.

setup_multistage()[source]

Setup initial parameters.

should_run_stage()[source]

Return True if it exists a new stage to compute.

should_run_stage0()[source]

Returns True if it is the first iteration or the settings are not ok.

aiida_lsmo.workchains.cp2k_multistage.apply_initial_magnetization(structure, protocol, oxidation_states=None, with_ghost_atoms=None)[source]

Prepare structure with correct initial magnetization.

Returns modified structuredata (possibly with specific atomic kinds for different inital magnetizations) as well as corresponding cp2k parameters dict.

Note: AiiDA does not allow one calcfunction to call another, which forces this split between workfunction and calcfunction.

Parameters
  • structure – AiiDA StructureData

  • protocol – AiiDA Dict with appropriate cp2k parameters (kinds and multiplicity)

  • oxidation_states – Oxidation state computed with oximachine (optional)

  • with_ghost_atoms – if true, add ghost atoms for BSSE counterpoise correction (optional)

Returns

{‘structure’: StructureData, ‘cp2k_param’: Dict }

aiida_lsmo.workchains.cp2k_multistage.extract_results(resize, **kwargs)[source]

Extracts restults form the output_parameters of the single calculations (i.e., scf-converged stages) into a single Dict output. - resize (Dict) contains the unit cell resizing values - kwargs contains all the output_parameters for the stages and the extra initial change of settings, e.g.: ‘out_0’: cp2k’s output_parameters with Dict.label = ‘settings_0_stage_0_discard’ ‘out_1’: cp2k’s output_parameters with Dict.label = ‘settings_1_stage_0_valid’ ‘out_2’: cp2k’s output_parameters with Dict.label = ‘settings_1_stage_0_valid’ ‘out_3’: cp2k’s output_parameters with Dict.label = ‘settings_1_stage_0_valid’ This will be read as: output_dict = {‘nstages_valid’: 3, ‘nsettings_discarded’: 1}.

aiida_lsmo.workchains.cp2k_multistage.get_initial_magnetization(structure, protocol, with_ghost_atoms=None)[source]

Prepare structure with correct initial magnetization.

Returns modified structuredata (possibly with specific atomic kinds for different inital magnetizations) as well as corresponding cp2k parameters dict.

Parameters
  • structure – AiiDA StructureData

  • protocol – AiiDA Dict with appropriate cp2k parameters (kinds and multiplicity)

  • with_ghost_atoms – if true, add ghost atoms for BSSE counterpoise correction (optional)

Returns

{‘structure’: StructureData, ‘cp2k_param’: Dict }

aiida_lsmo.workchains.cp2k_multistage_ddec module

Cp2kMultistageDdecWorkChain workchain

class aiida_lsmo.workchains.cp2k_multistage_ddec.Cp2kMultistageDdecWorkChain(*args: Any, **kwargs: Any)[source]

Bases: WorkChain

A workchain that combines: Cp2kMultistageWorkChain + Cp2kDdecWorkChain

__abstractmethods__ = frozenset({})
__module__ = 'aiida_lsmo.workchains.cp2k_multistage_ddec'
_abc_impl = <_abc_data object>
classmethod define(spec)[source]

Define workflow specification.

return_results()[source]

Return exposed outputs and print the pk of the CifData w/DDEC

run_cp2kddec()[source]

Pass the Cp2kMultistageWorkChain outputs as inputs for Cp2kDdecWorkChain: cp2k_base (metadata), cp2k_params, structure and WFN.

run_cp2kmultistage()[source]

Run CP2K-Multistage

aiida_lsmo.workchains.cp2k_phonopy module

Cp2kPhonopyWorkChain workchain

class aiida_lsmo.workchains.cp2k_phonopy.Cp2kPhonopyWorkChain(*args: Any, **kwargs: Any)[source]

Bases: WorkChain

A workchain to compute phonon frequencies using CP2K and Phonopy

__abstractmethods__ = frozenset({})
__module__ = 'aiida_lsmo.workchains.cp2k_phonopy'
_abc_impl = <_abc_data object>
collect_cp2k_inputs()[source]

Collect Cp2k inputs from the reference CP2K calculation.

classmethod define(spec)[source]

Define workflow specification.

generate_displacements()[source]

Generate displacements using Phonopy

results()[source]

Parse forces and store them in a PhonopyYaml file.

run_cp2k_displacement()[source]

Run the other CP2K calculations for the given structure with displacement.

run_cp2k_first()[source]

Run the first CP2K calculation from scratch for the original structure.

should_run_displacement()[source]

Prepare the input for computing displacements, and check if all have been computed

aiida_lsmo.workchains.isotherm module

Isotherm workchain

class aiida_lsmo.workchains.isotherm.IsothermWorkChain(*args: Any, **kwargs: Any)[source]

Bases: WorkChain

Workchain that computes volpo and blocking spheres: if accessible volpo>0 it also runs a raspa widom calculation for the Henry coefficient.

__abstractmethods__ = frozenset({})
__module__ = 'aiida_lsmo.workchains.isotherm'
_abc_impl = <_abc_data object>
_get_widom_param()[source]

Write Raspa input parameters from scratch, for a Widom calculation

_update_param_for_gcmc()[source]

Update Raspa input parameter, from Widom to GCMC

classmethod define(spec)[source]

Define the specification of the process, including its inputs, outputs and known exit codes.

A metadata input namespace is defined, with optional ports that are not stored in the database.

init_raspa_gcmc()[source]

Choose the pressures we want to sample, report some details, and update settings for GCMC

parameters_info = {Required('ff_cutoff', description='CutOff truncation for the VdW interactions (Angstrom).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('ff_framework', description='Forcefield of the structure  (used also as a definition of ff.rad for zeopp)'): <class 'str'>, Required('ff_mixing_rule', description='Mixing rule'): Any('Lorentz-Berthelot', 'Jorgensen', msg=None), Required('ff_separate_interactions', description='if true use only ff_framework for framework-molecule interactions in the FFBuilder'): <class 'bool'>, Required('ff_shifted', description='Shift or truncate the potential at cutoff.'): <class 'bool'>, Required('ff_tail_corrections', description='Apply tail corrections.'): <class 'bool'>, Optional('pressure_list', description='Pressure list for the isotherm (bar): if given it will skip to guess it.'): <class 'list'>, Required('pressure_max', description='Upper pressure to sample (bar).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('pressure_maxstep', description='(float) Max distance between pressure points (bar).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('pressure_min', description='Lower pressure to sample (bar).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('pressure_precision', description='Precision in the sampling of the isotherm: 0.1 ok, 0.05 for high resolution.'): Any(<class 'int'>, <class 'float'>, msg=None), Required('raspa_gcmc_init_cycles', description='Number of GCMC initialization cycles.'): <class 'int'>, Required('raspa_gcmc_prod_cycles', description='Number of GCMC production cycles.'): <class 'int'>, Required('raspa_minKh', description='If Henry coefficient < raspa_minKh do not run the isotherm (mol/kg/Pa).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('raspa_verbosity', description='Print stats every: number of cycles / raspa_verbosity.'): <class 'int'>, Required('raspa_widom_cycles', description='Number of Widom cycles.'): <class 'int'>, Required('temperature', description='Temperature of the simulation.'): Any(<class 'int'>, <class 'float'>, msg=None), Optional('temperature_list', description='To be used by IsothermMultiTempWorkChain.'): <class 'list'>, Required('zeopp_block_samples', description='Number of samples for BLOCK calculation (per A^3).'): <class 'int'>, Required('zeopp_probe_scaling', description="scaling probe's diameter: molecular_rad * scaling"): Any(<class 'int'>, <class 'float'>, msg=None), Required('zeopp_volpo_samples', description='Number of samples for VOLPO calculation (per UC volume).'): <class 'int'>}
parameters_schema = <Schema({Required('ff_framework', description='Forcefield of the structure  (used also as a definition of ff.rad for zeopp)'): <class 'str'>, Required('ff_separate_interactions', description='if true use only ff_framework for framework-molecule interactions in the FFBuilder'): <class 'bool'>, Required('ff_mixing_rule', description='Mixing rule'): Any('Lorentz-Berthelot', 'Jorgensen', msg=None), Required('ff_tail_corrections', description='Apply tail corrections.'): <class 'bool'>, Required('ff_shifted', description='Shift or truncate the potential at cutoff.'): <class 'bool'>, Required('ff_cutoff', description='CutOff truncation for the VdW interactions (Angstrom).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('zeopp_probe_scaling', description="scaling probe's diameter: molecular_rad * scaling"): Any(<class 'int'>, <class 'float'>, msg=None), Required('zeopp_volpo_samples', description='Number of samples for VOLPO calculation (per UC volume).'): <class 'int'>, Required('zeopp_block_samples', description='Number of samples for BLOCK calculation (per A^3).'): <class 'int'>, Required('raspa_verbosity', description='Print stats every: number of cycles / raspa_verbosity.'): <class 'int'>, Required('raspa_widom_cycles', description='Number of Widom cycles.'): <class 'int'>, Required('raspa_gcmc_init_cycles', description='Number of GCMC initialization cycles.'): <class 'int'>, Required('raspa_gcmc_prod_cycles', description='Number of GCMC production cycles.'): <class 'int'>, Required('raspa_minKh', description='If Henry coefficient < raspa_minKh do not run the isotherm (mol/kg/Pa).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('temperature', description='Temperature of the simulation.'): Any(<class 'int'>, <class 'float'>, msg=None), Optional('temperature_list', description='To be used by IsothermMultiTempWorkChain.'): <class 'list'>, Required('pressure_min', description='Lower pressure to sample (bar).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('pressure_max', description='Upper pressure to sample (bar).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('pressure_maxstep', description='(float) Max distance between pressure points (bar).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('pressure_precision', description='Precision in the sampling of the isotherm: 0.1 ok, 0.05 for high resolution.'): Any(<class 'int'>, <class 'float'>, msg=None), Optional('pressure_list', description='Pressure list for the isotherm (bar): if given it will skip to guess it.'): <class 'list'>}, extra=PREVENT_EXTRA, required=False) object>
return_output_parameters()[source]

Merge all the parameters into output_parameters, depending on is_porous and is_kh_ehough.

run_raspa_gcmc()[source]

Run a GCMC calculation in Raspa @ T,P.

run_raspa_widom()[source]

Run a Widom calculation in Raspa.

run_zeopp()[source]

Perform Zeo++ block and VOLPO calculations.

setup()[source]

Initialize the parameters

should_run_another_gcmc()[source]

We run another raspa calculation only if the current iteration is smaller than the total number of pressures we want to compute.

should_run_gcmc()[source]

Output the widom results and decide to compute the isotherm if kH > kHmin, as defined by the user

should_run_widom()[source]

Submit widom calculation only if there is some accessible volume, also check the number of blocking spheres and estimate the saturation loading. Also, stop if called by IsothermMultiTemp for geometric results only.

aiida_lsmo.workchains.isotherm.choose_pressure_points(inp_param, geom, raspa_widom_out)[source]

If ‘pressure_list’ is not provided, model the isotherm as a single-site Langmuir and return a list of the most important pressure points to evaluate for an isotherm.

aiida_lsmo.workchains.isotherm.get_atomic_radii(isotparam)[source]

Get {ff_framework}.rad as SinglefileData form workchain/isotherm_data. If not existing use DEFAULT.rad.

aiida_lsmo.workchains.isotherm.get_ff_parameters(molecule_dict, isotparam)[source]

Get the parameters for ff_builder.

aiida_lsmo.workchains.isotherm.get_geometric_dict(zeopp_out, molecule)[source]

Return the geometric Dict from Zeopp results, including Qsat and is_porous

aiida_lsmo.workchains.isotherm.get_molecule_dict(molecule_name)[source]

Get a Dict from the isotherm_molecules.yaml

aiida_lsmo.workchains.isotherm.get_output_parameters(geom_out, inp_params, widom_out=None, pressures=None, **gcmc_out_dict)[source]

Merge results from all the steps of the work chain.

aiida_lsmo.workchains.isotherm.get_zeopp_parameters(molecule_dict, isotparam)[source]

Get the ZeoppParameters from the inputs of the workchain

aiida_lsmo.workchains.isotherm_accurate module

IsothermAccurate work chain.

class aiida_lsmo.workchains.isotherm_accurate.IsothermAccurateWorkChain(*args: Any, **kwargs: Any)[source]

Bases: WorkChain

Workchain that computes volpo and blocking spheres: if accessible volpo>0 it also runs a raspa widom calculation for the Henry coefficient.

__abstractmethods__ = frozenset({})
__module__ = 'aiida_lsmo.workchains.isotherm_accurate'
_abc_impl = <_abc_data object>
_get_last_loading_molkg()[source]

Get the GCMC loading in mol/kg from the last GCMC calculation.

_get_widom_param()[source]

Write Raspa input parameters from scratch, for a Widom calculation

_update_param_for_gcmc()[source]

Update Raspa input parameter, from Widom to GCMC

classmethod define(spec)[source]

Define the specification of the process, including its inputs, outputs and known exit codes.

A metadata input namespace is defined, with optional ports that are not stored in the database.

init_raspa_gcmc()[source]

Update settings for GCMC.

parameters_info = {Required('ff_cutoff', description='CutOff truncation for the VdW interactions (Angstrom).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('ff_framework', description='Forcefield of the structure  (used also as a definition of ff.rad for zeopp)'): <class 'str'>, Required('ff_mixing_rule', description='Mixing rule'): Any('Lorentz-Berthelot', 'Jorgensen', msg=None), Required('ff_separate_interactions', description='if true use only ff_framework for framework-molecule interactions in the FFBuilder'): <class 'bool'>, Required('ff_shifted', description='Shift or truncate the potential at cutoff.'): <class 'bool'>, Required('ff_tail_corrections', description='Apply tail corrections.'): <class 'bool'>, Required('loading_highp_sigma', description='Sigma fraction, to consider the sytem saturated.'): Any(<class 'int'>, <class 'float'>, msg=None), Required('loading_lowp_epsilon', description='Epsilon for convergence of low pressure loading.'): Any(<class 'int'>, <class 'float'>, msg=None), Required('n_dpmax', description='Number of pressure points to compute the max Delta pressure.'): <class 'int'>, Required('p_sat_coeff', description='Coefficient to push P_sat a little bit more to reach saturation'): Any(<class 'int'>, <class 'float'>, msg=None), Required('ph0_reiteration_coeff', description='Coefficient for P_H0 to iterate GCMC at lower P.'): Any(<class 'int'>, <class 'float'>, msg=None), Required('raspa_gcmc_init_cycles', description='Number of GCMC initialization cycles.'): <class 'int'>, Required('raspa_gcmc_prod_cycles', description='Number of GCMC production cycles.'): <class 'int'>, Required('raspa_minKh', description='If Henry coefficient < raspa_minKh do not run the isotherm (mol/kg/Pa).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('raspa_verbosity', description='Print stats every: number of cycles / raspa_verbosity.'): <class 'int'>, Required('raspa_widom_cycles', description='Number of Widom cycles.'): <class 'int'>, Required('temperature', description='Temperature of the simulation.'): Any(<class 'int'>, <class 'float'>, msg=None), Optional('temperature_list', description='To be used by IsothermMultiTempWorkChain.'): <class 'list'>, Required('zeopp_block_samples', description='Number of samples for BLOCK calculation (per A^3).'): <class 'int'>, Required('zeopp_probe_scaling', description="scaling probe's diameter: molecular_rad * scaling"): Any(<class 'int'>, <class 'float'>, msg=None), Required('zeopp_volpo_samples', description='Number of samples for VOLPO calculation (per UC volume).'): <class 'int'>}
parameters_schema = <Schema({Required('ff_framework', description='Forcefield of the structure  (used also as a definition of ff.rad for zeopp)'): <class 'str'>, Required('ff_separate_interactions', description='if true use only ff_framework for framework-molecule interactions in the FFBuilder'): <class 'bool'>, Required('ff_mixing_rule', description='Mixing rule'): Any('Lorentz-Berthelot', 'Jorgensen', msg=None), Required('ff_tail_corrections', description='Apply tail corrections.'): <class 'bool'>, Required('ff_shifted', description='Shift or truncate the potential at cutoff.'): <class 'bool'>, Required('ff_cutoff', description='CutOff truncation for the VdW interactions (Angstrom).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('zeopp_probe_scaling', description="scaling probe's diameter: molecular_rad * scaling"): Any(<class 'int'>, <class 'float'>, msg=None), Required('zeopp_volpo_samples', description='Number of samples for VOLPO calculation (per UC volume).'): <class 'int'>, Required('zeopp_block_samples', description='Number of samples for BLOCK calculation (per A^3).'): <class 'int'>, Required('raspa_verbosity', description='Print stats every: number of cycles / raspa_verbosity.'): <class 'int'>, Required('raspa_widom_cycles', description='Number of Widom cycles.'): <class 'int'>, Required('raspa_gcmc_init_cycles', description='Number of GCMC initialization cycles.'): <class 'int'>, Required('raspa_gcmc_prod_cycles', description='Number of GCMC production cycles.'): <class 'int'>, Required('raspa_minKh', description='If Henry coefficient < raspa_minKh do not run the isotherm (mol/kg/Pa).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('temperature', description='Temperature of the simulation.'): Any(<class 'int'>, <class 'float'>, msg=None), Optional('temperature_list', description='To be used by IsothermMultiTempWorkChain.'): <class 'list'>, Required('loading_lowp_epsilon', description='Epsilon for convergence of low pressure loading.'): Any(<class 'int'>, <class 'float'>, msg=None), Required('loading_highp_sigma', description='Sigma fraction, to consider the sytem saturated.'): Any(<class 'int'>, <class 'float'>, msg=None), Required('n_dpmax', description='Number of pressure points to compute the max Delta pressure.'): <class 'int'>, Required('ph0_reiteration_coeff', description='Coefficient for P_H0 to iterate GCMC at lower P.'): Any(<class 'int'>, <class 'float'>, msg=None), Required('p_sat_coeff', description='Coefficient to push P_sat a little bit more to reach saturation'): Any(<class 'int'>, <class 'float'>, msg=None)}, extra=PREVENT_EXTRA, required=False) object>
return_output_parameters()[source]

Merge all the parameters into output_parameters, depending on is_porous and is_kh_ehough.

run_raspa_gcmc()[source]

Run a GCMC calculation in Raspa @ T,P.

run_raspa_widom()[source]

Step 3.0: Run the “henry” function to obtain KH and PH.

run_zeopp()[source]

Step 1: run zeo++ to calculate the density, void fraction and POAV and check if blocking spheres are needed or not.

setup()[source]

Initialize the parameters

should_run_another_gcmc_highp()[source]

Step 4: determine the pressure at which the saturation starts, Psat Step 5: After calculating PH and Psat, pressure values in between are generated based on the following sampling scheme: more pressure points are needed when the isotherm is steep compared to when the isotherm is closer to saturation. The maximum pressure step is determined so that in the smoothest case 20 points are generated.

should_run_another_gcmc_lowp()[source]

Step 3.1: I calculate the initial guess PH0 Step 3.2: To check if P_H0 belongs to the Henry’s regime, the error between the obtained uptake and Henry’s uptake should be smaller than a precision value, epsilon. If the error is higher than epsilon, P_HO is multiplied by a factor of 0.8 and the second step is repeated until the error converges to a value smaller than epsilon.

should_run_gcmc()[source]

Output the widom results and decide to compute the isotherm if kH > kHmin, as defined by the user.

should_run_widom()[source]

Submit widom calculation only if there is some accessible volume, also check the number of blocking spheres and estimate the saturation loading. Also, stop if called by IsothermMultiTemp for geometric results only.

Step 2: Calculate the theoretical q_sat based on the liquid density of the molecule (in the function get_geometric dict).

aiida_lsmo.workchains.isotherm_accurate.get_atomic_radii(isotparam)[source]

Get {ff_framework}.rad as SinglefileData form workchain/isotherm_data. If not existing use DEFAULT.rad.

aiida_lsmo.workchains.isotherm_accurate.get_ff_parameters(molecule_dict, isotparam)[source]

Get the parameters for ff_builder.

aiida_lsmo.workchains.isotherm_accurate.get_geometric_dict(zeopp_out, molecule)[source]

Return the geometric Dict from Zeopp results, including Qsat and is_porous

aiida_lsmo.workchains.isotherm_accurate.get_molecule_dict(molecule_name)[source]

Get a Dict from the isotherm_molecules.yaml

aiida_lsmo.workchains.isotherm_accurate.get_output_parameters(geom_out, inp_params, widom_out=None, **gcmc_out_dict)[source]

Merge results from all the steps of the work chain.

aiida_lsmo.workchains.isotherm_accurate.get_zeopp_parameters(molecule_dict, isotparam)[source]

Get the ZeoppParameters from the inputs of the workchain

aiida_lsmo.workchains.isotherm_calc_pe module

IsothermCalcPE work chain.

class aiida_lsmo.workchains.isotherm_calc_pe.IsothermCalcPEWorkChain(*args: Any, **kwargs: Any)[source]

Bases: WorkChain

Compute CO2 parassitic energy (PE) after running IsothermWorkChain for CO2 and N2 at 300K.

__abstractmethods__ = frozenset({})
__module__ = 'aiida_lsmo.workchains.isotherm_calc_pe'
_abc_impl = <_abc_data object>
classmethod define(spec)[source]

Define the specification of the process, including its inputs, outputs and known exit codes.

A metadata input namespace is defined, with optional ports that are not stored in the database.

parameters_info = {Required('ff_cutoff', description='CutOff truncation for the VdW interactions (Angstrom).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('ff_framework', description='Forcefield of the structure  (used also as a definition of ff.rad for zeopp)'): <class 'str'>, Required('ff_mixing_rule', description='Mixing rule'): Any('Lorentz-Berthelot', 'Jorgensen', msg=None), Required('ff_separate_interactions', description='if true use only ff_framework for framework-molecule interactions in the FFBuilder'): <class 'bool'>, Required('ff_shifted', description='Shift or truncate the potential at cutoff.'): <class 'bool'>, Required('ff_tail_corrections', description='Apply tail corrections.'): <class 'bool'>, Required('pressure_max', description='Upper pressure to sample (bar).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('pressure_maxstep', description='(float) Max distance between pressure points (bar).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('pressure_min', description='Lower pressure to sample (bar).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('pressure_precision', description='Precision in the sampling of the isotherm: 0.1 ok, 0.05 for high resolution.'): Any(<class 'int'>, <class 'float'>, msg=None), Required('raspa_gcmc_init_cycles', description='Number of GCMC initialization cycles.'): <class 'int'>, Required('raspa_gcmc_prod_cycles', description='Number of GCMC production cycles.'): <class 'int'>, Required('raspa_minKh', description='If Henry coefficient < raspa_minKh do not run the isotherm (mol/kg/Pa).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('raspa_verbosity', description='Print stats every: number of cycles / raspa_verbosity.'): <class 'int'>, Required('raspa_widom_cycles', description='Number of Widom cycles.'): <class 'int'>, Required('temperature', description='Temperature of the simulation.'): Any(<class 'int'>, <class 'float'>, msg=None), Required('zeopp_block_samples', description='Number of samples for BLOCK calculation (per A^3).'): <class 'int'>, Required('zeopp_probe_scaling', description="scaling probe's diameter: molecular_rad * scaling"): Any(<class 'int'>, <class 'float'>, msg=None), 'zeopp_volpo_samples': <class 'int'>}
parameters_schema = <Schema({Required('ff_framework', description='Forcefield of the structure  (used also as a definition of ff.rad for zeopp)'): <class 'str'>, Required('ff_separate_interactions', description='if true use only ff_framework for framework-molecule interactions in the FFBuilder'): <class 'bool'>, Required('ff_mixing_rule', description='Mixing rule'): Any('Lorentz-Berthelot', 'Jorgensen', msg=None), Required('ff_tail_corrections', description='Apply tail corrections.'): <class 'bool'>, Required('ff_shifted', description='Shift or truncate the potential at cutoff.'): <class 'bool'>, Required('ff_cutoff', description='CutOff truncation for the VdW interactions (Angstrom).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('zeopp_probe_scaling', description="scaling probe's diameter: molecular_rad * scaling"): Any(<class 'int'>, <class 'float'>, msg=None), 'zeopp_volpo_samples': <class 'int'>, Required('zeopp_block_samples', description='Number of samples for BLOCK calculation (per A^3).'): <class 'int'>, Required('raspa_verbosity', description='Print stats every: number of cycles / raspa_verbosity.'): <class 'int'>, Required('raspa_widom_cycles', description='Number of Widom cycles.'): <class 'int'>, Required('raspa_gcmc_init_cycles', description='Number of GCMC initialization cycles.'): <class 'int'>, Required('raspa_gcmc_prod_cycles', description='Number of GCMC production cycles.'): <class 'int'>, Required('raspa_minKh', description='If Henry coefficient < raspa_minKh do not run the isotherm (mol/kg/Pa).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('temperature', description='Temperature of the simulation.'): Any(<class 'int'>, <class 'float'>, msg=None), Required('pressure_min', description='Lower pressure to sample (bar).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('pressure_max', description='Upper pressure to sample (bar).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('pressure_maxstep', description='(float) Max distance between pressure points (bar).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('pressure_precision', description='Precision in the sampling of the isotherm: 0.1 ok, 0.05 for high resolution.'): Any(<class 'int'>, <class 'float'>, msg=None)}, extra=PREVENT_EXTRA, required=False) object>
run_calcpe()[source]

Expose isotherm outputs, prepare calc_pe, run it and return the output.

run_isotherms()[source]

Run Isotherm work chain for CO2 and N2.

aiida_lsmo.workchains.isotherm_inflection module

A work chain.

class aiida_lsmo.workchains.isotherm_inflection.IsothermInflectionWorkChain(*args: Any, **kwargs: Any)[source]

Bases: WorkChain

A work chain to compute single component isotherms at adsorption and desorption: GCMC calculations are run in parallell at all pressures, starting from the empty framework and the saturated system. This workchain is useful to spot adsorption hysteresis.

__abstractmethods__ = frozenset({})
__module__ = 'aiida_lsmo.workchains.isotherm_inflection'
_abc_impl = <_abc_data object>
_get_mid_dens_molecules(raspa_calc_dil, raspa_calc_sat)[source]

Given a calculation at diluted and saturation condition, compute the total molecules at mid density.

_get_saturation_molecules()[source]

Compute the estimate of molecules at saturation by: pore_vol * lid_dens * number_uc.

_get_widom_param()[source]

Write Raspa input parameters from scratch, for a Widom calculation

_update_param_for_gcmc(number_of_molecules=0, swap_prob=0.5)[source]

Update Raspa input parameter, from Widom to GCMC

classmethod define(spec)[source]

Define the specification of the process, including its inputs, outputs and known exit codes.

A metadata input namespace is defined, with optional ports that are not stored in the database.

parameters_info = {Required('box_length', description='length of simulation box for simulation without framework'): Any(<class 'int'>, <class 'float'>, msg=None), Required('ff_cutoff', description='CutOff truncation for the VdW interactions (Angstrom).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('ff_framework', description='Forcefield of the structure  (used also as a definition of ff.rad for zeopp)'): <class 'str'>, Required('ff_mixing_rule', description='Mixing rule'): Any('Lorentz-Berthelot', 'Jorgensen', msg=None), Required('ff_separate_interactions', description='if true use only ff_framework for framework-molecule interactions in the FFBuilder'): <class 'bool'>, Required('ff_shifted', description='Shift or truncate the potential at cutoff.'): <class 'bool'>, Required('ff_tail_corrections', description='Apply tail corrections.'): <class 'bool'>, Optional('pressure_list', description='Pressure list for the isotherm (bar): if given it will skip to guess it.'): <class 'list'>, Required('pressure_max', description='Upper pressure to sample (bar).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('pressure_min', description='Lower pressure to sample (bar).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('pressure_num', description='Number of pressure points considered, eqispaced in a log plot'): <class 'int'>, Required('raspa_gcmc_init_cycles', description='Number of GCMC initialization cycles.'): <class 'int'>, Required('raspa_gcmc_prod_cycles', description='Number of GCMC production cycles.'): <class 'int'>, Required('raspa_verbosity', description='Print stats every: number of cycles / raspa_verbosity.'): <class 'int'>, Required('raspa_widom_cycles', description='Number of Widom cycles.'): <class 'int'>, Required('temperature', description='Temperature of the simulation.'): Any(<class 'int'>, <class 'float'>, msg=None), Required('zeopp_block_samples', description='Number of samples for BLOCK calculation (per A^3).'): <class 'int'>, Required('zeopp_probe_scaling', description="scaling probe's diameter: molecular_rad * scaling"): Any(<class 'int'>, <class 'float'>, msg=None), Required('zeopp_volpo_samples', description='Number of samples for VOLPO calculation (per UC volume).'): <class 'int'>}
parameters_schema = <Schema({Required('ff_framework', description='Forcefield of the structure  (used also as a definition of ff.rad for zeopp)'): <class 'str'>, Required('ff_separate_interactions', description='if true use only ff_framework for framework-molecule interactions in the FFBuilder'): <class 'bool'>, Required('ff_mixing_rule', description='Mixing rule'): Any('Lorentz-Berthelot', 'Jorgensen', msg=None), Required('ff_tail_corrections', description='Apply tail corrections.'): <class 'bool'>, Required('ff_shifted', description='Shift or truncate the potential at cutoff.'): <class 'bool'>, Required('ff_cutoff', description='CutOff truncation for the VdW interactions (Angstrom).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('zeopp_probe_scaling', description="scaling probe's diameter: molecular_rad * scaling"): Any(<class 'int'>, <class 'float'>, msg=None), Required('zeopp_volpo_samples', description='Number of samples for VOLPO calculation (per UC volume).'): <class 'int'>, Required('zeopp_block_samples', description='Number of samples for BLOCK calculation (per A^3).'): <class 'int'>, Required('raspa_verbosity', description='Print stats every: number of cycles / raspa_verbosity.'): <class 'int'>, Required('raspa_widom_cycles', description='Number of Widom cycles.'): <class 'int'>, Required('raspa_gcmc_init_cycles', description='Number of GCMC initialization cycles.'): <class 'int'>, Required('raspa_gcmc_prod_cycles', description='Number of GCMC production cycles.'): <class 'int'>, Required('temperature', description='Temperature of the simulation.'): Any(<class 'int'>, <class 'float'>, msg=None), Required('pressure_min', description='Lower pressure to sample (bar).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('pressure_max', description='Upper pressure to sample (bar).'): Any(<class 'int'>, <class 'float'>, msg=None), Optional('pressure_list', description='Pressure list for the isotherm (bar): if given it will skip to guess it.'): <class 'list'>, Required('pressure_num', description='Number of pressure points considered, eqispaced in a log plot'): <class 'int'>, Required('box_length', description='length of simulation box for simulation without framework'): Any(<class 'int'>, <class 'float'>, msg=None)}, extra=PREVENT_EXTRA, required=False) object>
return_output_parameters()[source]

Merge all the parameters into output_parameters, depending on is_porous and is_kh_ehough.

run_raspa_gcmc_from_dil_sat()[source]

For each pressure point, run GCMC calculation from both diluted and saturated initial conditions.

run_raspa_widom_and_sat()[source]

Run a Widom calculation in Raspa.

run_zeopp()[source]

Perform Zeo++ block and VOLPO calculations.

setup()[source]

Initialize the parameters

should_run_widom()[source]

Submit widom calculation only if there is some accessible volume, also check the number of blocking spheres and estimate the saturation loading.

aiida_lsmo.workchains.isotherm_inflection.get_output_parameters(inp_params, pressures, geom_out, widom_out, **gcmc_dict)[source]

Merge results from all the steps of the work chain. geom_out (Dict) contains the output of Zeo++ widom_out (Dict) contains the output of Raspa’s Widom insertions calculation gcmc_dict (dict of Dicts) has the keys like: inp/out_RaspaGCMC/RaspaGCMCNew/RaspaGCMCSat_1..n

aiida_lsmo.workchains.isotherm_inflection.get_pressure_points(molecule_dict, isotparam)[source]

Multiply p/p0 with p0 to have pressure points in bar if pressure_list!=None, or choose them based on pressure_min/max/num, to be equispaced in a Log plot.

aiida_lsmo.workchains.isotherm_multi_temp module

IsothermMultiTemp workchain.

class aiida_lsmo.workchains.isotherm_multi_temp.IsothermMultiTempWorkChain(*args: Any, **kwargs: Any)[source]

Bases: WorkChain

Run IsothermWorkChain for multiple temperatures: first compute geometric properties and then submit Widom+GCMC at different temperatures in parallel

__abstractmethods__ = frozenset({})
__module__ = 'aiida_lsmo.workchains.isotherm_multi_temp'
_abc_impl = <_abc_data object>
collect_isotherms()[source]

Collect all the results in one Dict

classmethod define(spec)[source]

Define the specification of the process, including its inputs, outputs and known exit codes.

A metadata input namespace is defined, with optional ports that are not stored in the database.

run_geometric()[source]

Perform Zeo++ block and VOLPO calculation with IsothermWC.

run_isotherms()[source]

Compute isotherms at different temperatures.

should_continue()[source]

Continue if porous

aiida_lsmo.workchains.isotherm_multi_temp.get_output_parameters(geom_dict, **isotherm_dict)[source]

Gather together all the results, returning lists for the multi temperature values

aiida_lsmo.workchains.isotherm_multi_temp.get_parameters_singletemp(i, parameters)[source]

Get input Dict for a single isotherm calculation.

aiida_lsmo.workchains.multicomp_ads_des module

A work chain.

class aiida_lsmo.workchains.multicomp_ads_des.MulticompAdsDesWorkChain(*args: Any, **kwargs: Any)[source]

Bases: WorkChain

Compute Adsorption/Desorption in crystalline materials, for a mixture of componentes and at specific temperature/pressure conditions.

__abstractmethods__ = frozenset({})
__module__ = 'aiida_lsmo.workchains.multicomp_ads_des'
_abc_impl = <_abc_data object>
_get_gcmc_inputs_adsorption()[source]

Generate Raspa input parameters from scratch, for a multicomponent GCMC calculation.

_update_gcmc_inputs_desorption()[source]

Update Raspa input parameters for desorption: Temperature, Pressure, Composition and Restart.

classmethod define(spec)[source]

Define the specification of the process, including its inputs, outputs and known exit codes.

A metadata input namespace is defined, with optional ports that are not stored in the database.

inspect_zeopp_calc()[source]

Asserts whether all widom calculations are finished ok. If so, manage zeopp results.

parameters_info = {Required('ff_cutoff', description='CutOff truncation for the VdW interactions (Angstrom).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('ff_framework', description='Forcefield of the structure  (used also as a definition of ff.rad for zeopp)'): <class 'str'>, Required('ff_mixing_rule', description='Mixing rule'): Any('Lorentz-Berthelot', 'Jorgensen', msg=None), Required('ff_separate_interactions', description='if true use only ff_framework for framework-molecule interactions in the FFBuilder'): <class 'bool'>, Required('ff_shifted', description='Shift or truncate the potential at cutoff.'): <class 'bool'>, Required('ff_tail_corrections', description='Apply tail corrections.'): <class 'bool'>, Required('raspa_gcmc_init_cycles', description='Number of GCMC initialization cycles.'): <class 'int'>, Required('raspa_gcmc_prod_cycles', description='Number of GCMC production cycles.'): <class 'int'>, Required('raspa_verbosity', description='Print stats every: number of cycles / raspa_verbosity.'): <class 'int'>, Required('raspa_widom_cycles', description='Number of GCMC production cycles.'): <class 'int'>, Required('zeopp_block_samples', description='Number of samples for BLOCK calculation (per A^3).'): <class 'int'>, Required('zeopp_probe_scaling', description="scaling probe's diameter: molecular_rad * scaling"): Any(<class 'int'>, <class 'float'>, msg=None)}
parameters_schema = <Schema({Required('ff_framework', description='Forcefield of the structure  (used also as a definition of ff.rad for zeopp)'): <class 'str'>, Required('ff_separate_interactions', description='if true use only ff_framework for framework-molecule interactions in the FFBuilder'): <class 'bool'>, Required('ff_mixing_rule', description='Mixing rule'): Any('Lorentz-Berthelot', 'Jorgensen', msg=None), Required('ff_tail_corrections', description='Apply tail corrections.'): <class 'bool'>, Required('ff_shifted', description='Shift or truncate the potential at cutoff.'): <class 'bool'>, Required('ff_cutoff', description='CutOff truncation for the VdW interactions (Angstrom).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('zeopp_probe_scaling', description="scaling probe's diameter: molecular_rad * scaling"): Any(<class 'int'>, <class 'float'>, msg=None), Required('zeopp_block_samples', description='Number of samples for BLOCK calculation (per A^3).'): <class 'int'>, Required('raspa_verbosity', description='Print stats every: number of cycles / raspa_verbosity.'): <class 'int'>, Required('raspa_gcmc_init_cycles', description='Number of GCMC initialization cycles.'): <class 'int'>, Required('raspa_gcmc_prod_cycles', description='Number of GCMC production cycles.'): <class 'int'>, Required('raspa_widom_cycles', description='Number of GCMC production cycles.'): <class 'int'>}, extra=PREVENT_EXTRA, required=False) object>
return_output_parameters()[source]

Merge all the parameters into output_parameters, depending on is_porous and is_kh_ehough.

run_raspa_gcmc_ads()[source]

Submit Raspa GCMC with adsorption T, P and composition.

run_raspa_gcmc_des()[source]

Submit Raspa GCMC with adsorption T, P and composition.

run_zeopp()[source]

It performs the full zeopp calculation for all components.

setup()[source]

Initialize parameters

should_run_zeopp()[source]

Return if it should run zeopp calculation.

aiida_lsmo.workchains.multicomp_ads_des.get_atomic_radii(isotparam)[source]

Get {ff_framework}.rad as SinglefileData form workchain/isotherm_data. If not existing use DEFAULT.rad.

aiida_lsmo.workchains.multicomp_ads_des.get_components_dict(conditions, parameters)[source]

Construct components dict, like: {‘xenon’: { ‘name’: ‘Xe’, ‘molfraction’: xxx, ‘proberad’: xxx, ‘zeopp’: {…}, },…}

aiida_lsmo.workchains.multicomp_ads_des.get_ff_parameters(components, isotparams)[source]

Get the parameters for ff_builder.

aiida_lsmo.workchains.multicomp_ads_des.get_geometric_output(zeopp_out)[source]

Return the geometric_output Dict from Zeopp results, including is_porous

aiida_lsmo.workchains.multicomp_ads_des.get_output_parameters(inp_conditions, components, **all_out_dicts)[source]

Extract results to output_parameters Dict.

aiida_lsmo.workchains.multicomp_gcmc module

A work chain.

class aiida_lsmo.workchains.multicomp_gcmc.MulticompGcmcWorkChain(*args: Any, **kwargs: Any)[source]

Bases: WorkChain

Compute multicomponent GCMC in crystalline materials (or empty box), for a mixture of componentes and at specific temperature/pressure conditions.

__abstractmethods__ = frozenset({})
__module__ = 'aiida_lsmo.workchains.multicomp_gcmc'
_abc_impl = <_abc_data object>
_get_gcmc_inputs()[source]

Generate Raspa input parameters from scratch, for a multicomponent GCMC calculation.

classmethod define(spec)[source]

Define the specification of the process, including its inputs, outputs and known exit codes.

A metadata input namespace is defined, with optional ports that are not stored in the database.

inspect_zeopp_calc()[source]

Asserts whether all widom calculations are finished ok. If so, manage zeopp results.

parameters_info = {Required('ff_cutoff', description='CutOff truncation for the VdW interactions (Angstrom).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('ff_framework', description='Forcefield of the structure  (used also as a definition of ff.rad for zeopp)'): <class 'str'>, Required('ff_mixing_rule', description='Mixing rule'): Any('Lorentz-Berthelot', 'Jorgensen', msg=None), Required('ff_separate_interactions', description='if true use only ff_framework for framework-molecule interactions in the FFBuilder'): <class 'bool'>, Required('ff_shifted', description='Shift or truncate the potential at cutoff.'): <class 'bool'>, Required('ff_tail_corrections', description='Apply tail corrections.'): <class 'bool'>, Required('raspa_gcmc_init_cycles', description='Number of GCMC initialization cycles.'): <class 'int'>, Required('raspa_gcmc_prod_cycles', description='Number of GCMC production cycles.'): <class 'int'>, Required('raspa_verbosity', description='Print stats every: number of cycles / raspa_verbosity.'): <class 'int'>, Required('zeopp_block_samples', description='Number of samples for BLOCK calculation (per A^3).'): <class 'int'>, Required('zeopp_probe_scaling', description="scaling probe's diameter: molecular_rad * scaling"): Any(<class 'int'>, <class 'float'>, msg=None)}
parameters_schema = <Schema({Required('ff_framework', description='Forcefield of the structure  (used also as a definition of ff.rad for zeopp)'): <class 'str'>, Required('ff_separate_interactions', description='if true use only ff_framework for framework-molecule interactions in the FFBuilder'): <class 'bool'>, Required('ff_mixing_rule', description='Mixing rule'): Any('Lorentz-Berthelot', 'Jorgensen', msg=None), Required('ff_tail_corrections', description='Apply tail corrections.'): <class 'bool'>, Required('ff_shifted', description='Shift or truncate the potential at cutoff.'): <class 'bool'>, Required('ff_cutoff', description='CutOff truncation for the VdW interactions (Angstrom).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('zeopp_probe_scaling', description="scaling probe's diameter: molecular_rad * scaling"): Any(<class 'int'>, <class 'float'>, msg=None), Required('zeopp_block_samples', description='Number of samples for BLOCK calculation (per A^3).'): <class 'int'>, Required('raspa_gcmc_init_cycles', description='Number of GCMC initialization cycles.'): <class 'int'>, Required('raspa_gcmc_prod_cycles', description='Number of GCMC production cycles.'): <class 'int'>, Required('raspa_verbosity', description='Print stats every: number of cycles / raspa_verbosity.'): <class 'int'>}, extra=PREVENT_EXTRA, required=False) object>
return_output_parameters()[source]

Merge all the parameters into output_parameters, depending on is_porous and is_kh_ehough.

run_raspa_gcmc()[source]

Summits Raspa GCMC calculation for every condition (i.e, [temp, press] combination).

run_zeopp()[source]

It performs the full zeopp calculation for all components.

setup()[source]

Initialize parameters

should_run_zeopp()[source]

Return if it should run zeopp calculation.

aiida_lsmo.workchains.multicomp_gcmc.get_atomic_radii(isotparam)[source]

Get {ff_framework}.rad as SinglefileData form workchain/isotherm_data. If not existing use DEFAULT.rad.

aiida_lsmo.workchains.multicomp_gcmc.get_components_dict(conditions, parameters)[source]

Construct components dict, like: {‘xenon’: { ‘name’: ‘Xe’, ‘molfraction’: xxx, ‘proberad’: xxx, ‘zeopp’: {…}, },…}

aiida_lsmo.workchains.multicomp_gcmc.get_ff_parameters(components, isotparams)[source]

Get the parameters for ff_builder.

aiida_lsmo.workchains.multicomp_gcmc.get_output_parameters(inp_conditions, components, **all_out_dicts)[source]

Extract results to output_parameters Dict.

aiida_lsmo.workchains.nanoporous_screening_1 module

ZeoppMultistageDdecPeWorkChain workchain

class aiida_lsmo.workchains.nanoporous_screening_1.NanoporousScreening1WorkChain(*args: Any, **kwargs: Any)[source]

Bases: WorkChain

A workchain that combines: ZeoppMultistageDdecWorkChain wc1 and IsothermCalcPEWorkChain wc2. In future I will use this to include more applications to run in parallel.

__abstractmethods__ = frozenset({})
__module__ = 'aiida_lsmo.workchains.nanoporous_screening_1'
_abc_impl = <_abc_data object>
classmethod define(spec)[source]

Define workflow specification.

include_results_wc1()[source]

Include results of work chain 1 in group.

include_results_wc2()[source]

Include results of work chain 2 in group.

make_group()[source]

Create curated-xxx_XXXX_vx group and put the orig_cif inside, and exit if it already exists.

run_wc1()[source]

Run work chain 1.

run_wc2()[source]

Run work chain 2.

aiida_lsmo.workchains.nanoporous_screening_1.include_node(tag, node, group)[source]

Given an aiida-node and a (string) tag, add the node in the curated-cof_XXX_vX group, and set the tag as the extra of the node for the query.

aiida_lsmo.workchains.parameters_schemas module

Schemas for validating input parameters of workchains.

Defines a couple of building blocks that are reused by many workchains.

class aiida_lsmo.workchains.parameters_schemas.Optional(schema, msg=None, default=..., description=None)[source]

Bases: Marker

Mark a node in the schema as optional, and optionally provide a default

>>> schema = Schema({Optional('key'): str})
>>> schema({})
{}
>>> schema = Schema({Optional('key', default='value'): str})
>>> schema({})
{'key': 'value'}
>>> schema = Schema({Optional('key', default=list): list})
>>> schema({})
{'key': []}

If ‘required’ flag is set for an entire schema, optional keys aren’t required

>>> schema = Schema({
...    Optional('key'): str,
...    'key2': str
... }, required=True)
>>> schema({'key2':'value'})
{'key2': 'value'}
__init__(schema, msg=None, default=..., description=None)[source]
__module__ = 'voluptuous.schema_builder'
__repr__()

Return repr(self).

__slotnames__ = []
class aiida_lsmo.workchains.parameters_schemas.Required(schema, msg=None, default=..., description=None)[source]

Bases: Marker

Mark a node in the schema as being required, and optionally provide a default value.

>>> schema = Schema({Required('key'): str})
>>> with raises(er.MultipleInvalid, "required key not provided @ data['key']"):
...   schema({})
>>> schema = Schema({Required('key', default='value'): str})
>>> schema({})
{'key': 'value'}
>>> schema = Schema({Required('key', default=list): list})
>>> schema({})
{'key': []}
__init__(schema, msg=None, default=..., description=None)[source]
__module__ = 'voluptuous.schema_builder'
__repr__()

Return repr(self).

__slotnames__ = []

aiida_lsmo.workchains.sim_annealing module

Simulated Annealing workchain

class aiida_lsmo.workchains.sim_annealing.SimAnnealingWorkChain(*args: Any, **kwargs: Any)[source]

Bases: WorkChain

A work chain to compute the minimum energy geometry of a molecule inside a framework, using simulated annealing, i.e., decreasing the temperature of a Monte Carlo simulation and finally running and energy minimization step.

__abstractmethods__ = frozenset({})
__module__ = 'aiida_lsmo.workchains.sim_annealing'
_abc_impl = <_abc_data object>
_get_raspa_nvt_param()[source]

Write Raspa input parameters from scratch, for an MC NVT calculation

_spec = <aiida.engine.processes.workchains.workchain.WorkChainSpec object>
classmethod define(spec)[source]

Define the specification of the process, including its inputs, outputs and known exit codes.

A metadata input namespace is defined, with optional ports that are not stored in the database.

parameters_info = {Required('ff_cutoff', description='CutOff truncation for the VdW interactions (Angstrom).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('ff_framework', description='Forcefield of the structure  (used also as a definition of ff.rad for zeopp)'): <class 'str'>, Required('ff_mixing_rule', description='Mixing rule'): Any('Lorentz-Berthelot', 'Jorgensen', msg=None), Required('ff_separate_interactions', description='if true use only ff_framework for framework-molecule interactions in the FFBuilder'): <class 'bool'>, Required('ff_shifted', description='Shift or truncate the potential at cutoff.'): <class 'bool'>, Required('ff_tail_corrections', description='Apply tail corrections.'): <class 'bool'>, Required('mc_steps', description='Number of MC cycles.'): <class 'int'>, Required('number_of_molecules', description='Number of molecules loaded in the framework.'): <class 'int'>, Required('temperature_list', description='List of decreasing temperatures for the annealing.'): <class 'list'>}
parameters_schema = <Schema({Required('ff_framework', description='Forcefield of the structure  (used also as a definition of ff.rad for zeopp)'): <class 'str'>, Required('ff_separate_interactions', description='if true use only ff_framework for framework-molecule interactions in the FFBuilder'): <class 'bool'>, Required('ff_mixing_rule', description='Mixing rule'): Any('Lorentz-Berthelot', 'Jorgensen', msg=None), Required('ff_tail_corrections', description='Apply tail corrections.'): <class 'bool'>, Required('ff_shifted', description='Shift or truncate the potential at cutoff.'): <class 'bool'>, Required('ff_cutoff', description='CutOff truncation for the VdW interactions (Angstrom).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('temperature_list', description='List of decreasing temperatures for the annealing.'): <class 'list'>, Required('mc_steps', description='Number of MC cycles.'): <class 'int'>, Required('number_of_molecules', description='Number of molecules loaded in the framework.'): <class 'int'>}, extra=PREVENT_EXTRA, required=False) object>
return_results()[source]

Return molecule position and energy info.

run_raspa_min()[source]

Run a Energy Minimization in Raspa.

run_raspa_nvt()[source]

Run a NVT calculation in Raspa.

setup()[source]

Initialize the parameters

should_run_nvt()[source]

Update temperature untill the last of the list.

aiida_lsmo.workchains.sim_annealing.get_molecule_from_restart_file(structure_cif, molecule_folderdata, input_dict, molecule_dict)[source]

Get a CifData file having the cell of the initial (unexpanded) structure and the geometry of the loaded molecule. TODO: this is source of error if there are more than one molecule AND the cell has been expanded, as you can not wrap them in the small cell.

aiida_lsmo.workchains.sim_annealing.get_output_parameters(input_dict, min_out_dict, **nvt_out_dict)[source]

Merge energy info from the calculations.

aiida_lsmo.workchains.singlecomp_widom module

A work chain.

class aiida_lsmo.workchains.singlecomp_widom.SinglecompWidomWorkChain(*args: Any, **kwargs: Any)[source]

Bases: WorkChain

Computes widom insertion for a framework/box at different temperatures.

__abstractmethods__ = frozenset({})
__module__ = 'aiida_lsmo.workchains.singlecomp_widom'
_abc_impl = <_abc_data object>
_get_widom_inputs()[source]

Generate Raspa input parameters from scratch, for a Widom calculation.

classmethod define(spec)[source]

Define the specification of the process, including its inputs, outputs and known exit codes.

A metadata input namespace is defined, with optional ports that are not stored in the database.

inspect_zeopp_calc()[source]

Asserts whether all widom calculations are finished ok and expose block file.

parameters_info = {Required('ff_cutoff', description='CutOff truncation for the VdW interactions (Angstrom).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('ff_framework', description='Forcefield of the structure  (used also as a definition of ff.rad for zeopp)'): <class 'str'>, Required('ff_mixing_rule', description='Mixing rule'): Any('Lorentz-Berthelot', 'Jorgensen', msg=None), Required('ff_separate_interactions', description='if true use only ff_framework for framework-molecule interactions in the FFBuilder'): <class 'bool'>, Required('ff_shifted', description='Shift or truncate the potential at cutoff.'): <class 'bool'>, Required('ff_tail_corrections', description='Apply tail corrections.'): <class 'bool'>, Required('raspa_verbosity', description='Print stats every: number of cycles / raspa_verbosity.'): <class 'int'>, Required('raspa_widom_cycles', description='Number of Widom cycles.'): <class 'int'>, 'temperatures': [Any(<class 'int'>, <class 'float'>, msg=None)], Required('zeopp_block_samples', description='Number of samples for BLOCK calculation (per A^3).'): <class 'int'>, Required('zeopp_probe_scaling', description="scaling probe's diameter: molecular_rad * scaling"): Any(<class 'int'>, <class 'float'>, msg=None)}
parameters_schema = <Schema({Required('ff_framework', description='Forcefield of the structure  (used also as a definition of ff.rad for zeopp)'): <class 'str'>, Required('ff_separate_interactions', description='if true use only ff_framework for framework-molecule interactions in the FFBuilder'): <class 'bool'>, Required('ff_mixing_rule', description='Mixing rule'): Any('Lorentz-Berthelot', 'Jorgensen', msg=None), Required('ff_tail_corrections', description='Apply tail corrections.'): <class 'bool'>, Required('ff_shifted', description='Shift or truncate the potential at cutoff.'): <class 'bool'>, Required('ff_cutoff', description='CutOff truncation for the VdW interactions (Angstrom).'): Any(<class 'int'>, <class 'float'>, msg=None), Required('zeopp_probe_scaling', description="scaling probe's diameter: molecular_rad * scaling"): Any(<class 'int'>, <class 'float'>, msg=None), Required('zeopp_block_samples', description='Number of samples for BLOCK calculation (per A^3).'): <class 'int'>, Required('raspa_verbosity', description='Print stats every: number of cycles / raspa_verbosity.'): <class 'int'>, Required('raspa_widom_cycles', description='Number of Widom cycles.'): <class 'int'>, 'temperatures': [Any(<class 'int'>, <class 'float'>, msg=None)]}, extra=PREVENT_EXTRA, required=False) object>
return_output_parameters()[source]

Merge all the parameters into output_parameters, depending on is_porous and is_kh_ehough.

run_raspa_widom()[source]

Run parallel Widom calculation in RASPA, at all temperature specified in the conditions setting.

run_zeopp()[source]

It performs the full zeopp calculation for all components.

setup()[source]

Initialize parameters

should_run_zeopp()[source]

Return if it should run zeopp calculation.

aiida_lsmo.workchains.singlecomp_widom.get_output_parameters(inp_parameters, **all_out_dicts)[source]

Extract results to output_parameters Dict.

aiida_lsmo.workchains.singlecomp_widom.get_zeopp_parameters(molecule_dict, isotparam)[source]

Get the ZeoppParameters from the inputs of the workchain

aiida_lsmo.workchains.zeopp_multistage_ddec module

ZeoppMultistageDdecWorkChain work chain

class aiida_lsmo.workchains.zeopp_multistage_ddec.ZeoppMultistageDdecWorkChain(*args: Any, **kwargs: Any)[source]

Bases: WorkChain

A workchain that combines: Zeopp + Cp2kMultistageWorkChain + Cp2kDdecWorkChain + Zeopp

__abstractmethods__ = frozenset({})
__module__ = 'aiida_lsmo.workchains.zeopp_multistage_ddec'
_abc_impl = <_abc_data object>
_spec = <aiida.engine.processes.workchains.workchain.WorkChainSpec object>
classmethod define(spec)[source]

Define workflow specification.

parameters_info = {Required('ha', description='Using high accuracy (mandatory!)'): <class 'str'>, Required('psd', description='Small probe to compute the pore size distr'): [Any(<class 'int'>, <class 'float'>, msg=None), Any(<class 'int'>, <class 'float'>, msg=None), <class 'int'>], Required('res', description='Max included, free and incl in free sphere'): <class 'bool'>, Required('sa', description='Nitrogen probe to compute surface'): [Any(<class 'int'>, <class 'float'>, msg=None), Any(<class 'int'>, <class 'float'>, msg=None), <class 'int'>], Required('vol', description='Geometric pore volume'): [Any(<class 'int'>, <class 'float'>, msg=None), Any(<class 'int'>, <class 'float'>, msg=None), <class 'int'>], Required('volpo', description='Nitrogen probe to compute PO pore volume'): [Any(<class 'int'>, <class 'float'>, msg=None), Any(<class 'int'>, <class 'float'>, msg=None), <class 'int'>]}
parameters_schema = <Schema({Required('ha', description='Using high accuracy (mandatory!)'): <class 'str'>, Required('res', description='Max included, free and incl in free sphere'): <class 'bool'>, Required('sa', description='Nitrogen probe to compute surface'): [Any(<class 'int'>, <class 'float'>, msg=None), Any(<class 'int'>, <class 'float'>, msg=None), <class 'int'>], Required('vol', description='Geometric pore volume'): [Any(<class 'int'>, <class 'float'>, msg=None), Any(<class 'int'>, <class 'float'>, msg=None), <class 'int'>], Required('volpo', description='Nitrogen probe to compute PO pore volume'): [Any(<class 'int'>, <class 'float'>, msg=None), Any(<class 'int'>, <class 'float'>, msg=None), <class 'int'>], Required('psd', description='Small probe to compute the pore size distr'): [Any(<class 'int'>, <class 'float'>, msg=None), Any(<class 'int'>, <class 'float'>, msg=None), <class 'int'>]}, extra=PREVENT_EXTRA, required=False) object>
return_results()[source]

Return exposed outputs

run_multistageddec()[source]

Run MultistageDdec work chain

run_zeopp_after()[source]

Run Zeo++ for the oprimized structure

run_zeopp_before()[source]

Run Zeo++ for the original structure

Module contents

Workchains developed at LSMO laboratory.