weight function and the metric The weight function comes from Dirac's book, PRINCIPLES OF QUANTUM MECHANICS. On page 66,he says that sometimes it is more convenient not to normalise the eigenvectors, i.e. $$\langle\xi_1'...\xi_u'|\xi_1''...\xi_u''\rangle=\rho'^{-1}\delta(\xi_1'-\xi_1'')...\delta(\xi_u'-\xi_u'')$$
Thus we have $$\iiint|\xi_1'...\xi_u'\rangle\langle\xi_1'...\xi_u'|\rho'd\xi_1'...d\xi_u'=1$$
Here Dirac says that $\rho'd\xi_1'...d\xi_u'$ is the weight attached to the volume element of the space of the variables $\xi_1',...,\xi_u'$.
If we consider the space of the variables $\xi_1',...,\xi_u'$ as a Riemann manifold $M$ with metric $g$, then the volume element of $(M,g)$ is $\sqrt{\det(g)}d\xi_1'...d\xi_u'$.  Does the two volume element equal? i.e. do we have that $\rho'=\sqrt{\det(g)}$?
In his book,he then gives an example where the $\xi$'s are the polar and azimuthal angles $\theta,\phi$ giving  a direction in three-dimensional space. In this case we have $\rho'=\sin{\theta'}$. And if we calculate the $\sqrt{\det(g)}$ of the unit sphere(in coordinates $\theta,\phi$),it is $\sin{\theta'}$,too!
Is it just coincidence? Or is there an explanation?
Would someone be kind enough to give me some hints on this? Thank you very much!
 A: Without a separate definition of a volume element, you can just take Dirac's $\rho$ to define a volume element on the configuration space, and it works as such, because of the second formula you wrote.
But in the example, you are transforming rectangular coordinates to different coordinates, the volume form from Dirac's $\rho$ coincides with the volume form from the metric, just because you choose it that way. The normalization of states is up to you, as always.
$$ dx^i = {\partial x^i \over \partial q^j} dq^j$$
and the reverse transformation is nonsingular:
$$ dq^i = {\partial q^i \over \partial x^j} dx^j$$
So that the induced metric on q is given by the dot product below:
$$ g_ij dq^i \cdot dq^j = {\partial q^i \over \partial x^j} {\partial q^j\over \partial x^j} \delta_{ij}$$
The volume form transforms as the wedge product of the $dx^i$
$$ dV_x = |\mathrm{det} {\partial x_i\over \partial q_j}| dV_q$$
Now you can transform the completeness relation for x:
$$ \int d^dx |x\rangle\langle x| = \int d^dq\sqrt{|\mathrm{det} g|} |x(q)\rangle\langle x(q)| $$
And if you want to replace the $|x\rangle$ states with $|q\rangle$ states, you need to choose a normalization for the $|q\rangle$ states. This allows you to absorb the volume factor into the normalization of the states. But you can use any normalization you want for q,
$$ \langle q|q'\rangle = \rho(q) $$
and then the completeness relation will be
$$ \int d^dq \sqrt{|det g|} |x(q)\rangle\langle x(q)| =  \int d^dq {1\over \rho(q)} |q\rangle\langle q| $$
It is convenient to choose $\rho(q)=\sqrt{|det g|}^{-1}$, because then the $\rho$ absorbs the volume factor, and the states |q> are the same as the states |x(q)> (these are not just the position delta-functions, because a change of variables changes delta functions).
In terms of explicit wavefunctions in 1d
If you write the $|x\rangle$ ket explicity as a delta function wavefunction
$$\psi(x') = \delta(x'-x)$$
and you write the $|q\rangle$ normalized ket explicity as a delta function wavefunction in q.
$$\psi(q') = \delta(q'-q)$$
Then you can understand the change of variables formula from the derivative factors that go into a delta function from a change of variables. This is tedious, and reproduces the above, so I won't do it, but it's good for building up the intuition about where all the factors go.
Momentum space 2 pi
One nice, but trivial, use of this is to absorb the $2\pi$ constant from Fourier transforms into the momentum state normalization. The completeness relation for momentum space then reads
$$\int {d^3 p\over (2\pi)^3} |p\rangle\langle p| = \int dp |p\rangle\langle p|$$ 
This convention for the measure of $d^3p$ absorbs a $2\pi$ factor into each $dp$. Then delta functions for $p$'s are
$$ \delta(p-p') = (2\pi)^3 \delta(p_x - p_x') \delta(p_y-p_y') \delta(p_z -p_z')$$
The transformation is very simple, because it is  just a scaling, and it is a good way to practice Dirac's formalism until you know where the $2\pi$'s go without thinking. This trivial case is probably the best way to internalize the measure issues. This is also the best convention for Fourier transforms, and is almost universal in physics.
In engineering and mathematics, people often normalize the Fourier transform so that it can be thought of as taking a function space to itself, and if you do it twice (up to conjugation), you get the same function back. This introduces $\sqrt{2\pi}$ factors into the transform. These square-root factors are what you multiply the basis states $|p\rangle$ by in order to move from this convention to the normalized p-state convention.
The Dirac formalism is designed to effectively get rid of these square roots, which are very annoying, by putting them into the integration measure, where they belong.
Relativistic normalization
The best example is relativistic noramlization, where you use non-normalized basis vectors for parametrizing momentum states in relativistic collisions. Here the states $|p\rangle$ in the nonrelativistic normalization obey
$$ \int d^3p |p\rangle\langle p| = 1 $$ 
But in the relativistic theory $d^3p$ is not a relativistic invariant. The p states are restricted to a mass-shell hyperbola, where $p^2=m^2$ (the four-dimensional length of the energy-momentum), and while $p_x,p_y,p_z$ are good coordinates for the hyperbola, the hyperbola isn't flat, and the amount of invariant area per unit p-volume is different at different p's.
The invariant measure is easiest to work out using a delta-function, since
$$ \int d^4p\;\; \delta(p^2 - m^2) f(p)  = \int {d^3 p \over 2|p_0|} f(p) = \int dp_3 f(p) $$
So the right relativistically invariant state normalization is to make
$$ |p\rangle\langle p| = 2|p_0| $$
or equivalently:
$$ \langle p | p' \rangle = 2|p_0|\delta^3(p-p')$$
And this can be achieved by multiplying the states by the square root of $2p_0$. That this is the right way to normalize will be shown using the usual free field expansion in terms of creation and annihilation operators
$$ \phi(x) = \int {d^3p \over (2\pi)^{3/2} \sqrt{2p_0}} ( a_p e^{-ip\cdot x} + a^{\dagger}_p e^{ip\cdot x} ) $$ 
This formula is incomprehensible only because the momentum states are not normalized correctly for relativity and for absorbing 2pi factors. But using relativistic 2pi normalization, the matrix elements of $a$ and $a^{\dagger}$ become simple, and this becomes
$$ \phi(x) = \int dp_3\;\; a(p) e^{ip\cdot x} + a^{\dagger}(p) e^{-ip\cdot x} $$
Where the relativistically normalized creation and annihilation operators create a relativistically normalized, $2\pi$ normalized, state. The integration measure is relativistically invariant and absorbs the 2pi factors. This is the correct way to expand relativistic fields in operators, but not a single QFT book does it to my knowledge.
