'q' must be a 'd' matrix with one column