Dualizing module

In abstract algebra, a dualizing module, also called a canonical module, is a module over a commutative ring that is analogous to the canonical bundle of a smooth variety. It is used in Grothendieck local duality.
Definition.
A dualizing module for a Noetherian ring "R" is a finitely generated module "M" such that for any maximal ideal "m", the "R"/"m" vector space vanishes if "n" ≠ height("m") and is 1-dimensional if "n" = height("m").
A dualizing module need not be unique because the tensor product of any dualizing module with a rank 1 projective module is also a dualizing module. However this is the only way in which the dualizing module fails to be unique: given any two dualizing modules, one is isomorphic to the tensor product of the other with a rank 1 projective module. 
In particular if the ring is local the dualizing module is unique up to isomorphism. 
A Noetherian ring does not necessarily have a dualizing module. Any ring with a dualizing module must be Cohen–Macaulay. Conversely if a Cohen–Macaulay ring is a quotient of a Gorenstein ring then it has a dualizing module. In particular any complete local Cohen–Macaulay ring has a dualizing module. For rings without a dualizing module it is sometimes possible to use the dualizing complex as a substitute.
Examples.
If "R" is a Gorenstein ring, then "R" considered as a module over itself is a dualizing module.
If "R" is an Artinian local ring then the Matlis module of "R" (the injective hull of the residue field) is the dualizing module. 
The Artinian local ring "R" = "k"["x","y"]/("x"2,"y"2,"xy") has a unique dualizing module, but it is not isomorphic to "R".
The ring Z[] has two non-isomorphic dualizing modules, corresponding to the two classes of invertible ideals. 
The local ring "k"["x","y"]/("y"2,"xy") is not Cohen–Macaulay so does not have a dualizing module.