Skip to content
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

BUG: Cannot read W POTCAR #1014

Closed
TDKOLI opened this issue Oct 11, 2024 · 8 comments
Closed

BUG: Cannot read W POTCAR #1014

TDKOLI opened this issue Oct 11, 2024 · 8 comments

Comments

@TDKOLI
Copy link

TDKOLI commented Oct 11, 2024

Hi,

I have encountered an issue that currently seems to be isolated to W POTCAR files. Here is the code I'm using:

from atomate2.vasp.jobs.mp import MPGGARelaxMaker
from pymatgen.core import Structure
from pymatgen.io.vasp import Poscar
from jobflow import run_locally

poscar = Poscar.from_file("/home/batch0poscar/POSCAR_3122")
structure = poscar.structure

relax_job = MPGGARelaxMaker().make(structure)

relax_job.update_metadata({"structure_index": f"3122_Al_GGAMP"})

run_locally(relax_job, root_dir="/home/atomate2/config/jobs/batch0GGA/job_3122", create_folders=True)

I have created several similar jobs, each using a different POSCAR file, and all of them work fine except the one that includes W (Tungsten). Interestingly, it works for W as well when I use RelaxMaker instead of MPGGARelaxMaker. My pseudopotential path is specified in ~/.config/.pmgrc.yaml as /home/VASP/MY_PSP. Under this directory, I have a POT_GGA_PAW_PBE folder as per the pymatgen documentation, and I also have the required .gz POTCAR files stored there. This setup works correctly for other elements, but when I attempt a calculation involving W, I encounter the following error:

