I have learn two form of two postulates of quantum mechanics:
First Form
The independent variables $x$ and $p$ of classical mechanics now become Hermitian operators $X$ and $P$ defined by the canonical commutator $[X,P]=i\hbar$. Dependent variable $\omega(x,p)$ are given by operator $\Omega=\omega(x\rightarrow X,p\rightarrow P)$.
Second form
The independent variables $x$ and $p$ of classical mechanics are represented by Hermitian operators $X$ and $P$ with the following matrix elements in the eigenbasis of $X$ $$\langle x|X|x'\rangle =x \delta(x-x')$$ $$\langle x|P|x'\rangle =-i\hbar \delta'(x-x')$$ The operator corresponding to dependent variable $\omega(x,p)$ are given Hermitian operators $$\Omega(X,P)=\omega(x\rightarrow X,p\rightarrow P)$$
Are these two forms are equivalent? As for the first one one can add a function $f(x)$ and that doesn't change any thing and that suggest that the basis are not unique. I mean $$X\rightarrow x$$ and $$P\rightarrow -i\hbar \frac{d}{dx}+f(x)$$ is equally satisfactory.
If they are not equivalent, then which one is more general?