I was studying Quantum Mechanics from the book Quantum Mechanics, Concepts and Applications by Nouredine Zettili. I came across this definition of an operator.
An operator $\hat{A}$ is a mathematical rule that when applied to a ket $\left| \psi \right>$ transforms it into another ket $\left| \psi' \right>$ of the same space ...
(emphasis mine)
Then, in the examples, gradient is stated to be an operator, even though it takes a scalar function $\psi(\vec{r})$ and transforms it into a vector function $\vec{\nabla}\psi(\vec{r})$, which surely belongs to a different space.
What am I missing here? A wikipedia search said that operators is a function from one set of physical states to another.
I am looking for something more authoritative, though, given the previous definition was from a textbook.