zerothi / sisl

Electronic structure Python package for post analysis and large scale tight-binding DFT/NEGF calculations
https://zerothi.github.io/sisl
Mozilla Public License 2.0
201 stars 60 forks source link

<< object has no attribute 'COOP' >> #405

Closed icamps closed 2 years ago

icamps commented 3 years ago

I would like to start saying that I'm completely new to SISL.

I run some calculations with SIESTA using the input parameters below:

WriteKbands             T
WriteBands              T
WriteCoorXmol       T
WriteMDXmol             T
WriteCoorStep           T
WriteKpoints            T
WriteCoorCerius     T
WriteHS                 T
WriteForces             T
WriteMullikenPop    1
SaveHS          T
XML.Write               T

# -- WAVEFUNCTIONS-OF-BANDS --
WFS.Write.For.Bands     T
COOP.Write              T
WriteEigenvalues        T
WriteKbands             T
WriteBands              T
WriteWaveFunctions      T

Now, I want to plot the wavefunctions around the Fermi energy (something like HOMO/LUMO). It was suggested in the MatterModeling.SE forum to use the following code for reading wavefunction coefficients and coop analysis:

import numpy as np
import sisl
H = sisl.get_sile("RUN.fdf").read_hamiltonian()
wfsx = sisl.get_sile("*.fullBZ.WFSX", parent=H)

E = np.linspace(-2, 2, 201)
for es in wfsx.yield_eigenstate():
    print(es.info["k"])
    print(es.COOP(E))

After doing that, I 'm getting the error message:

[0. 0. 0.]
Traceback (most recent call last):
  File "del.py", line 9, in <module>
    print(es.COOP(E))
AttributeError: 'EigenstateElectron' object has no attribute 'COOP'

Any help is welcome!

=============================== UPDATE: Version details Run the below code and add to issue (if an issue is relevant for the issue):

print(sys.version): 3.8.12 | packaged by conda-forge | (default, Oct 12 2021, 21:59:51)  [GCC 9.4.0]
print(sisl.__version__): 0.11.0
print(sisl.__git_revision__): ad878e687045793c53d0c628c5345832beb60695
zerothi commented 3 years ago

Hi and welcome!

I have added this COOP in a later revision, sorry I had completely forgotten about this.

For now, could you try and do this:

pip3 install -U git+https://github.com/zerothi/sisl.git

and see if it works? Possibly you need to do: conda remove sisl prior. I am not sure about this.

icamps commented 3 years ago

I did the update, as recommended.

After running for 1 hour, the only information displayed is [0. 0. 0.].

zerothi commented 2 years ago

It is a little difficult to see what you are seeing, but there must be something related to the big files. Could you show the directory you run this in + the script it self.

Perhaps this tutorial: https://zerothi.github.io/sisl/tutorials/tutorial_siesta_2.html may be of assistance. At the end of that tutorial you'll see how to generate the wavefunction for some arbitrary grid. In this case it is a bit more tricky since you first need to find the Fermi-level.

zerothi commented 2 years ago

I think this will be solved implicitly with the new release. I will close this as it seems resolved in a dev commit, @icamps please comment in case you still have problems and we'll reopen.