Experimental and ab initio studies of two UV nonlinear optical materials