  Quantum states can be used to encode the information contained in a
direction, i.e., in a unit vector. We present the best encoding procedure when
the quantum state is made up of $N$ spins (qubits). We find that the quality of
this optimal procedure, which we quantify in terms of the fidelity, depends
solely on the dimension of the encoding space. We also investigate the use of
spatial rotations on a quantum state, which provide a natural and less
demanding encoding. In this case we prove that the fidelity is directly related
to the largest zeros of the Legendre and Jacobi polynomials. We also discuss
our results in terms of the information gain.
