bmourino / cof_photocatalysis

2 stars 1 forks source link

Ask help for running the cof_photocatalysis #5

Open mahuahuahua opened 1 year ago

mahuahuahua commented 1 year ago

Hello, I follow the README.MD file, after entering the command : verdi run run_photocat_builder_std.py the workchain complete the energy, GEO_OPT and CELL_OPT tasks. But, it comes up with the error:

File "../aiida_lsmo/utils/cp2k_utils.py", line 12, in get_kinds_info " symbols = sorted(set(atoms.get_chemical_symbols())) AttributeError:'StructureData' object has no attribute 'get_chemical_symbols'

Would you please help me solve the problem?

bmourino commented 1 year ago

Hi! you can try to copy the file cp2k_utils_master.py to "aiida_lsmo/utils/" and then on bandstructure.py change:

from aiida_lsmo.utils.cp2k_utils import (get_multiplicity_section, get_kinds_section)

to

from aiida_lsmo.utils.cp2k_utils_master import (get_input_multiplicity, get_kinds_section)

Let me know if it does not work.

bmourino commented 1 year ago

p.s.: if you haven't done so yet, you can enable cache to avoid having to run all your calculations again when you face issues like this

mahuahuahua commented 1 year ago

Hi, I modified the script accordingly, but I still get the error that nothing is calculated.

TypeError: get_kinds_section() got an unexpected keyword argument 'atoms'

bmourino commented 1 year ago

in which stage? still band structure calculation? can you provide more info on the error?

mahuahuahua commented 1 year ago

Hi,I use the command : verdi run run_photocat_builder_std.py the calcution is failed at the inital stage. following is the detailed error message

File "../aiida_lsmo/workchains/cp2k_multistage.py", line 38, in get_initial_magnetization return apply_initial_magnetization(structure, protocol, with_ghost_atoms=with_ghost_atoms)

File "../aiida_lsmo/workchains/cp2k_multistage.py", line 68, in apply_initial_magnetization cp2k_param = get_kinds_section(atoms=atoms, protocol=protocol_dict, with_ghost_atoms=bool(with_ghost_atoms))

TypeError: get_kinds_section() got an unexpected keyword argument 'atoms'

In the new cp2k_utils_master.py file, several definitions are changed, the cp2k_multistage.py seems need corresponding modification.

bmourino commented 1 year ago

I can think of two things that might have happened:

  1. you replaced cp2k_utils.py with cp2k_utils_master.py in aiida_lsmo/utils - you should keep both instead, make sure you have both
  2. you added that line from aiida_lsmo.utils.cp2k_utils_master import (get_input_multiplicity, get_kinds_section) in cp2k_photocat.py or cp2k_multistage.py - in that case, change it back to from aiida_lsmo.utils.cp2k_utils import (get_multiplicity_section, get_kinds_section), you're only supposed to make changes on the band_structure.py file

let me know if it still does not work.

And thanks for bringing it up, I will make some changes in the workchain so that in the future this is not an issue anymore.

mahuahuahua commented 1 year ago

I appreciate that you share the code and answer my questions timely. Thank you. It is an excellent code.

bmourino commented 1 year ago

I made some minor changes in the repo with the last commit to address this, let me know if it still does not work

mahuahuahua commented 1 year ago

Hi!I have completed the calculation using this command:verdi run run_photocat_builder_std.py I appreciate your timely reminder for the modification. Thank you! However, when I execute these two commands, neither errors nor file generation occurs: "run_electron_injection","run_hole_injection" I've made modifications to these two areas: 'group_label' and 'cp2k_code'. What other changes should I make?

Next,I used the the ipynb file in "scripts_descriptors" in jupyter 1、"band_alignment.ipynb" from macrodensity.cp2k_tools_maria import read_cube_density ModuleNotFoundError: "No module named 'macrodensity.cp2k_tools_maria" I have installed the MacroDensity plugin, but I am unable to locate the cp2k_tools_maria template.

2、"bsdos.ipynb" Cp2kOPtPlusUWorkChain = WorkflowFactory('photocat_workchains.cp2k_opt_plusu') ModuleNotFoundError: No module named 'photocat_workchains.cp2k_opt_plusu' It appears that the "cp2k_opt_plusu" module is not present in the "photocat_workchains". Could you please provide me with more information on this template

bmourino commented 1 year ago

I have addressed everything in the respective files. To get the descriptors, you can do it however you want - for example, for overlap instead of using my script you can also use this tool. As for the scripts here, I plan to organize them and clean them in the future (open issue #1), but in the meantime, if you run into further issues let me know and I can try to address them first!

mahuahuahua commented 1 year ago

Hi! I created a new group_label_h and encountered the following error,

"aiida.common.exceptions.MultipleObjectsError: multiple Node entries found with LABEL<2016aN2_ddec.cif>" How should I proceed with the modification?

When running 'run_photocat_builder_std', I removed the '#' from the following code and defined group_label. Will this affect the next step of the operation?

group_label = '***'

wc_group = load_group(group_label)

wc_group.add_nodes(wc)

And l didn't enable caching when exploring running commands earlier, and I generated many duplicate files. Could this also be a contributing factor?

bmourino commented 1 year ago

Hi! you can find the duplicates with the Jupyter notebook I just added. Then you can delete them and keep one where the calculation finished (you can check this with verdi node tree). Hope this helps

mahuahuahua commented 1 year ago

Hi! Thanks to your assistance, I've successfully carried out the optimization, band structure calculation, as well as electron and hole injection processes.Moreover, during the post-processing of the results using the Jupyter notebooks you provided, I was able to determine effective masses and spatial_overlap. I greatly appreciate your help.

For band alignment, I still use the script you provided. I have installed macrodensity plugin(only four submodule:"beta_tools","density_tools","plotting_tools","vasp_tools") and I didn't find the cart2frac submodule, I defined the cart2frac submodule according to "from macrodensity.cart2frac import get_fractional_to_cartesian_matrix"

I have some problem in the band_alignment.ipynb" "import macrodensity as md vector_a,vector_b,vector_c,av,bv,cv = md.matrix_2_abc(Lattice) grid_pot = md.density_grid_cube(pot,NGX,NGY,NGZ) cube_potential, cube_var = md.cube_potential(cube_origin,travelled,cube,grid_pot,NGX,NGY,NGZ)" error:module 'macrodensity' has no attribute 'density_grid_cube'and 'cube_potential'

I made some changes "from photocat_workchains.utility.cp2k_tools_maria import density_grid_cube grid_pot = density_grid_cube(pot,NGX,NGY,NGZ) cube_potential, cube_var = md.density_tools.volume_average(cube_origin,travelled,cube,grid_pot,NGX,NGY,NGZ)" new error:only size-1 arrays can be converted to Python scalars

I'm struggling with my modification. Would you mind providing me with more assistance?

bmourino commented 1 year ago

Hi! for the band alignment it might be helpful to check here. it uses the same tools so you should also find the missing files there