In quantum mechanics, given certain energy spectrum can one generate the corresponding potential? A typical problem in quantum mechanics is to calculate the spectrum that corresponds to a given potential. 


*

*Is there a one to one correspondence between the potential and its spectrum? 

*If the answer to the previous question is yes, then given the spectrum, is there a systematic way to calculate the corresponding potential?

 A: In general, the answer is no. This type of inverse problem is sometimes referred to as: "Can one hear the shape of a drum". An extensive exposition by Beals and Greiner (Anal. Appl. 7, 131 (2009); eprint) discusses various problems of this type. Despite the fact that one can get a lot of geometrical and topological information from the spectrum or even its asymptotic behavior, this information is not complete even for systems as simple as quantum mechanics along a finite interval.
For additional details, see Apeiron 9 no. 3, 20 (2002), or also Phys. Rev. A 40, 6185 (1989), Phys. Rev. A 82, 022121 (2010), or Phys. Rev. A 55, 2580 (1997). 
For a more experimental view, you can actually have particle-in-a-box problems with differently-shaped boxes in two dimensions that have the same spectra; this follows directly from the Gordon-Webb isospectral drums  (Am. Sci. 84 no. 1, 46 (1996); jstor), and it was implemented by the Manoharan lab in Stanford (Science 319, 782 (2008); arXiv:0803.2328), to striking effect:

A: Yes, at least for one dimension you can obtain the solution to the inverse problem as follows:
let $N(E)$ be the eigenvalue staircase; then in the WKB approximation the inverse of the potential is given by
$ V^{-1} (x) = 2 \sqrt \pi \frac{d^{1/2}}{dx^{1/2}}N(x) $
so we can obtain the inverse (and hence the potential from the eignevalue staircase).
A: The Harmonic oscillator has the same spectrum as a weaker harmonic oscillator with a hard wall at x=0.
LATER EDIT: I see that I have to be more explicit--- the potentials


*

*$V(x)= 2x^2 - 2$

*$(x>0)$ $V(x)= x^2 - 3$ and $(x<0)$ $V(x)= \infty$


have the exact same spectrum.
A: As all the answers are oriented in the theoretical side let me remind everybody of the Balmer series, an experimental observation fitted with a mathematical series, which was first modeled with the Bohr model of the hydrogen atom, and then was the cornerstone of building quantum mechanics, as it came out from the Schrodinger equation.
So in this sense a given/measured energy spectrum matched a specific potential in the Schrodinger equation.

1) Is there a one to one correspondence between the potential and its spectrum?

In the historical example above , yes. I have not seen a second potential replacing the hydrogen potential in modelling. 

2) If the answer to the previous question is yes, then given the spectrum, is there a systematic way to calculate the corresponding potential

The historical example is an educated  trial and error method, after all the classical potential between charges was known. It seems to point to this: use the corresponding for the generator of the spectrum classical potential to start with. A spectrum is a physical observation coming from specific atoms/molecules/ensembles . So I would replace "calculate" with "find". Physics is about finding mathematical models that fit the observables, imo.
Within a theoretical framework the  "in general no"  is the answer since there are infinities of possible solutions. Were we really lucky to have discovered quantum mechanics , if the probability of finding the potential that fits a spectrum is so small? IMO no, the physicists were using their physics background to find a good theoretical model that would fit the observations ( Balmer series) and use their classical knowledge of potentials as a boundary on the infinity of solutions. It is a similar logical process as using boundary conditions to reduce the infinity of solutions from the differential equations to one that fits the data.
A: I'll somewhat expound the solution by qmechanic, and give two examples.  The solution is closely related to Landau's method for period inversion, see Mechanics Sec. 12.
The quantum number can be approximately computed as
\begin{align}
(n + \delta) \, 2 \pi \hbar
&= \oint p \, dq \\
&= \oint \sqrt{2\,m\, [E - V(q)]} \, dq \\
&= 4 \int_0^{r_\max} \sqrt{2\,m\, [E - V(q)]} \, dq,
\tag{1}
\end{align}
where $\delta$ is number between $0$ and $1$ (i.e., $1/2$), and $\hbar$ is the Planck constant.  The integral $\oint$ means “go there and come back”. In the last step, we have assumed $V(q)$ is centrosymmetric and $V(r_\max) = E$. Differentiating (1) with respect to $E$, we get
\begin{align}
2 \pi \hbar \, \frac{\partial n} {\partial E}
&= \int_0^{r_\max} \frac{ \sqrt{8 m}  \, dq } { \sqrt{E - V(q)} },
\tag{1}
\end{align}
Multiplying this by $1/\sqrt{2 \, m \, (\alpha - E)}$ and integrating over $E$, we get 
\begin{align}
2 \pi \hbar \, \int_0^\alpha \frac{\partial n} {\partial E}
\frac{dE}{\sqrt{2 \, m \, (\alpha - E)}}
&=
\int_0^{r_\max} 2 \, dq \int_{V(q)}^\alpha \frac{dE}{\sqrt{\alpha - E}{\sqrt{E - V(q)}}}
\\
&=
2 \, \pi \, r_\max.
\end{align}
Now since $V(r_\max) = \alpha$,
the potential $V(r)$ is solved via the inverse function as
\begin{align}
\hbar \, \int_0^\alpha \frac{\partial n} {\partial E}
\frac{dE}{\sqrt{2 \, m \, (\alpha - E)}}
&=
V^{-1}(\alpha),
\end{align}
where the inverse function is taken for the $r > 0$ branch.
Example 1
For the harmonic oscillator,
$E_n = \hbar \, \omega (n + 1/2)$,
then $\partial n/\partial E =  (\hbar \, \omega)^{-1}$, and
\begin{align}
\hbar \, \int_0^\alpha \frac{\partial n} {\partial E}
\frac{dE}{\sqrt{2 \, m \, (\alpha - E)}}
&=
\sqrt{\frac{2 \, \alpha}{m \, \omega^2}} = r.
\end{align}
which means the potential is $V(r) = \alpha = \frac{1}{2} m \, \omega^2 \, r^2$,
which is correct.
Example 2
If $E_n = (\hbar \pi n)^2/(2 m L^2)$,
then $\partial n/\partial E =  L/(\hbar \, \pi) \sqrt{m/(2\,E)}$, and
\begin{align}
\hbar \, \int_0^\alpha \frac{\partial n} {\partial E}
\frac{dE}{\sqrt{2 \, m \, (\alpha - E)}}
&=
\frac{L}{2\,\pi} \, \int_0^\alpha
\frac{dE}{\sqrt{E \, (\alpha - E)}} \\
&=
\frac{L}{2} = r.
\end{align}
This means that the inverse function $V^{-1}(\alpha)$ is a constant $L/2$ no matter the value of $\alpha$ (even as $\alpha$ grows to $+\infty$).  In other words, the $V(r)$ grows steeply to infinity at $r = L/2$.  Since we assume that the potential is symmetric, $V(r)$ also grows to infinity at $r = -L/2$.  This means that the potential has two symmetric infinite hard walls at $r = \pm L/2$.  This is the case of a particle in a box of size $L$. Thanks to Kyle-Kanos to point this out.
A: In this answer we will only consider the leading semi-classical approximation of a $1$-dimensional problem with Hamiltonian
$$ H(x,p) ~=~ \frac{p^2}{2m}+ \Phi(x), $$
where $\Phi$ is a potential. Semi-classically, the number of states $N(E)$ below energy-level $E$ is given by the area of phase space that is classically accessible, divided by Planck's constant $h$,
$$ N(E) ~\approx~ \iint_{H(x,p)\leq E} \frac{dx~dp}{h}. \tag{1}$$
[Here we ignore the Maslov index, also known as the metaplectic correction, which e.g. yields the zero-point energy in the simple harmonic oscillator(SHO) spectrum.]
Let
$$ V_0~:=~ \inf_{x\in\mathbb{R}} ~\Phi(x) $$
be the infimum of the potential energy. Let
$$\ell(V)~:=~\lambda(\{x\in\mathbb{R} \mid \Phi(x) \leq V\})  $$
be the length of the classically accessible position region at potential energy-level $V$.
[Technically, the length $\ell(V)$ is the Lebesgue  measure $\lambda$ of the preimage
$$\Phi^{-1}(]-\infty,V])~:=~ \{x\in\mathbb{R} \mid \Phi(x) \leq V\},$$
which does not necessarily have to be a connected interval.] Assuming that the Hamiltonian operator is bounded from below, we get that
$$ N(V_0)~=~0. $$
Example 1: If the potential $\Phi(x)=\Phi(-x)$ is an even function and is strongly monotonically increasing for $x\geq 0$, then the accessible length $\ell(V)=2\Phi^{-1}(V)$ is twice the positive inverse branch of $\Phi$.
Example 2: If the potential has a hard wall $\Phi(x)=+\infty$ for $x<0$, and is strongly monotonically increasing for $x\geq 0$, then the accessible length $\ell(V)=\Phi^{-1}(V)$ is  the positive inverse branch of $\Phi$.
Example 3: If the potential $\Phi(x)$ is strongly monotonically decreasing for  $x\leq0$ and strongly monotonically increasing for $x\geq 0$, then the accessible length $\ell(V)=\Phi_{+}^{-1}(V)-\Phi_{-}^{-1}(V)$ is the difference of the two inverse branch of $\Phi$.
In Example 1 and 2, if we would be able to determine the accessible length function $\ell(V)$, then we would also be able to generate the corresponding potential $\Phi(x)$ as OP asks.

The main claim is that we can reconstruct the accessible length $\ell(V)$ from $N(E)$, and vice-versa.
$$N(E) ~\approx ~\frac{\sqrt{2m}}{h} \int_{V_0}^E  \frac{\ell(V)~dV}{\sqrt{E-V}},\tag{2} $$
$$ \ell(V)  ~\approx ~\hbar\sqrt{\frac{2}{m}} \frac{d}{dV}\int_{V_{0}}^V \frac{N(E)~dE}{\sqrt{V-E}}.\tag{3} $$

