Representation theory
The canonical basis for the irreducible representations of a quantized enveloping algebra of type 
 and also for the plus part of that algebra was introduced by Lusztig  [2]  by two methods: an algebraic one (using a braid group action and PBW bases) and a topological one (using intersection cohomology). Specializing the parameter 
 to 
 yields a canonical basis for the irreducible representations of the corresponding simple Lie algebra, which was not known earlier. Specializing the parameter 
 to 
 yields something like a shadow of a basis. This shadow (but not the basis itself) for the case of irreducible representations was considered independently by Kashiwara; [3]  it is sometimes called the crystal basis. The definition of the canonical basis was extended to the Kac-Moody setting by Kashiwara  [4]  (by an algebraic method) and by Lusztig  [5]  (by a topological method).
There is a general concept underlying these bases:
Consider the ring of integral Laurent polynomials 
 with its two subrings 
 and the automorphism 
 defined by 
.
A precanonical structure on a free 
-module 
 consists of
- A standard basis 
 of 
, - An interval finite partial order on 
, that is, 
 is finite for all 
, - A dualization operation, that is, a bijection 
 of order two that is 
-semilinear and will be denoted by 
 as well. 
If a precanonical structure is given, then one can define the 
 submodule 
 of 
.
A canonical basis of the precanonical structure is then a 
-basis 
 of 
 that satisfies:
 and
for all 
.
One can show that there exists at most one canonical basis for each precanonical structure. [6]  A sufficient condition for existence is that the polynomials 
 defined by 
 satisfy 
 and 
.
A canonical basis induces an isomorphism from 
 to 
.
Linear algebra
If we are given an n × n matrix 
 and wish to find a matrix 
 in Jordan normal form, similar to 
, we are interested only in sets of linearly independent generalized eigenvectors.  A matrix in Jordan normal form is an "almost diagonal matrix," that is, as close to diagonal as possible.  A diagonal matrix 
 is a special case of a matrix in Jordan normal form.  An ordinary eigenvector is a special case of a generalized eigenvector.
Every n × n matrix 
 possesses n linearly independent generalized eigenvectors.  Generalized eigenvectors corresponding to distinct eigenvalues are linearly independent.  If 
 is an eigenvalue of 
 of algebraic multiplicity 
, then 
 will have 
 linearly independent generalized eigenvectors corresponding to 
.
For any given n × n matrix 
, there are infinitely many ways to pick the n linearly independent generalized eigenvectors.  If they are chosen in a particularly judicious manner, we can use these vectors to show that 
 is similar to a matrix in Jordan normal form.  In particular,
Definition:  A set of n linearly independent generalized eigenvectors is a canonical basis if it is composed entirely of Jordan chains.
Thus, once we have determined that a generalized eigenvector of rank m is in a canonical basis, it follows that the m − 1 vectors 
 that are in the Jordan chain generated by 
 are also in the canonical basis. [7] 
Computation
Let 
 be an eigenvalue of 
 of algebraic multiplicity 
.  First, find the ranks (matrix ranks) of the matrices 
.  The integer 
 is determined to be the first integer for which 
 has rank 
 (n being the number of rows or columns of 
, that is, 
 is n × n).
Now define

The variable 
 designates the number of linearly independent generalized eigenvectors of rank k (generalized eigenvector rank; see generalized eigenvector) corresponding to the eigenvalue 
 that will appear in a canonical basis for 
.  Note that

Once we have determined the number of generalized eigenvectors of each rank that a canonical basis has, we can obtain the vectors explicitly (see generalized eigenvector). [8] 
Example
This example illustrates a canonical basis with two Jordan chains.  Unfortunately, it is a little difficult to construct an interesting example of low order. [9]  The matrix

has eigenvalues 
 and 
 with algebraic multiplicities 
 and 
, but geometric multiplicities 
 and 
.
For 
 we have 
 has rank 5,
 has rank 4,
 has rank 3,
 has rank 2.
Therefore 




Thus, a canonical basis for 
 will have, corresponding to 
 one generalized eigenvector each of ranks 4, 3, 2 and 1.
For 
 we have 
 has rank 5,
 has rank 4.
Therefore 


Thus, a canonical basis for 
 will have, corresponding to 
 one generalized eigenvector each of ranks 2 and 1.
A canonical basis for 
 is

 is the ordinary eigenvector associated with 
.   
 and 
 are generalized eigenvectors associated with 
.   
 is the ordinary eigenvector associated with 
.   
 is a generalized eigenvector associated with 
.
A matrix 
 in Jordan normal form, similar to 
 is obtained as follows:


where the matrix 
 is a generalized modal matrix for 
 and 
. [10]