start
Thu Oct 10 15:35:20 CEST 2024
2024-10-10 15:37:33,368 INFO Started executing jobs locally
2024-10-10 15:37:33,460 INFO Starting job - MP GGA relax (992b7f55-38a7-49bb-8653-e8ea99d3ce9a)
2024-10-10 15:37:33,875 INFO MP GGA relax failed with exception:
Traceback (most recent call last):
  File "/home/miniconda3/envs/mace/lib/python3.11/site-packages/jobflow/managers/local.py", line 114, in _run_job
    response = job.run(store=store)
               ^^^^^^^^^^^^^^^^^^^^
  File "/home/miniconda3/envs/mace/lib/python3.11/site-packages/jobflow/core/job.py", line 600, in run
    response = function(*self.function_args, **self.function_kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/miniconda3/envs/mace/lib/python3.11/site-packages/atomate2/vasp/jobs/base.py", line 218, in make
    write_vasp_input_set(
  File "/home/miniconda3/envs/mace/lib/python3.11/site-packages/atomate2/vasp/files.py", line 188, in write_vasp_input_set
    vis = input_set_generator.get_input_set(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/miniconda3/envs/mace/lib/python3.11/site-packages/atomate2/vasp/sets/base.py", line 459, in get_input_set
    potcar=self._get_potcar(structure, potcar_spec=potcar_spec),
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/miniconda3/envs/mace/lib/python3.11/site-packages/atomate2/vasp/sets/base.py", line 621, in _get_potcar
    potcar = Potcar(potcar_symbols, functional=self.potcar_functional)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/miniconda3/envs/mace/lib/python3.11/site-packages/pymatgen/io/vasp/inputs.py", line 2463, in __init__
    self.set_symbols(symbols, functional, sym_potcar_map)
  File "/home/miniconda3/envs/mace/lib/python3.11/site-packages/pymatgen/io/vasp/inputs.py", line 2565, in set_symbols
    self.extend(PotcarSingle.from_symbol_and_functional(el, functional) for el in symbols)
  File "/home/miniconda3/envs/mace/lib/python3.11/site-packages/pymatgen/io/vasp/inputs.py", line 2565, in <genexpr>
    self.extend(PotcarSingle.from_symbol_and_functional(el, functional) for el in symbols)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/miniconda3/envs/mace/lib/python3.11/site-packages/pymatgen/io/vasp/inputs.py", line 1877, in from_symbol_and_functional
    raise OSError(
OSError: You do not have the right POTCAR with functional='PBE' and symbol='W_pv' in your PMG_VASP_PSP_DIR='/home/VASP/MY_PSP/'. Paths tried: ['/home/VASP/MY_PSP/POT_GGA_PAW_PBE/POTCAR.W_pv', '/home/VASP/MY_PSP/POT_GGA_PAW_PBE/W_pv/POTCAR']

2024-10-10 15:37:33,875 INFO Finished executing jobs locally
done

The content of the POTCAR for W appears normal and matches the format of other POTCARs that work correctly. Here are the relevant details:

TITEL  = PAW_PBE W 08Apr2002
LULTRA =        F    use ultrasoft PP ?
SHA256 =  c0897285f1b301314dcc12eb838ce8a777aa860795754598b0626cb818170117 W/POTCAR
COPYR  = (c) Copyright 08Apr2002 Georg Kresse
...

It appears that the POTCAR file for W is not being correctly identified, even though it is in the correct directory and has the appropriate content. The error specifically mentions 'W_pv' not being found.
I think maybe this could be an issue within Atomate2 since it works normally when I use RelaxMaker.

Many thanks in advance!

@Andrew-S-Rosen
Copy link
Member

Andrew-S-Rosen commented Oct 19, 2024

MPGGARelaxMaker is meant to reproduce Materials Project settings, and the MP GGA calculations use an older version of the pseudopotentials where W_pv did not exist. I would double-check that you are using compatible pseudopotentials if you wish to reproduce MP calculations.

@hongyi-zhao
Copy link
Contributor

hongyi-zhao commented Nov 4, 2024

@Andrew-S-Rosen Thank you for pointing this out. Recently, I have successfully replicated the elastic constants results reported by the Materials Project, relying entirely on its original data, as demonstrated here.

But based on your above comments, for my purpose above, it seems that I should have used the following two makers as the bulk_relax_maker and elastic_relax_maker of ElasticMaker correspondingly:

In [1]: from atomate2.vasp.flows.mp import MPGGADoubleRelaxMaker, MPGGAStaticMaker

@hongyi-zhao
Copy link
Contributor

hongyi-zhao commented Nov 5, 2024

@Andrew-S-Rosen

MPGGARelaxMaker is meant to reproduce Materials Project settings, and the MP GGA calculations use an older version of the pseudopotentials where W_pv did not exist. I would double-check that you are using compatible pseudopotentials if you wish to reproduce MP calculations.

Yes, I confirmed this, as shown below:

werner@x13dai-t:~/Public/repo/github.com/materialsproject/pymatgen.git$ ls ~/Public/hpc/vasp/pot/pmg_potcar/POT_PAW_PBE_64/POTCAR.W*
/home/werner/Public/hpc/vasp/pot/pmg_potcar/POT_PAW_PBE_64/POTCAR.W.gz
/home/werner/Public/hpc/vasp/pot/pmg_potcar/POT_PAW_PBE_64/POTCAR.W_sv_GW.gz
/home/werner/Public/hpc/vasp/pot/pmg_potcar/POT_PAW_PBE_64/POTCAR.W_sv.gz
werner@x13dai-t:~/Public/repo/github.com/materialsproject/pymatgen.git$ ug W_pv -g '*.yaml'
src/pymatgen/io/vasp/MITRelaxSet.yaml:    symbol: W_pv
src/pymatgen/io/vasp/MVLRelax52Set.yaml:  W: W_pv
src/pymatgen/io/vasp/MPHSERelaxSet.yaml:  W: W_pv
src/pymatgen/io/vasp/MPRelaxSet.yaml:  W: W_pv
src/pymatgen/io/vasp/MPAbsorptionSet.yaml:  W: W_pv

@TDKOLI
Copy link
Author

TDKOLI commented Nov 5, 2024

@hongyi-zhao @Andrew-S-Rosen Hi, I solved this issue, if I use W_sv, I should use MP Meta GGA, which is compatible with MP R2SCAN data, and indeed I have no W_pv before, after I add W_pv, then use MPGGA is worked well.

@hongyi-zhao
Copy link
Contributor

hongyi-zhao commented Nov 5, 2024

As @Andrew-S-Rosen pointed out, W_pv is a discarded pseudopotential by vasp team. For confirmation, you can find it at https://www.vasp.at/wiki/index.php/Available_pseudopotentials#potpaw.64_(latest,_recommended).

@TDKOLI
Copy link
Author

TDKOLI commented Nov 5, 2024

@hongyi-zhao Yes, it depends on which data we want to use, if we require MP GGA data, then we should use W_pv, which is outdated, but it is compatible with MP GGA data, and if we require MP R2SCAN data to construct phase diagram, we should use W_sv to calculate our own materials, W_sv is in VASP available_pseudo in potpaw.54, also this is shown in the MPSCANRelaxSet.yaml. But there is also another way that we can use MaterialsProjectDFTMixingScheme().process_entries, to mix the data from 2 functionals. For example, use W_sv and MPMetaGGARelaxMaker for any structure contains W(in potpaw.54), and for other elements that pseudo not change, we can use GGA data from MP and use MPGGARelaxMaker to do the calculations. Then use MPDFTMixingScheme to construct the phase diagram that all data are compatible.

@hongyi-zhao
Copy link
Contributor

hongyi-zhao commented Nov 5, 2024

To use W_pv, you should have the potpaw.52 located at the correct place on your machine as indicated here: https://github.com/materialsproject/pymatgen/blob/bd9fba9ec62437b5b62fbd0b2c2c723216cc5a2c/src/pymatgen/io/vasp/inputs.py#L1889-L1906.

@TDKOLI
Copy link
Author

TDKOLI commented Nov 6, 2024

Yes, I have it, thank you. I have solved this issue.

@TDKOLI TDKOLI closed this as completed Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants