Quantum dimensionality reduction by linear discriminant analysis