-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathplot_eigenvector.py
More file actions
50 lines (40 loc) · 1.41 KB
/
Copy pathplot_eigenvector.py
File metadata and controls
50 lines (40 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Plots the eigenvector of the leading eigenvalue vs. fermionic Matsubara frequency for each
# cluster (DCA) or tp-host (DCA+) momentum.
#
# Usage: python plot_eigenvector.py <analysis-HDF5-output-file>
#
# Author: Urs R. Haehner (haehneru@itp.phys.ethz.ch)
from matplotlib import pyplot as plt
import h5py
import os
import sys
# Get the filename from the command line.
filename = sys.argv[1]
# Open the file.
data = h5py.File(filename,'r')
# Fermionic Matsubara frequency mesh
wn = data['domains/vertex-frequency-domain (COMPACT)/elements'] [:]
# print(wn)
# Eigenvector momentum grid
k = data['domains/LATTICE_TP/MOMENTUM_SPACE/elements/data'][:]
# print(k)
# Eigenvectors of leading eigenvalues
# shape: [wn, k, b2, b1, ev_index, real/imag],
# where ev_index labels the eigenvectors of the 10 leading eigenvalues.
# ev_index = 0 corresponds to the largest eigenvalue.
eigenvecs = data['analysis-functions/leading-eigenvectors/data'][:]
# print(eigenvecs.shape)
# Parameters for plot
# Band and eigenvalue indices
b1 = 0
b2 = 0
ev_index = 0
plt.figure()
for k_ind, k_vec in enumerate(k):
# Plot real part.
plt.plot(wn, eigenvecs[:, k_ind, b2, b1, ev_index, 0], 'o-', ms=2,
label=r'$\mathbf{K}$'+'=('+'{0:.3g}'.format(k_vec[0])+', '+'{0:.3g}'.format(k_vec[1])+')')
plt.legend(loc='best')
plt.xlabel('$\omega_n$')
plt.ylabel(r'$\phi(\mathbf{K}, \omega_n)$')
plt.savefig('leading_eigenvector.pdf')