def add_layer(self, formula='<STR_LIT>', thickness=np.NaN, density=np.NaN):
if formula == '<STR_LIT>':<EOL><INDENT>return<EOL><DEDENT>_new_stack = _utilities.formula_to_dictionary(formula=formula,<EOL>thickness=thickness,<EOL>density=density,<EOL>database=self.database)<EOL>self.__lock_density_if_defined(stack=_new_stack)<EOL>new_stack = self.__update_stack_with_isotopes_infos(stack=_new_stack)<EOL>self.stack = {**self.stack, **new_stack}<EOL>self.__math_on_stack()<EOL>
provide another way to define the layers (stack)

        Parameters:
        ===========
        formula: string
           ex: 'CoAg2'
           ex: 'Al'
        thickness: float (in mm)
        density: float (g/cm3)