Are these two forms of quantum mechanics postulates equivalent? 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?
 A: The apparent counterexample you mention is a very interesting point which I have only seen discussed in Dirac's book Principles of Quantum Mechanics and in Quantum Field Theory: Lectures by Sidney Coleman. But let's start from the beginning.
It is easy to see that the commutation relation of the position and the momentum operators follows immediately from the formulation of these operators in terms of their matrix elements. Thus, to argue that the two formulations are equivalent, we only need to argue that the formulation of the position and the momentum operators in terms of their matrix elements follows from simply postulating the commutation relations.


*Given the commutation relations $[\hat{x},\hat{p}]=i$, we immediately realize that $\hat{x},\hat{p}$ cannot have finite-dimensional representations because, in Hilbert spaces of finite dimensionality, the trace of a commutator has to vanish. Thus, we already know that $\hat{x},\hat{p}$ must act upon infinite-dimensional Hilbert spaces.

*Now, we simply consider the orthonormalized (in the Dirac sense) eigenbasis of an operator $\hat{x}$ to be $\{\vert x\rangle \vert x\in\mathbb{R}\}$. By definition
\begin{align}
\langle y\vert \hat x\vert x\rangle&=x\delta(x-y)\\
\end{align}
And we consider another operator $\hat{p}$ defined by
\begin{align}
\langle y\vert\hat{p}\vert x\rangle&=-i\delta'(x-y)
\end{align}
In order to study the behavior of these freshly defined operator more easily, we will deduce their $x$ basis representation which can be purely mathematically deduced from their definitions given above. Using IBP, we first write
\begin{align}
\langle x\vert\hat{x}\vert\psi\rangle&=x\langle x\vert\psi\rangle\equiv x\psi(x)\\
\langle x\vert\hat{p}\vert\psi\rangle&=-i\partial_x\langle x\vert\psi\rangle = -i\partial_x\psi(x)
\end{align}
So, in this $x$ basis representation, we can siply write
\begin{align}
\hat{x}\psi(x)=x\psi(x)\\
\hat{p}\psi(x)=-i\partial_x\psi(x)
\end{align}

*Now, it is trivial to show that the operators $x$ and $-i\frac{\partial}{\partial x}$ obey the commutation relations $[x,-i\partial_x]=i$. Thus, we have constructed one pair of operators who obey the commutation relations that we expect from the canonical formalism. Thus, if we were looking for operators who obey the commutation relations postulated via the canonical formalism, these are good candidates. However, these are not the unique operators one can formulate. But notice, that the only variation one can do is what you did, i.e., add $f(x)$ to $-i\partial_x$, otherwise, the commutation relations would be affected. So,  can equally choose $p_x=-i\partial_x+f(x)$ and it would still follow the same commutation relations. Now, what do we do? Let's table that for a moment, because...

*We suddenly remember that the vectors in the basis that is chosen for the construction of operators are arbitrary up to an overall phase factor. We could have chosen $e^{iF(x)}\vert x\rangle$ instead of $\vert x \rangle$. So, let's we consider this new basis $\vert x^*\rangle=e^{iF(x)}\vert x\rangle$. Notice that these are still orthonormal eigenbasis of the $\hat{x}$ operator, and the eigenvalue corresponding to $\vert x*\rangle$ is still $x$. So the matrix elements of the $\hat{x}$ operator don't change at all, i.e., $\langle y^*\vert\hat{x}\vert x^*\rangle=\delta(x-y)$ which we can also choose to call $\delta(x^*-y^*)$ because when speaking of eigenvalues $x^*=x$. So, for example, $\partial_x$ and $\partial_{x^*}$ are the same. However, notice that $\psi(x^*)=\langle x^*\vert\psi\rangle=e^{-iF(x)}\langle x\vert\psi\rangle=e^{-iF(x)}\psi(x)$. Now, let's see how the $\hat{p}$ operator behaves in this basis. In particular, how is the $x^*$ basis representation of the momentum operator looks.
\begin{align}
\langle x^*\vert \hat{p}\vert \psi\rangle&=\int dy\langle x^*\vert y\rangle\langle y\vert \hat{p}\vert\psi\rangle\\
&=\int dy e^{-iF(x)}\delta(x-y)(-i\partial_y\psi(y))\\
&= -ie^{-iF(x)}\partial_x\psi(x)\\
&= -ie^{-iF(x)}\partial_x\big(e^{iF(x)}\psi(x^*)\big)\\
&= -ie^{-iF(x)}\partial_xe^{iF(x)}-ie^{-iF(x)}e^{iF(x)}\partial_x\psi(x^*)\\
&= \partial_xF(x)\psi(x^*)-i\partial_x\psi(x^*)\\
&= \partial_xF(x)\psi(x^*)-i\partial_{x^*}\psi(x^*)\\
&= \big(\partial_xF(x)-i\partial_{x^*}\big)\psi(x^*)
\end{align}
So, we see that in the $x^*$ basis representation
\begin{align}
\hat{p}\psi(x^*)=\big(\partial_xF(x)-i\partial_{x^*}\big)\psi(x^*)
\end{align}
Now, we can define another operator $\hat{p}^*\equiv \hat{p}-f(\hat{x})$ where $f(\hat{x})$ is such that $f(\hat{x})\vert x\rangle=\partial_xF(x)\vert x\rangle$. And then, we would immediately get that
\begin{align}
\langle x^* \vert \hat{p}^* \vert \psi\rangle = -i\partial_{x^*}\psi(x^*)
\end{align}
Or, in other words, in the $x^*$ basis representation
\begin{align}
\hat{p}^* \psi(x^*) = -i\partial_{x^*}\psi(x^*)
\end{align}

*Now, we can think of this procedure in reverse and say that for every $\hat{p}+f(\hat{x})$, we can choose a new eigenbasis for the position operator which differs from the previous one by a phase factor $e^{-iF(x)}$ such that $\partial_xF(x)=f(x)$. And in this new basis, the matrix components of the $\hat{x}$ and $\hat{p}^* = \hat{p}+f(\hat{x})$ will be given by the usual expressions and thus, we can always take $\hat{x}$ and $\hat{p}$ to have the usual matrix elements with the understanding that the phases of the basis have been adjusted to make sure this is the case.

A: I would say that the most general form is to start from the Dirac-von Neumann axioms. These will give you something like the second form in your post. That is to say, classical variables are found from expectations of the observable operators. Replacing the classical variables by the observables (second quantisation) gives you the same structure, but I have never been comfortable with it, because it is really just an ad hoc procedure, historically important it is true, but impossible to justify deductively. If one wants a step by step justification of the structure defined by the Dirac-von Neumann axioms, one should do something like I have done in The Hilbert space of conditional clauses
I am not clear whether there is a difference between dependent variables in your two forms. It is not in general true that $\langle\Omega(X,P)\rangle = \Omega(x,p)$, but I am not sure that your first form means to imply that this is true.
The counter example you give seems to mean that $X$ and $P$ cannot simply be defined by the canonical commutation relation, which means something else must be at least implicit in your first form. Surely if you add $f(x)$ you are losing the correspondence between $P$ and $p$, and it must be, at the very least, implicit that this is not intended. Usually I prefer to define $p$ as the conjugate basis under Fourier transform, and derive the commutation relation.
