|
|
# Example 1: Time-dependent external potential
|
|
|
Target: find a time evolution of the unitary Fermi gas confined in a harmonic trap:
|
|
|
```math
|
|
|
V_{\textrm{ext}}(x,y,z,t) = \frac{m\omega_x^2 x^2}{2} + A(t)\frac{m\omega_y^2 y^2}{2}
|
|
|
```
|
|
|
where $`A(t)`$ is a function that smoothly rises from zero to one within a given time interval.
|
|
|
|
|
|
## Step 1: Find the static solution
|
|
|
The initial external potential is $`V_{\textrm{ext}}(x,y,z) = \frac{m\omega_x^2 x^2}{2}`$, and we can use 1d code.
|
|
|
|
|
|
Code: `st-wslda-1d`
|
|
|
|
|
|
Settings:
|
|
|
* [trap-1d_predefines.h](uploads/fa2a85fae8ae389f5856b11ab0d63ca5/trap-1d_predefines.h)
|
|
|
* [trap-1d_problem-definition.h](uploads/4dbed95bba4ab63fd9d109993b1da1dc/trap-1d_problem-definition.h)
|
|
|
* [trap-1d_logger.h](uploads/674dcdf9f8827ade7b0dcae0aafb124a/trap-1d_logger.h)
|
|
|
* [trap-1d_input.txt](uploads/a3660b6b3e7397ca478080818e56ab90/trap-1d_input.txt)
|
|
|
|
|
|
Output:
|
|
|
* [trap-1d.stdout](uploads/30ac8d3313e93f3554505a081f186cf1/trap-1d.stdout)
|
|
|
|
|
|
## Step 2: Execute time evolution
|
|
|
|
|
|
Code: `td-wslda-2d`
|
|
|
|
|
|
Settings:
|
|
|
* [trap-2d-alpha0.0_predefines.h](uploads/e3cf4756f7c5ef870d36dab31def1914/trap-2d-alpha0.0_predefines.h)
|
|
|
* [trap-2d-alpha0.0_problem-definition.h](uploads/59850de149fd98c21b8575d3a1514f30/trap-2d-alpha0.0_problem-definition.h)
|
|
|
* [trap-2d-alpha0.0_logger.h](uploads/0a334f058908f7f0ea0b1b1e15ee4d10/trap-2d-alpha0.0_logger.h)
|
|
|
* [trap-2d-alpha0.0_input.txt](uploads/9edac616780f9196c9ccf3253fedc6a9/trap-2d-alpha0.0_input.txt)
|
|
|
|
|
|
Output:
|
|
|
* [trap-2d-alpha0.0.stdout](uploads/3221116b30a9e6cb500544f943a4e5e1/trap-2d-alpha0.0.stdout)
|
|
|
* [trap-2d-alpha0.0.wlog](uploads/cc008e14db1172dd5e7c9df0b7c63472/trap-2d-alpha0.0.wlog)
|
|
|
|
|
|

|
|
|
|
|
|
Energy evolution:
|
|
|
```python
|
|
|
import numpy as np
|
|
|
import matplotlib.pyplot as plt
|
|
|
|
|
|
data = np.loadtxt("/home/gabrielw/sshfs/lumi/scratch/quantum_friction/td-ho-gw/trap-2d-alpha0.0.wlog", usecols=(1,4,5))
|
|
|
|
|
|
fig, ax = plt.subplots()
|
|
|
ax.plot(data[:,0], data[:,2], color='red', label=r'energy', lw=3.0)
|
|
|
ax.set(xlabel=r'$t\varepsilon_F$', ylabel=r'$E/E_{ffg}$')
|
|
|
ax2 = ax.twinx() # instantiate a second axes that shares the same x-axis
|
|
|
ax2.plot(data[:,0], data[:,1], color='blue', label=r'particle number', lw=2.0, ls="--") # plot last frame [-1]
|
|
|
ax2.set(ylabel=r'$N$')
|
|
|
fig.legend(loc="upper left", bbox_to_anchor=(0.3,0.3), bbox_transform=ax.transAxes)
|
|
|
fig.savefig("energy-conservation.png")
|
|
|
```
|
|
|
|
|
|
 |
|
|
\ No newline at end of file |