The twisted open string partition function and Yukawa couplings