-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ModuleNotFoundError: No module named 'ase' #95
Comments
After several attempts, the following script works for the 3.3.1 version of Triqs: `import os import matplotlib.pyplot as plt from h5 import HDFArchive dmft_path = './Ca2N.h5' with HDFArchive(dmft_path, 'r') as h5: fig, ax = plt.subplots(dpi=150, figsize=(6,3)) ax.oplot(Sigma_imp_iw['up_0'].imag, '-o', c='C0', label='s') ax.set_ylabel(r"Im The self-energy seems very small and flat. Somehow I expected it to be larger and drop near the origin. Any thoughts on this would be appreciated. Vahid |
Hi Vahid, sry for the slow response. I was on vacation during the break. In fact the postprocessing routines of solid_dmft do require the module skimage, which you can simply install via pip:
https://pypi.org/project/scikit-image/ And for some part of the tutorial we also do require ASE, which you can also install via pip:
|
Regarding your question for the shape of the self-energy:
Let me know if you have any questions. Best, |
Following the instructions on solid_dmft/doc/tutorials/correlated_bandstructure
/plot_correlated_bands.ipynb for SVO, I prepared the following script to extract the Im(Sigma) versus energy from the .h5 file:
`# Import the modules:
from IPython.display import display
from IPython.display import Image
import numpy as np
import importlib, sys
import matplotlib.pyplot as plt
from matplotlib import cm
from timeit import default_timer as timer
from ase.io.espresso import read_espresso_in
from h5 import HDFArchive
from solid_dmft.postprocessing import plot_correlated_bands as pcb
freq_mesh_kslice = {'window': [-0.5, 0.5], 'n_w': int(1e6)}
freq_mesh_bands = {'window': [-5, 5], 'n_w': int(1e3)}
freq_mesh = freq_mesh_kslice if kslice else freq_mesh_bands
dmft_path = './Ca2N.h5'
proj_on_orb = orbital_order_to.index(proj_on_orb) if proj_on_orb else None
sigma_dict = {'dmft_path': dmft_path, 'it': 'last_iter', 'orbital_order_dmft': orbital_order_to, 'spin': 'up',
'block': 0, 'eta': 0.0, 'w_mesh': freq_mesh, 'linearize': False, 'proj_on_orb' : proj_on_orb}
with HDFArchive(dmft_path, 'r') as h5:
sigma_freq = h5['DMFT_results']['last_iter']['Sigma_freq_0']
fig, ax = plt.subplots(1, 2, figsize=(10,2), squeeze=False, dpi=200)
orb = 0
sp = 'up_0'
freq_mesh = np.array([w.value for w in sigma_freq[sp][orb,orb].mesh])
ax[0,0].plot(freq_mesh, sigma_freq[sp][orb,orb].data.real)
ax[0,1].plot(freq_mesh, -sigma_freq[sp][orb,orb].data.imag)
ax[0,0].set_ylabel(r'Re$\Sigma(\omega)$')
ax[0,1].set_ylabel(r'Im$\Sigma(\omega)$')
for ct in range(2):
ax[0,ct].grid()
ax[0,ct].set_xlim(-2, 2)
ax[0,ct].set_xlabel(r'$\omega$ (eV)')`
I get the following error:
from ase.io.espresso import read_espresso_in ModuleNotFoundError: No module named 'ase'
Maybe the tutorial is for a different version of the code. My dmft_config.toml file is
`[general]
seedname = "Ca2N"
jobname = "triqs"
csc = true
eta = 0.5
n_iw = 1025
n_tau = 10001
n_iter_dmft_first = 2
n_iter_dmft_per = 1
n_iter_dmft = 10
block_threshold = 1e-05
h_int_type = "kanamori"
U = 2.5
J = 0.0
beta = 60
prec_mu = 0.0001
sigma_mix = 1.0
g0_mix = 1.0
dc_type = 0
dc = true
dc_dmft = true
calc_energies = true
h5_save_freq = 1
store_solver = false
enforce_off_diag = false
h_int_basis = "qe"
[solver]
type = "hubbardI"
n_l = 15
measure_G_l = false
measure_density_matrix = true
[dft]
dft_code = "qe"
n_cores = 64
mpi_env = "openmpi"
projector_type = "w90"
dft_exec = "pw.x"
w90_tolerance = 1e-2`
The iterations finish successfully.
If I remove "from ase.io.espresso import read_espresso_in" from the script, I get the following error:
File "/gpfs/scratch/vaskarpo/DMFT/new/test.py", line 17, in <module> import solid_dmft.postprocessing.plot_correlated_bands as pcb File "/cvmfs/soft.computecanada.ca/easybuild/software/2023/x86-64-v4/MPI/gcc12/openmpi4/triqs/3.3.1/lib/python3.11/site-packages/solid_dmft/postprocessing/plot_correlated_bands.py", line 46, in <module> import skimage.measure ModuleNotFoundError: No module named 'skimage'
Thank you,
Vahid
The text was updated successfully, but these errors were encountered: