  We report on an experimental test of classical and quantum dimension. We have
used a dimension witness which can distinguish between quantum and classical
systems of dimension 2,3 and 4 and performed the experiment for all five cases.
The witness we have chosen is a base of semi-device independent cryptographic
and randomness expansion protocols. Therefore, the part of the experiment, in
which qubits were used, is a realization of these protocols. In our work we
also present an analytic method for finding the maximal quantum value of the
witness along with corresponding measurements and preparations. This method is
quite general and can be applied to any linear dimension witness.
