I am not sure what do you exactly want and what is shape of q_tri. If its just array with (1, 5) shape, then perhaps adding sum into your for loop will do it.
Output:In [2]: q_tri = np.arange(5).reshape(1,-1)
In [3]: q_tri
Out[3]: array([[0, 1, 2, 3, 4]])
In [4]: Xn = []
...: L = 3
...: for a in range(5):
...: Xn.append(L * np.sum(np.sin(q_tri[:,1:a+1]), axis=1))
...:
In [5]: Xn
Out[5]:
[array([ 0.]),
array([ 2.52441295]),
array([ 5.25230523]),
array([ 5.67566526]),
array([ 3.40525777])]