Optimal classical and quantum real and complex dimension witness
We find the minimal number of independent preparations and measurements certifying the dimension of a classical or quantum system limited to $d$ states, optionally reduced to the real subspace. As a dimension certificate, we use the linear independence tested by a determinant. We find the sets of preparations and measurements that maximize the chance to detect larger space if the extra contribution is very small. We discuss the practical application of the test to certify the space logical operations on a quantum computer.