[The $\approx$ signs are to remind us of the semi-classical approximation (1) we made.
The formulas can be written in terms of fractional derivatives as Jose Garcia points out in his answer.]
Proof of eq. (2):
$$\begin{align} h ~N(E) ~\stackrel{(1)}{\approx}~~~& 2\int_0^{\sqrt{2m(E-V_0)}} \left. \ell(V) \right|_{V=E-\frac{p^2}{2m}}~dp\cr
~\stackrel{V=E-\frac{p^2}{2m}}{=}&~2\int_{V_0}^E \frac{\ell(V)~dV}{v}\cr
~=~~~&\sqrt{2m}\int_{V_0}^E  \frac{\ell(V)~dV}{\sqrt{E-V}},\end{align} $$
because $dV~=~ - v~dp$ with speed $v~:=~\frac{p}{m}~=~\sqrt{\frac{2(E-V)}{m}}$. $\Box$
Proof of eq. (3): Notice that
$$ \int_{V^{\prime}}^V \frac{dE}{\sqrt{(V-E)(E-V^{\prime})}} ~\stackrel{E=V \sin^2\theta + V^{\prime} \cos^2\theta }{=}~ 2 \int_0^{\frac{\pi}{2}} d\theta ~=~ \pi.\tag{4} $$
Then
$$\begin{align}\frac{h}{\sqrt{2m}}\int_{V_0}^V \frac{N(E)~dE}{\sqrt{V-E}} ~\stackrel{(2)}{\approx}~& 
\int_{V_0}^{V}\frac{dE}{\sqrt{V-E}}\int_{V_0}^{E}  \frac{\ell(V^{\prime})~dV^{\prime}}{\sqrt{E-V^{\prime}}} \cr
~\stackrel{{\rm Fubini}}{=}&~\int_{V_0}^V \ell(V^{\prime})~dV^{\prime}\int_{V^{\prime}}^V \frac{dE}{\sqrt{(V-E)(E-V^{\prime})}} \cr
~\stackrel{(4)}{=}~& \pi \int_{V_0}^V \ell(V^{\prime})~dV^{\prime},\end{align}\tag{5}$$
where we rely on Fubini's Theorem to change the order of integrations.
Finally, differentiation wrt. $V$ on both sides of eq. (5) yields eq. (3). $\Box$
Let us for completeness try to integrate by parts (IBP).
$$\begin{align}\frac{1}{\hbar}\sqrt{\frac{m}{2}}\int_{V_0}^V \ell(V^{\prime})~dV^{\prime} 
~\stackrel{(3)}{\approx}~& \int_{V_0}^V \frac{N(E)~dE}{\sqrt{V-E}} \cr
~\stackrel{\text{IBP}}{=}~& 2\int_{V_0}^V \!dE~N^{\prime}(E)\sqrt{V-E},
 \end{align} \tag{6}$$
so that
$$\begin{align} 
\frac{1}{\hbar}\sqrt{\frac{m}{2}}\ell(V) 
~\stackrel{(3)}{\approx}~& \frac{d}{dV}\int_{V_{0}}^V \frac{N(E)~dE}{\sqrt{V-E}}\cr
~\stackrel{(6)}{=}~&\int_{V_0}^V \frac{N^{\prime}(E)~dE}{\sqrt{V-E}}\cr
~\stackrel{\text{IBP}}{=}~& 2N^{\prime}(V_0)\sqrt{V-V_0} + 2\int_{V_0}^V \!dE~N^{\prime\prime}(E)\sqrt{V-E}.\tag{7}
\end{align} $$
Similarly,
$$\begin{align} 
\frac{h}{\sqrt{2m}}N(E) 
~\stackrel{(2)}{\approx}~& \int_{V_0}^E \frac{\ell(V)~dV}{\sqrt{E-V}} \cr
~\stackrel{\text{IBP}}{=}~& 2\ell(V_0)\sqrt{E-V_0} + 2\int_{V_0}^E\!dV~\ell^{\prime}(V)\sqrt{E-V},\tag{8}
\end{align} $$
so that
$$ 
\frac{h}{\sqrt{2m}}N^{\prime}(E) 
~\stackrel{(8)}{\approx}~\frac{\ell(V_0)}{\sqrt{E-V_0}} + \int_{V_0}^E\!dV~\frac{\ell^{\prime}(V)}{\sqrt{E-V}}.
\tag{9} $$
For more information, see my related Phys.SE answer here.
A: As a addition to the reply by @Jose Javier Garcia and in the spirit of the reply by @anna v, in molecular spectroscopy, anharmonic potentials are often approximately described by the Morse Potential, but this is insufficient in most cases and then the Rydberg-Klein-Rees (RKR) numerical method is very widely used to obtain the potential energy profile. This method is based on the semiclassical WKB method. (See Hirst, 'Potential Energy Surfaces; Molecular Structure and Reaction Dynamics' and articles on Wikipedia).
