This commit is contained in:
Jean-Sébastien Caux
2026-09-22 14:31:14 +02:00
commit e0cf0c388c
12 changed files with 1754 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
#! /usr/bin/env python
"""
Plot the t=0 density expectation value in Lieb-Liniger (n-hole wavepacket).
Setup:
- ensure matplotlib and numpy are installed in your python environment
- make this file executable (chmod +x plot_to.py)
Usage: ./plot_t0.py [rho file name]
"""
import math
import matplotlib.pyplot as plt
import numpy as np
import sys
filename = str(sys.argv[1])
x = np.loadtxt(filename.replace('.rhoxt','.x'), unpack=True)
rho = np.loadtxt(filename, usecols=(0), unpack=True)
plt.plot(x, rho, '.', markersize=4)
plt.xlabel('x')
plt.ylabel(r'$\rho(x, t=0)$')
plt.title('Density expectation value\n' + filename)
plt.savefig(filename.replace('.rhoxt', '.png'))
plt.show()