add function to read Q map from file