| ... | @@ -15,6 +15,8 @@ cp -r $WSLDA/td-project-template ./td-jj-example |
... | @@ -15,6 +15,8 @@ cp -r $WSLDA/td-project-template ./td-jj-example |
|
|
```
|
|
```
|
|
|
|
|
|
|
|
# Step 2: Editing files for the static calculations
|
|
# Step 2: Editing files for the static calculations
|
|
|
|
All edits should be done in the working folder `st-jj-example`.
|
|
|
|
|
|
|
## Edit [predefines.h](./example-jj/st/predefines.h)
|
|
## Edit [predefines.h](./example-jj/st/predefines.h)
|
|
|
Select the lattice size and functional, and inspect all other tags that can be relevant for your problem:
|
|
Select the lattice size and functional, and inspect all other tags that can be relevant for your problem:
|
|
|
```c
|
|
```c
|
| ... | @@ -74,7 +76,7 @@ void process_params(double *params, double *kF, double *mu, size_t extra_data_si |
... | @@ -74,7 +76,7 @@ void process_params(double *params, double *kF, double *mu, size_t extra_data_si |
|
|
```
|
|
```
|
|
|
|
|
|
|
|
## Edit [logger.h](./example-jj/st/logger.h)
|
|
## Edit [logger.h](./example-jj/st/logger.h)
|
|
|
In this file user can customize the output. In this example, we use the default form of logger.
|
|
In this file user can customize the output. In this example, we use the default logger form.
|
|
|
|
|
|
|
|
## Edit [input.txt](./example-jj/st/input.txt)
|
|
## Edit [input.txt](./example-jj/st/input.txt)
|
|
|
The input file provides run-time parameters. The most important in this case are the parameters that define the potential
|
|
The input file provides run-time parameters. The most important in this case are the parameters that define the potential
|
| ... | @@ -139,4 +141,107 @@ mpirun -np 4 ./st-wslda-1d input.txt |
... | @@ -139,4 +141,107 @@ mpirun -np 4 ./st-wslda-1d input.txt |
|
|
...
|
|
...
|
|
|
# EXTRA SAVING ITERATION DONE.
|
|
# EXTRA SAVING ITERATION DONE.
|
|
|
```
|
|
```
|
|
|
See [here](./example-jj/st/jj-r1.stdout) for full stdout. |
|
See [here](./example-jj/st/jj-r1.stdout) for full stdout. The file produced by the logger is [here](./example-jj/st/jj-r1.wlog).
|
|
|
|
|
|
|
|
# Step 4: Analyzing the results of the static run
|
|
|
|
As a simple example, we will plot the density profile and compute the population imbalance, defined as $`z=(N_L-N_R)/(N_L+N_R)`$, where $`N_L`$ and $`N_R`$ are particle numbers in left and right reservoirs, using Python
|
|
|
|
```python
|
|
|
|
import numpy as np
|
|
|
|
import matplotlib.pyplot as plt
|
|
|
|
# to get wdata lib use: pip install wdata
|
|
|
|
from wdata.io import WData, Var
|
|
|
|
|
|
|
|
# Load data
|
|
|
|
data = WData.load("./st-jj-example/jj-r1.wtxt")
|
|
|
|
x=data.xyz[0]
|
|
|
|
rho=data.rho_a[-1,:]+data.rho_b[-1,:] # take last iteration
|
|
|
|
# compute initial population imbalance
|
|
|
|
NL = np.sum(rho[x<0])
|
|
|
|
NR = np.sum(rho[x>0])
|
|
|
|
z=(NL-NR)/(NL+NR) # initial population imbalance
|
|
|
|
print(z)
|
|
|
|
|
|
|
|
# Plot rho(x)
|
|
|
|
plt.plot(x,rho)
|
|
|
|
plt.show()
|
|
|
|
```
|
|
|
|
The result is
|
|
|
|

|
|
|
|
For a more advanced script for plotting static results, see [Zenodo](https://zenodo.org/records/18404682).
|
|
|
|
|
|
|
|
# Step 5: Editing files for the time-dependent calculations
|
|
|
|
All edits should be done in the working folder `td-jj-example`.
|
|
|
|
The workflow is analogous to that for static calculations. Many of the functions can be copied & pasted from static files.
|
|
|
|
|
|
|
|
## Edit [predefines.h](./example-jj/td/predefines.h)
|
|
|
|
Set compilation flags to be compatible with your problem and with data produced by static calcs.
|
|
|
|
|
|
|
|
## Edit [problem-definition.h](./example-jj/td/problem-definition.h)
|
|
|
|
Edit the function that defines the external potential. You can also add time dependence to your external potential function if you wish.
|
|
|
|
|
|
|
|
## Edit [logger.h](./example-jj/td/logger.h)
|
|
|
|
In this file user can customize the output. In this example, we use the default logger form.
|
|
|
|
|
|
|
|
## Edit [input.txt](./example-jj/td/input.txt)
|
|
|
|
In the input file, the key parameters for this example are:
|
|
|
|
```bash
|
|
|
|
# -------------- USER DEFINED PARAMETERS --------------
|
|
|
|
# ...
|
|
|
|
params[6] = 0.0 # no tilt
|
|
|
|
# ...
|
|
|
|
# ------------------- INITIALIZATION ------------------
|
|
|
|
inittype 1 # start from st-wslda-1d solution,
|
|
|
|
# inprefix points to data from static calculations
|
|
|
|
# ...
|
|
|
|
# ------------------- INPUT/OUTPUT ------------------
|
|
|
|
outprefix jj-r2 # all output files will start with this prefix
|
|
|
|
inprefix ../st-jj-example/jj-r1 # prefix of static result
|
|
|
|
# variables to write
|
|
|
|
writevar rho delta j V_ext
|
|
|
|
sclgth -10000.0 # scattering length in units of lattice spacing
|
|
|
|
# ...
|
|
|
|
# ------------------- TIME EVOLUTION ----------------
|
|
|
|
dt 0.0035 # integration time step, in units of eF^-1
|
|
|
|
measurements 200 # number of requested measurements
|
|
|
|
timesteps 1430 # number of time steps between each measurement
|
|
|
|
# measurements are written with time resolution: timesteps*dt
|
|
|
|
# the total trajectory length is: measurements*timesteps*dt
|
|
|
|
selfstart 1 # use Taylor expansion for first 5 steps?
|
|
|
|
# ...
|
|
|
|
```
|
|
|
|
|
|
|
|
# Step 6: Compiling and running the time-dependent code
|
|
|
|
We do this part in an analogous way to the case of static calculations. Note that the time-dependent run requires GPUs to run.
|
|
|
|
|
|
|
|
To generate the binary for a quasi-1D simulation, execute the command:
|
|
|
|
```bash
|
|
|
|
make 1d
|
|
|
|
```
|
|
|
|
If the compilation completes successfully, a binary named `td-wslda-1d` will be created.
|
|
|
|
This program should be executed within an MPI environment.
|
|
|
|
```bash
|
|
|
|
mpirun -np 1 ./td-wslda-1d input.txt
|
|
|
|
# START OF THE MAIN FUNCTION
|
|
|
|
# CODE: TD-WSLDA-1D
|
|
|
|
...
|
|
|
|
# REFERENCE VALUES: kF=1.000000, eF=0.500000, Effg=300.968458
|
|
|
|
time*eF Na Nb Na+Nb ETOT EKIN EPOT EPAIR ECURRENT EPOTEXT EPAIREXT EVELEXT rt
|
|
|
|
0.0000 501.61409628 501.61409628 1003.22819255 0.42101872 1.56019953 -0.38908978 -0.87549813 0.00000000 0.12540710 0.00000000 0.00000000
|
|
|
|
# SELFSTART: EXECUTING TAYLOR EXPANSION OF THE EVOLUTION OPERATOR.
|
|
|
|
# SELFSTART: DONE.
|
|
|
|
0.0000 501.61409627 501.61409627 1003.22819253 0.42104851 1.56019923 -0.38908978 -0.87546805 0.00000000 0.12540710 0.00000000 0.00000000
|
|
|
|
...
|
|
|
|
1001.0000 501.61409631 501.61409631 1003.22819262 0.42108490 1.55974541 -0.38904358 -0.87506952 0.00025957 0.12519302 0.00000000 0.00000000 118.64
|
|
|
|
# CHECKPOINT INFO: MODE=WRITE: DATA SIZE= 0.26 GB
|
|
|
|
# CHECKPOINT INFO: MPI_NP_PER_IO_GROUP=24.
|
|
|
|
# CHECKPOINT INFO: WRITE TIME= 1.74 sec
|
|
|
|
# CHECKPOINT INFO: WRITE SPEED= 0.148 GB/sec
|
|
|
|
# CREATING CHECK STAMP: `jj-r2_check.stamp`
|
|
|
|
```
|
|
|
|
See [here](./example-jj/td/jj-r2.stdout) for full stdout. The file produced by the logger is [here](./example-jj/td/jj-r2.wlog).
|
|
|
|
|
|
|
|
# Step 7: Analyzing the results of the time-dependent run
|
|
|
|
As an example of analysis, we will plot population imbalance and phase differnce accors the junction as a function of time, using simple python script
|
|
|
|
```python
|
|
|
|
# todo
|
|
|
|
``` |