add add_pdmat (tested)