function val = theta(q,k)

val = hull(theta_(q,k-1),theta_(q,k));

return;

function val = theta_(q,k)

j=0:k; a=(-1).^j./(2*j+1).*q.^(j.*(j+1));
val=2*q^(1/4).*sum(a);

return;