def add_layer(self, formula='', thickness=np.NaN, density=np.NaN):
        """provide another way to define the layers (stack)

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

        _new_stack = _utilities.formula_to_dictionary(formula=formula,
                                                      thickness=thickness,
                                                      density=density,
                                                      database=self.database)
        # check if density has been defined
        self.__lock_density_if_defined(stack=_new_stack)

        new_stack = self.__update_stack_with_isotopes_infos(stack=_new_stack)
        self.stack = {**self.stack, **new_stack}

        # calculate stack_sigma, layer density, atoms_per_cm3 ...
        self.__math_on_stack()