  A numerical algorithm that computes the decomposition of any
finite-dimen\-sio\-nal unitary reducible representation of a compact Lie group
is presented. The algorithm, which does not rely on an algebraic insight on the
group structure, is inspired by quantum mechanical notions. After generating
two adapted states (these objects will be conveniently defined in {\bf
Def.\,II.1}) and after appropriate algebraic manipulations, the algorithm
returns the block matrix structure of the representation in terms of its
irreducible components. It also provides an adapted orthonormal basis. The
algorithm can be used to compute the Clebsch--Gordan coefficients of the tensor
product of irreducible representations of a given compact Lie group. The
performance of the algorithm is tested on various examples: the decomposition
of the regular representation of two finite groups and the computation of
Clebsch--Gordan coefficients of two examples of tensor products of
representations of $SU(2)$.
