Let $S$ be a [numerical semigroup](https://en.wikipedia.org/wiki/Numerical_semigroup) and $k[S]$ is the associated semigroup ring. I would like to compute canonical module $\omega$ of $k[S].$


***I want to show that $\omega=k[t^{-n}:n\in\mathbb Z\setminus S]$.***


I have shown that $H^1\_{m}(k[S])=k[t^{n}:n\in\mathbb Z\setminus S]$ where $m$ is the maximal homogeneous ideal of $k[S].$ Using duality I tried to compute canonical ideal but I am not able to do it.



Canonical module of a semigroup ring
I'm going to assume you mean $S$ to be graded with the obvious $\Bbb Z$-grading (i.e. $\operatorname{deg}(t)=1$), and that you're asking for the graded canonical module. Otherwise, I don't know what you mean by canonical module.


By graded local duality,
$$ \omega\_S \cong H^1\_\mathfrak{m}(S)^\vee, $$
where $(-)^\vee$ is the graded Matliss dual: If $M$ is a graded $S$-module, define
$$M^\vee := \operatorname{{}^\*Hom}\_k(M,k),$$
where $\operatorname{{}^\*Hom}\_k(M,N)$ is the vector space of finite-degree homogeneous vector space maps and whose $d$th graded component is the vector subspace of degree $d$ maps. Knowing this,
$$H^1\_\mathfrak{m}(S)^\vee \cong k[t^{-n}| n\in \Bbb Z\setminus S],$$
as hoped.


