Could you give us an variety X which is QGorenstein variety, but this variety is not Gorenstein variety? What is the canonical divisor K_X on X? How can we compute its canonical divisor? Could you give us an variety which is not Gorenstein variety? What is the canonical divisor K_X on X? How can we compute its canonical divisor?

3$\begingroup$ Just to quickly answer the other question. The canonical divisor $K_X$ on a normal variety $X$ is any divisor $D$ such that if $U \subseteq X$ is the regular locus, then $$O_U(D_U) \cong \Omega_{U/k}^{\dim X}.$$ One common way to compute a canonical divisor is by adjunction. For example, if $X \subseteq Y$ is a normal hypersurface in a normal variety $Y$, and we know the canonical divisor on $Y$, then $$(K_Y + X)_X = K_X.$$ Alternately, for any $X$ of dimension $d$ in $\mathbb{P^n}$, then $$O_X(K_X) \cong \mathcal{E}xt^{nd}(O_X, O_{\mathbb{P}^n}(n1)).$$ $\endgroup$– Karl SchwedeCommented Apr 28, 2012 at 17:15
3 Answers
Let me give a couple more examples to complement what J.C.Ottem already said.
First I'll point out a couple discrepancies in terminology for a normal variety:
Gorenstein: This means that both $K_X$ is Cartier and $X$ is CohenMacaulay.
$Q$Gorenstein: This means that $nK_X$ is Cartier for some integer $n > 0$.
QuasiGorenstein (or $1$Gorenstein): This means that $K_X$ is Cartier but that $X$ is not necessarily CohenMacaulay.
In particular, $Q$Gorenstein does not usually imply CohenMacaulay (because of this a lot of people don't like the terminology, notably János Kollár). On the other hand, some people like to require the CohenMacaulay condition in their $Q$Gorenstein definition (adding to the confusion). It would also be "reasonable" to require that some canonical cover of $X$ is CohenMacaulay!
Ok, let me at least state the general rule for when a cone (or rather a section ring) is $Q$Gorenstein or Gorenstein.
First note that because $S$ is graded, a module is free of rank one if and only if it is isomorphic to $S$ itself (up to a shift in grading).
Suppose that $X$ is a smooth (or even Gorenstein) projective algebraic variety over a field $k$ and suppose that $L$ is an ample line divisor. Form the ring: $$ S = \bigoplus_{k \in \mathbb{Z}} O_X(kL) $$ and let $m = S_+$ denote the irrelevant ideal. Also form the $S$module $$ \omega_S = \bigoplus_{k \in \mathbb{Z}} (\omega_X \otimes O_X(kL)) $$ I claim that $\omega_S$ is the canonical module of $S$. This is actually pretty easy to see, $S$ is always normal so $\omega_S$ is determined on $U = \text{Spec} S \setminus m$. Therefore since $f : U \to X$ is a $\mathbb{A}^1$bundle it follows that $\omega_U$ is just $f^* \omega_X$ which it is easy to see coincides with $\omega_X_U$.
Then
Theorem (quasiGorenstein): The ring $S$ is quasiGorenstein if and only if $K_X \sim nL$ for some integer $n$ (possibly $n = 0$).
The proof idea is as follows. Since $K_X \sim nL$, it follows that $\omega_S$ is just $S$ shifted over by $n$. But that's a free module. Conversely, if $\omega_S$ is a free module, since $S$ is graded, it must be a shift of $S$.
Theorem ($Q$Gorenstein): $S$ is $Q$Gorenstein if and only if $mK_X \sim nL$ for some integers $n$ and $m \neq 0$.
The proof idea is similar, it follows from the same sorts of arguments as above that $$O_{\text{Spec} S}(mK_S) = \omega_S^{(m)} = \bigoplus_{k \in \mathbb{Z}} O_{X}(kL + mK_S).$$ Therefore for this to be free, we need exactly $mK_S = nL$ for some integer $n$.
Theorem (CohenMacaulay): Finally $S$ is CohenMacaulay if and only if $H^i(X, O_X(kL)) = 0$ for all $\dim X > i > 0$ and all $k \in \mathbb{Z}$.
Note that the points away from the origin are CohenMacaulay since $X$ was smooth (or at least Gorenstein $\Rightarrow$ CohenMacaulay). The point is then that $[H^{i+1}_m(S)]_k = H^i(X, O_X(kL))$ where $[\bullet]_k$ is the $k$th graded piece of the module. This follows from computations in Cech cohomology.
The upshot:
This gives us lots of examples of varieties that are $Q$Gorenstein or not.
Fano: If $X$ is Fano (meaning $K_X$ is ample) and we take $L = K_X$, then $S$ is certainly quasiGorenstein. On the other hand, if we take $L = mK_X$, then $mK_X = (1)L$, $S$ is $Q$Gorenstein.
Now let's suppose we are in characteristic zero and that $X$ is smooth. If $k > 0$, we have $H^i(X, O_X(kL)) = H^i(X, O_X(K_X + (m1)K_X + (k1)L) = 0$ by Kodaira vanishing. If $k < 0$, by Serreduality, $H^i(X, O_X(kL)) = H^{\dim X  i}(X, O_X(K_X  kmL)) = 0$ by Serre vanishing. On the other hand for $k = 0$, $H^{i}(X, O_X) = H^i(X, O_X(K_X  K_X)) = 0$ by Kodaira vanishing. Thus $S$ is CohenMacaulay.
CalabiYau: If $X$ is CalabiYau (meaning $K_X = 0$) and we choose any ample $L$, then $S$ is quasiGorenstein. It may not be that $X$ is NOT Gorenstein though, it depends on the vanishing of $H^i(X, O_X(kL))$. For example, an Abelian surface has $H^1(X, O_X) \neq 0$.
Others: If $K_X$ is neither ample nor antiample, nor $Q$trivial, then you are out of luck. The cone will never be $Q$Gorenstein.

$\begingroup$ is there a relation between gorenstein and having quotient singularities? $\endgroup$ Commented Apr 28, 2012 at 17:49

$\begingroup$ No, there are nonquotient singularities that are Gorenstein (any hypersurface singularity is Gorenstein). There are quotient singularities that are not Gorenstien, for example $k[x^3, x^2y, xy^2, y^3]$. Normal finite quotient singularities are always CohenMacaulay and $Q$Gorenstein though. $\endgroup$ Commented Apr 28, 2012 at 18:15

$\begingroup$ thanks for the quick reply! where would I go about learning the normal finite case for example? $\endgroup$ Commented Apr 28, 2012 at 21:19

$\begingroup$ For the CohenMacaulay bit, this follows since the ring is a direct summand of the ring it is the invariants of. There is a paper of Hochster and J.~Roberts that does this. In fact, Boutot's theorem actually says that the singularity is rational, which amoung other things is CohenMacaulay. This stuff works for reductive groups. $$\text{ }$$ For the $Q$Gorenstein bit, see for example Lemma 5.16 in KollárMori, Birational geometry of algebraic varieties. $\endgroup$ Commented Apr 29, 2012 at 1:40
Cones are usually a good source of examples when it comes to questions like these. In your case, let $Y\subset \mathbb{P}^5$ be the Veronese embedding of $\mathbb{P}^2$ and let $X\subset \mathbb{P}^6$ be the projective cone of $Y$. Then $X$ is a normal nonGorenstein variety which is not Gorenstein. Indeed, Let $L\subset Y$ be the image of a line in $\mathbb{P}^2$ and let $D$ be the Weil divisor given by the cone over $L$. Let $H$ be the generator of $Pic(X)$, that is, the hyperplane section from the embedding in $\mathbb{P}^5$. Then $K_X=3D$ is not Cartier (as you can see by blowing up the vertex of the node and use the adjunction formula). But $2K_X$ is certainly Cartier as $2K_X\sim 6D\sim 2H$.
It is also quite easy to generate a lot of examples with toric geometry. We have next characterization:
Let $\Sigma$ be a fan in a lattice $N$ and $M = N^*$ dual lattice. Then
 $X_{\Sigma}$ is $\mathbb Q$Gorenstein iff for each cone $\sigma \in \Sigma$ generated by $n_1,...,n_r \in N$ there is $m \in M \otimes \mathbb Q$ such that $(n_i,m) = 1$ for every $i=1,...,r$
 $X_{\Sigma}$ is Gorenstein iff for each cone $\sigma \in \Sigma$ generated by $n_1,...,n_r \in N$ there is $m \in M$ such that $(n_i,m) = 1$ for every $i=1,...,r$
For example for a complete fan with generators $(1,2),(1,0),(0,1)$ in $\mathbb Z^2$ we can check that the only solution of system $1x2y=1, x=1$ is $(1,\frac{1}{2})$. So $X_{\Sigma}$ is not Gorenstein, but $\mathbb Q$Gorenstein. In fact, $X_{\Sigma} \cong \mathbb P(1,1,2)$ in this case.

$\begingroup$ +1 WPPs were the first example that came to mind. It should be straightforward to characterize which ones specifically satisfy the desired condition. $\endgroup$ Commented Aug 3, 2021 at 20:18