nanotech-empa / cp2k-spm-tools

Scanning probe microscopy simulation tools based on CP2K
MIT License
13 stars 4 forks source link

How to plot the output file "overlap.npz"? #13

Closed TaoTaotheCreator closed 2 weeks ago

TaoTaotheCreator commented 2 weeks ago

Dear developers, I just compiled these codes on my computer and ran the examples in /benzene_overlap, and I got the output file overlap.npz. I want to get the image below (Nanoscale, 2021, 13, 1624–1628), but I do not know how to plot the.npz file. Could you please show me the way to get this kind of PDOS? Thank you! image

eimrek commented 2 weeks ago

hi @TaoTaotheCreator, thanks for the interest. The notebook https://github.com/nanotech-empa/cp2k-spm-tools/blob/master/overlap_viewer.ipynb should demonstrate a way to access and visualize the overlap.npz. Hope this helps! Closing for now, but feel free to re-open this issue if you run into problems or have other questions.

TaoTaotheCreator commented 2 weeks ago

Thanks! I have already got the overlap.npz running from the example benzene_overlap, and I tried to plot this outcome. The overlap_viewer.ipynb was converted to overlap_viewer.py, which was run in pycharm. However, the error came as below. Could you show me how to solve this? Thank you very much. D:\Anaconda3\python.exe F:/cp2k-spm-tools-master/overlap_viewer.py Traceback (most recent call last): File "F:\cp2k-spm-tools-master\overlap_viewer.py", line 74, in <module> for i_spin in range(len(d)): TypeError: object of type 'NoneType' has no len() inputfile.zip

TaoTaotheCreator commented 2 weeks ago

Besides, when I ran the run_overlap.sh for my own systems, the error came as below: Traceback (most recent call last): File "../../overlap_from_wfns.py", line 151, in <module> mol_grid_orb.read_cp2k_input(args.cp2k_input_file2) File "/public4/home/sc53074/cp2k/LZH/cp2k-spm-tools-master/cp2k_spm_tools/cp2k_grid_orbitals.py", line 159, in read_cp2k_input raise ValueError("Cell is not rectangular") ValueError: Cell is not rectangular Is there any requirement for the cell of slab and molecule model, respectively?

eimrek commented 1 week ago

Hi @TaoTaotheCreator. Sorry. the script do require modification for custom systems, but should give you an example to work with. Regarding the cell, unfortunately, yes, currently the library only supports rectangular cells.

TaoTaotheCreator commented 4 days ago

Okay, I plan to plot the PDOS using other approach. Thanks, eimrek!