Linear Response#
General Theory - Sum Rules#
A general formulation of linear response is discussed in [Pitaevskii and Stringari, 2003] and we summarize their results here. The idea is to start consider two linear operators: one \(\op{G}\) that creates the excitation, and another \(\op{F}\) that we measure to detect the excitation. The system evolves with a hermitian Hamiltonian
We then consider the linear response in terms of the expectation-value of the operator \(\op{F}\):
If we consider a time-independent Hamiltonian \(\op{H}\) and start with a system in thermal equilibrium at \(t=-\infty\) with temperature \(T\), we obtain
Do It! Derive this.
Hint: Consider the density matrix.
Recall that a thermal ensemble can be described in terms of the energy eigenstates \(\ket{n}\) by a density matrix
The time-evolution of this state is
Solution
I find it easiest to work with the operator representations of these equations:
At linear order, there will be no mixing of frequencies, thus, since our perturbation contains only \(e^{\pm \omega t/\I}\), the response will have the same form. We thus include this from the start (but one can check this more generally if desired). Expanding to linear order, we have
where we have included the convergence factors in
Now we can compute the response
The desired result comes from inserting a complete set of states
Taking the matrix elements of the linear response equation, and using the fact that \(\op{H}\ket{n} = \ket{n}E_n\) and \(\op{R}\ket{n} = \ket{n}e^{-\beta E_n}\) are diagonal, we obtain
Assembling everything, we have
from which we can read off the stated result, after rearranging some indices.
The sum-rule associated with an operator \(\op{F}\) has the form (see [Wang, 1999])
These are useful if the final commutators have simple forms.
Do it! Derive this.
Simply insert a complete set of energy eigenstates:
Here we consider the fluctuations about a stationary state \(\psi_0\) of GPE-like theories to linear order – sometimes called Bogoliubov theory.
Bogoliubov Theory#
We assume that the equations of motion (EoM) arise from a principle of stationary action:
For standard GPE-like theories, we have
where \(\mathcal{E}(n)\) is the equation of state and \(K(\op{p})\) is the single-particle dispersion relation (kinetic energy). More generally, we might have an external potential, chemical potential, etc. We roll all of these into \(\mathcal{E}(n)\) for this discussion and keep this general. Thus, for the standard GPE we would have
We now replace the spatial dependence with the usual Hilbert-space structure, and express the equations of motion in terms of kets:
The idea of Bogoliubov theory is to consider fluctuations about a stationary state \(\ket{\psi_0}\):
finding \(\ket{u_{\pm}}\) that satisfy the equations of motion to linear order. The presence of the non-linear term \(n(x) = \braket{x|\psi}\braket{\psi|x}\) mixes the positive and negative frequency components. Specifically
Expanding the Hamiltonian to linear order, we thus have
Finally, expanding the equation of motion and multiplying through by \(e^{-\mu t /\I\hbar}\), we have
We now expand \(\ket{u} = \ket{u_+}e^{\omega t/\I} + \ket{u_-}e^{-\omega^* t/\I}\), and collect the positive and negative frequency terms, demanding that both vanish independently.
These can be packaged as a generalized eigenvalue equation after conjugating the second equation
On Conjugate Pairs of Eigenvalues: \(\omega_n\), \(-\omega_n^*\).
This is a generalized eigenvalue problem of the form \(\mat{A}\ket{n} =
\mat{B}\ket{n}\omega_{n}\) with Hermitian matrices \(\mat{A} = \mat{A}^\dagger\) and
\(\mat{B} = \mat{B}^\dagger\). Numerically this generalized eigenvalue problem is easy to
work with if \(\mat{B}\) is positive definite – i.e. has positive eigenvalues (see
e.g. scipy.linalg.eigh()). In this case we can use its diagonalization to write
where \(\mat{b}\) is invertable since \(\mat{D}\) is diagonal with positive entries.
Then we have a hermitian problem \(\tilde{\mat{A}}\tilde{\ket{n}} = \tilde{\ket{n}}\omega_n\) with
I.e., we can transform the problem into a standard Hermitian eigenvalue problem.
In our case, unfortunately, \(\mat{B}\) is not positive definite, making the problem somewhat challenging. There are some nice properties of our system, however (see e.g. [Wu and Niu, 2003]). Specifically, we can write the as \(\mat{B} = \mat{Z}\) where \(\mat{Z} = \mat{\sigma}_{z}\otimes \mat{1}\). These following from the property that
where \(\mat{X} = \mat{\sigma}_{x}\otimes \mat{1}\). Hence, if \(\ket{n}\) is an eigenvector with eigenvalue \(\omega_{n}\), then \(\mat{X}\ket{n}^*\) is an eigenvector with eigenvalue \(-\omega_{n}^*\):
Thus, all eigenvalues with non-zero real parts appear in conjugate pairs \(\omega_n\) and \(-\omega_n^*\). Purely imaginary eigenvalues may in principle be isolated, but will have eigenvectors which satisfy \(\mat{X}\ket{n}^* = \ket{n}\).
In many cases – for example, if the dispersion relationship is quadratic \(K(p) = p^2/2m\), the matrix \(\mat{A}=\mat{A}^*\) is self-conjugate and \(\mat{B}^* = -\mat{B}\). (This may not be the case with more complicated dispersions that break parity for example.) In these cases, we can further simplify the equations. Introduce the following projectors:
HAH = P()P + M()M
HAH = (X+Z)A(X+Z)/2 = (XAX + ZAZ + XAZ + ZAX)/2 = (4A + ZAZ + AXZ + ZXA)/2
On the \(\psi_0^2\) off-diagonals: \(\tilde{K}(\op{p})\).
The factor of \(\psi_0^2\) and conjugate in the off-diagonals is a nuisance, since the corresponding factor of \(n_0\) appears on the diagonals. In many cases, one can take the stationary state \(\psi_0 = \psi_0^*\) to be real, in which case \(\psi_0^2 = n_0\), but there are examples where this cannot be done (states with twisted boundary conditions for example, as discussed below).
In these cases, the terms differ by a phase \(\psi_0^2 = e^{2\I\phi}n_0\) which can be absorbed in a redefinition of \(u_{-} \rightarrow e^{2\I\phi} u_{-}^*\). If the phase is spatially dependent, however, then this operation will generally not commute with the kinetic energy but can be convenient. The argument goes like this (and shows a more streamlined calculation):
First include the chemical potential in \(\op{H}_0 = \op{H}[\psi_0] - \mu\op{1}\) so that \(\op{H}_0\psi_0 = 0\), and consider the state
The expansion of the density now contains only \(n_0\): no factors of \(\psi_0\) or \(\psi_0^*\) remain:
Inserting this into the EoM and keeping terms of order \(\epsilon\), we have
The last term – from the expansion of \(n\) – contains both \(\epsilon\) and \(\epsilon^*\). This is a consequence of the non-linear nature of the GPE-like equation and gives rise to a coupled set of equations for the linear response. In this case, there are no terms like \(\psi_0^2\) as in the original derivation. The factored perturbation simply gives \(n_0\) factors with the complication that \(\op{H}_0\) now acts on the product \(\psi_0\epsilon\). To proceed, we must define a new operator \(\op{\tilde{H}}_0\) that satisfies
Only the kinetic energy is a problem, so we really just need to an operator \(\tilde{K}(\op{p})\) such that
Then we can express these equations as
This modified approach will be useful when we can explicitly form \(\tilde{K}(\op{p})\).
Consider how this works for various powers of \(p\) as a consequence of the General Leibniz rule
For the usual quadratic dispersion \(K(\op{p}) = \op{p^2}/2m\) and expanding about a state \(\psi_0\) with momentum \(p_0\), we have
Note that \(\op{p}^* = -\op{p}\). This is exactly the transformation required to restore Galilean invariance. I.e., the normal modes about the state \(\psi_0\) with momentum \(p_0\) (and velocity \(v_0=p_0/m\)) should be the same as the normal modes in a co-moving frame where \(\psi_0\) has zero momentum. More on this below.
Solving the Bogoliubov Equations.
For this discussion, we will consider the following form of the Bogoliubov equations:
This can be written as a non-hermitian eigenvalue problem by letting \(u=u_{+}\) and \(v = -u_{-}^*\), recovering the form of the Bogoliubov-de Gennes (BdG) equations seen in the Hartree-Fock-Bogoliubov (HFB) theory of superconductivity:
To make further progress, consider
I = np.eye(2)
X = np.array([[0, 1], [1, 0]])
Z = np.array([[1, 0], [0, -1]])
H = (X+Z)/np.sqrt(2)
P, M = (I+Z)/2, (I-Z)/2
A = np.array([[11+1j, 0.12], [0.12, 11-1j]])
#A = np.array([[11, 0.12], [0.12, 11]])
assert np.allclose(X@A@X, A.conj())
H@A@H
array([[ 1.11200000e+01-2.23711432e-17j, -2.42933074e-16+1.00000000e+00j],
[-4.71276680e-16+1.00000000e+00j, 1.08800000e+01-2.23711432e-17j]])
Homogeneous Matter#
To see how this works, consider homogeneous matter where \(\psi_0\) has momentum \(\hbar k_0\). Translation invariance implies that we can use plane-waves \(u_{\pm} = \sqrt{n_0}\epsilon_{\pm}e^{\I (k_0 \pm k) x}\).
In this case \(\op{H}\) and \(\op{H}^*\) can be treated as a numbers
We start by expanding about the ground state with \(k_0=0\) so that \(H = H^*\). Taking the determinant, we have
If \(\omega = \omega^*\), then we find the usual phonon dispersion relation:
where (as we shall see shortly) \(c\) is the long wavelength speed of sound, expressed in terms of the compressibility \(\mathcal{E}''(n_0)\).
The chemical potential \(\mu\) cancels the constant pieces so that \(\op{H}\psi_0 = 0\) and:
Phonon Dispersion#
This gives the familiar dispersion of phonons about the ground state \(p_0 = 0\):
This is linear in the long wavelength limit \(k \rightarrow 0\) with the advertised speed of sound \(c\). Note that when expressed in terms of the energy and momentum, this is a classical result without any explicit factors of \(\hbar\).
More generally, expanding about state \(\psi_0\) with momentum \(p_0\),
where \(v_0 = p_0/m\) and \(E_0 = mv_0^2/2\). Taking the determinant, we have the slightly more cumbersome
And if \(\omega = \omega^*\), we find the boosted phonon dispersion:
hbar = m = 1
c = 1
k = np.linspace(-2, 2, 101)
k0 = 0.5
def get_w(k, k0=k0, c=c):
v0 = hbar*k0/m
p = hbar*k
H0 = p**2/2/m
w0 = np.sqrt(H0*(H0 + 2*m*c**2))/hbar
return w0 + v0*k, -w0 + v0*k
fig, ax = plt.subplots()
for w in get_w(k):
ax.plot(k, w)
Counterflow Instability#
As an application, consider a miscible (\(g_{ab}^2 < g_{aa}g_{bb}\)) two-component superfluid. The homogeneous system becomes unstable if the two components flow past each other at a sufficiently large relative velocity \(\abs{v_a - v_b} > v_c\) – a counterflow instability. Here we use the Bogoliubov theory to see this instability.
The Hamiltonian is derived by varying the following self-energy:
We consider perturbing the following state
To this we add a perturbation
These give rise to the following Bogoliubov equations
where \(K(k) = \hbar^2k^2/2m\), and
The structure of the equations is then
Nonlinear Terms: \(\mat{gn}\).
Consider the equation of \(\psi_a\). It contains the non-linear term
Expanding this will give three contributions – two from expanding the densities, and one from expanding \(\psi_a\) itself. The piece obtained by expanding \(\psi_a\) will cancel will the chemical potential \(\mu_a\), so we will only have the other two terms. Considering the equation with \(e^{-\I\omega t\) for \(u_a\), we will have which have the form
Determinant of \(\mat{M}\) (incomplete).
To compute the determinant of \(\mat{M}\), we first write the tensor structure in terms of the 2×2 matrices
Swapping the middle two rows and columns corresponds to reordering these tensors:
Recalling that \(v = v_{a} = -v_{b}\), the block structure is:
Can one use properties of determinants like those in [Silvester, 2000] or [Abadir and Magnus, 2005]to simplify this?
Solving this gives
[Alperin and Timmermans, 2025] express this in terms of the individual speeds of sound \(c_{i}\) and modified healing lengths \(\xi_{i} = h_{i}/\sqrt{2}\):
If we now assume that \(c_{a} = c_{b}\) and \(\xi_{a} = \xi_{b}\) so that \(\omega_{B,a} = \omega_{B,b} = \omega_{B}\), and take \(v = v_b = -v_a\), then the linear terms cancel and we have
This has the solution
For repulsive interactions, \(\gamma^2 > 0\), hence the only way for an instability to manifest is if the r.h.s. is negative:
For repulsive interactions, we can always induce an instability by setting
\[\begin{gather*} v = c\sqrt{1 + \xi^2k^2} \end{gather*}\]at which point the l.h.s vanishes.
This instability happens at \(k=0\) for \(v=c\): This is the usual Landau criterion.
In the presence of interactions \(\gamma^2>0\), the actual \(k=0\) critical velocity is lower:
\[\begin{gather*} v_{c} = c\sqrt{1 - \gamma} \end{gather*}\]
In the first version of [Alperin and Timmermans, 2025] they claimed that allowing \(\gamma^2 < 0\) – i.e. one of the components is attractive – one can realize a roton minimum in the quasi-particle dispersion relationship, however, the approximation \(c_{a}^2 = c_{b}^2\) and \(\xi_a^2 = \xi_b\)^2 cannot be realized if \(\gamma^2 < 0\). In particular, if we take \(g_{a} <0\) to be attractive, then
\[\begin{gather*} c_{a}^2 = -c^2, \qquad \xi_a^2 = -\xi^2,\\ \omega_{B,a}^2 = -c^2k^2(1-\xi^2k^2), \qquad \omega_{B,b}^2 = c^2k^2(1+\xi^2k^2). \end{gather*}\]The dispersion relation now satisfies
\[\begin{align*} \abs{\gamma^2}c^4 k^4 &= \bigl((\omega - vk)^2 - \omega_{B,a}^2\bigr) \bigl((\omega + vk)^2 - \omega_{B,b}^2\bigr),\\ &= \bigl((\omega - vk)^2 + c^2k^2(1-\xi^2k^2)\bigr) \bigl((\omega + vk)^2 - c^2k^2(1+\xi^2k^2)\bigr),\\ &= (\omega^2 + v^2k^2 - c^2\xi^2k^4)^2 - (c^2k^2 - 2\omega v k)^2. \end{align*}\]This has the form
\[\begin{gather*} \omega^4 + p\omega^2 + q \omega + r = 0, \qquad p = -2(c^2\xi^2k^4 + v^2k^2), \qquad q = 4vc^2k^3, \\ r = (v^2k^2 - c^2\xi^2k^4)^2 - c^4k^4 = c^4\xi^4k^8 + (v^4-c^4 - 2v^2c^4\xi^2)k^4 \end{gather*}\]In the limit of large \(k\) we have
\[\begin{gather*} p \rightarrow -2 c^2\xi^2k^4, \qquad q = 4vc^2k^3, \qquad r \rightarrow c^4\xi^4 k^8,\\ \Delta \rightarrow -c^{12}k^{12}( 512 k^{12}\xi^{12} + 4096k^{6}v^{2}\xi^{6} + 6912v^{4}) < 0\\ \end{gather*}\]Hence, there are always imaginary frequencies, and the state is unstable.
Old discussion
If we assume \(g_an_a = g_bn_b = gn\), then the linear term vanishes and we have a quadratic equation in terms of \((\hbar\omega)^2\) that can be easily solved to obtain the following condition for an instability:
We note a couple of points about this result:
The r.h.s. is manifestly non-negative, so there is always an instability since we can set the l.h.s. to zero by inducing a counterflow with momentum
\[\begin{gather*} \tilde{q} = \sqrt{\frac{gn}{2} + \frac{\tilde{k}^2}{4}}. \end{gather*}\]The physical interpretation is simple: The minimum such \(\tilde{q}\) for \(\tilde{k} = 0\) is the speed of sound
\[\begin{gather*} \frac{\hbar q}{m} = \sqrt{\frac{gn}{m}} = c. \end{gather*}\]Thus, this simply reduces to the Landau criterion for the stability of the superfluid.
The actual critical velocity is lower due to the interactions \(g_{ab}\):
\[\begin{gather*} q_{c} = \frac{\sqrt{m\Bigl(gn - \sqrt{g_{ab}^{2}n_a n_b}\Bigr)}}{\hbar}. \end{gather*}\]The quasiparticle dispersion has the form:
\[\begin{gather*} \gamma^2 = \frac{g_{ab}^2}{g_ag_b}, \qquad g_{ab}^2 n_a n_b = (\gamma gn)^2,\\ (\hbar\omega)^{2} = \tilde{k}^{2}(2gn + \tilde{k}^{2} + 4 \tilde{q}^{2}) \pm 2\tilde{k}^2\sqrt{(2 gn + \tilde{k}^2)4\tilde{q}^2 + \gamma^2(gn)^2}. \end{gather*} \]In terms of \(\gamma\), the condition of instability is
\[\begin{gather*} \Abs{1 + \frac{\tilde{k}^2 - 4\tilde{q}^2}{2gn}} < \abs{\gamma} \end{gather*}\]
Details
The standard GPE dispersion relationship is
which they express below Eq. (7) as \(\omega^2_{B,i} = k^2c_{i}^2(1+\xi_i^2 k^2)\), which requires
This differs from the usual healing length \(h = \sqrt{2} \xi\) where
If the interactions are repulsive, then the discriminant is positive, so we only have an instability if the \(\omega^2 < 0 \) is negative:
To compare with :
For fixed \(\tilde{q}\) we can find the wavevector \(\tilde{k}\) that maximizes the instability by minimizing the (negative) \((\hbar\omega)^2\):
To simplify these, we define
This is a rather nasty cubic…
Dynamics Response#
We now consider driving the system where \(V(x, t) = V_0 \cos(\omega t)\cos(kx) = \tfrac{1}{2}V_0(e^{\omega t/\I} + e^{-\omega t/\I})\cos(kx)\) is small. This adds an inhomogeneous term which we treat as the same order a \(\epsilon_{\pm}\):
the formal solution of which can be found by inverting the matrix.
Homogeneous Matter#
The full linear response follows from inverting the matrix, but we need to be a bit careful. We start by setting \(k_0 = 0\) so that parity is conserved. Then we expand:
Collecting all terms, we have two independent sets of equations:
where \(n_0 = \abs{\psi_0}^2\) and \(\op{H} = -\hbar^2\nabla^2/2m + gn_0 + \op{V}_{\text{ext}}\) is the single-particle Hamiltonian for the ground state. To solve this numerically, we write this as \(\mat{A}\cdot\vect{q} = \omega \mat{B}\cdot\vect{q}\).
These matrices have the following properties: \(\mat{A} = \mat{A}^\dagger\) and \(\mat{B} = \mat{B}^\dagger\) are Hermitian, and the matrix \(\mat{C} = \mat{C}^{-1} = \bigl(\begin{smallmatrix}&\mat{1}\\\mat{1}\end{smallmatrix}\bigr)\) conjugates \(\mat{A}\):
\mat{A}\vect{q}{+} = \omega+ \mat{B}\vect{q}{+}\ \bar{\mat{A}}\mat{C}\vect{q}{+} = \omega_+ \bar{\mat{B}}\mat{C}\vect{q}_{+}. $$
Furthermore, if \(\psi_0\) is a stationary state, then \(\op{H}\psi_0 = \mu\psi_0\).
One has two choices: solve the non-symmetric eigenvalue problem \((\mat{B}^{-1}\cdot\mat{A})\cdot\vect{q} = \omega\vect{q}\), or try to massage this into a form where \(\mat{B}\) is positive definite.
Fixed Particle Number#
Let \(\psi = \psi_0 + \d{\psi}\). The change in density is:
particle number is:
from pytimeode.evolvers import EvolverABM, EvolverSplit
from mmfutils.contexts import NoInterrupt
[I 03:37:54 numexpr.utils] NumExpr defaulting to 2 threads.
import bec;reload(bec)
from bec import State, u
s = State(N=1e1, Nxyz=(2**7,), Lxyz=(20*u.micron,))
s.pre_evolve_hook()
s._N = 1e1
s.normalize()
s.plot()
s.cooling_phase = 1j
e = EvolverSplit(s, dt=1.0, normalize=True)
E_tol = 1e-8
E1 = e.y.get_energy()
E0 = E1 + 2*E_tol
log = True
with NoInterrupt(ignore=True) as interrupted:
while not interrupted and abs(E1 - E0) > E_tol:
e.evolve(100)
E0, E1 = E1, e.y.get_energy()
plt.clf()
e.y.plot(log=log)
display(plt.gcf())
clear_output(wait=True)
e.dt = 0.01
E0 = E1 + 2*E_tol
with NoInterrupt(ignore=True) as interrupted:
while not interrupted and abs(E1 - E0) > E_tol/100:
print abs(E1 - E0)
e.evolve(100)
E0, E1 = E1, e.y.get_energy()
plt.clf()
e.y.plot(log=log)
display(plt.gcf())
clear_output(wait=True)
fact = 100.0
e = EvolverABM(e.get_y(), dt=1.0/fact)
E0 = E1 + 2*E_tol
with NoInterrupt(ignore=True) as interrupted:
while not interrupted and abs(E1 - E0) > E_tol/fact/10:
print abs(E1 - E0)
e.evolve(100)
E0, E1 = E1, e.y.get_energy()
plt.clf()
e.y.plot(log=log)
display(plt.gcf())
clear_output(wait=True)
s = e.get_y()
Cell In[8], line 31
print abs(E1 - E0)
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
Normal Modes#
Here we consider the fluctuations about a stationary state \(\psi_0\) of the GPE:
This gives the following generalized eigenvalue problem for the modes:
where \(n_0 = \abs{\psi_0}^2\) and \(\op{H} = -\hbar^2\nabla^2/2m + gn_0 + \op{V}_{\text{ext}}\) is the single-particle Hamiltonian for the ground state. To solve this numerically, we write this as \(\mat{A}\cdot\vect{q} = \omega \mat{B}\cdot\vect{q}\).
These matrices have the following properties: \(\mat{A} = \mat{A}^\dagger\) and \(\mat{B} = \mat{B}^\dagger\) are Hermitian, and the matrix \(\mat{C} = \mat{C}^{-1} = \bigl(\begin{smallmatrix}&\mat{1}\\\mat{1}\end{smallmatrix}\bigr)\) conjugates \(\mat{A}\):
\mat{A}\vect{q}{+} = \omega+ \mat{B}\vect{q}{+}\ \bar{\mat{A}}\mat{C}\vect{q}{+} = \omega_+ \bar{\mat{B}}\mat{C}\vect{q}_{+}. $$
Furthermore, if \(\psi_0\) is a stationary state, then \(\op{H}\psi_0 = \mu\psi_0\).
One has two choices: solve the non-symmetric eigenvalue problem \((\mat{B}^{-1}\cdot\mat{A})\cdot\vect{q} = \omega\vect{q}\), or try to massage this into a form where \(\mat{B}\) is positive definite.
Fixed Particle Number#
Let \(\psi = \psi_0 + \d{\psi}\). The change in density is:
particle number is:
To linear order, conservation of particle number thus implies that
import scipy.linalg
sp = scipy
H = s.get_H()
n_0 = s.get_density().ravel()
psi_0 = 1*s[...].ravel()
A = np.bmat(
[[H + np.diag(s.g*n_0), np.diag(s.g*psi_0**2)],
[np.diag(s.g*psi_0.conj()**2), H.conj() + np.diag(s.g*n_0)]])
A = np.asarray(A)
i = np.eye(len(H))
z = np.zeros_like(H)
B = np.asarray(np.bmat([[i, z], [z, -i]]))
C = np.asarray(np.bmat([[z, i], [i, z]]))
I = np.eye(2*len(H))
assert np.allclose(C.dot(C), I)
assert np.allclose(C.dot(A).dot(C), A.conj())
ws, uvs = sp.linalg.eig(np.linalg.inv(B).dot(A))
inds = np.argsort(abs(ws.real))
ws = ws[inds]
uvs = uvs[:, inds]
us, vs = uvs.reshape((2, len(H), 2*len(H)))
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
Cell In[9], line 3
1 import scipy.linalg
2 sp = scipy
----> 3 H = s.get_H()
4 n_0 = s.get_density().ravel()
5 psi_0 = 1*s[...].ravel()
6 A = np.bmat(
NameError: name 's' is not defined
ws[:10], s.ws[0]
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
Cell In[10], line 1
----> 1 ws[:10], s.ws[0]
NameError: name 'ws' is not defined
s.cooling_phase = 1.0
s.pre_evolve_hook()
s.cooling_phase = 1.0
s.t = 0.0
mode = 4
d = 0.001
u_, v_ = us[:, mode], vs[:, mode]
s[...] = psi_0 + d*(u_ + v_.conj())
w = ws[mode].real
T = 2*np.pi / w
dt = T/100/100
e = EvolverSplit(s, dt=dt, normalize=False)
log = False
x = s.xyz[0]
with NoInterrupt(ignore=True) as interrupted:
while not interrupted:
e.evolve(100)
plt.clf()
#e.y.plot(log=log)
t = e.y.t
psi = psi_0 + d*(u_*np.exp(1j*w*t) + v_.conj()*np.exp(-1j*w*t))
plt.plot(x, abs(e.y[...])**2 - abs(psi_0)**2)
plt.plot(x, abs(psi)**2 - abs(psi_0)**2)
#plt.ylim(0, 2)
plt.xlim(-6, 6)
plt.title("N = {}".format(e.y.get_N()))
display(plt.gcf())
clear_output(wait=True)
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
Cell In[11], line 1
----> 1 s.cooling_phase = 1.0
2 s.pre_evolve_hook()
3 s.cooling_phase = 1.0
4 s.t = 0.0
NameError: name 's' is not defined
np.allclose(np.linalg.inv(B).dot(A).dot(uvs), ws[None,:]*uvs)
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
Cell In[12], line 1
----> 1 np.allclose(np.linalg.inv(B).dot(A).dot(uvs), ws[None,:]*uvs)
NameError: name 'uvs' is not defined
Hydrodynamics#
Consider the following GPE-like theory
Now apply the Madelung transform \(\psi = \sqrt{n}e^{\I\phi}\). We have the following derivatives (similarly with spatial derivatives):
Consider first \(\eta=0\). Collecting the imaginary and real parts, we have
Introducing the velocity \(\vect{v} = \hbar \vect{\nabla}\phi / m\) and current \(\vect{j} = n\vect{v}\), we have the traditional conservation of particle number and Euler equations:
One typically takes the gradient of the last equation (divided by \(m\)) to obtain:
Convective Derivative
We have one complication here – the typical convective derivative is:
but the second term is not generally equivalent to \(\vect{\nabla}v^2/2\). Specifically, in index form, we have
This correction, however, vanishes for potential flow \(v \propto \vect{\nabla}\phi\) since the divergence of a curl vanishes. With indices, this is obvious:
Summarizing, we have
where