Generating inputs and correct usage of pymatgen

442 views
Skip to first unread message

Alfred Koroma

unread,
Jun 25, 2020, 9:40:09 PM6/25/20
to PyCDT forum
Dear PyCDT developers,

I am trying to setup PyCDT. I am getting the following warning and no structures are generated:

pycdt generate_input -s POSCAR
/home/561/ak106/miniconda3/envs/py37/lib/python3.7/site-packages/pycdt-2.0.4-py3.7.egg/pycdt/core/defects_analyzer.py:91: DeprecationWarning: Replaced PyCDT usage of ComputedDefect objects with DefectEntry objects from pymatgen.analysis.defects.core
Will remove ComputedDefect with Version 2.5 of PyCDT.
  DeprecationWarning)
/home/561/ak106/miniconda3/envs/py37/lib/python3.7/site-packages/pycdt-2.0.4-py3.7.egg/pycdt/core/defects_analyzer.py:165: DeprecationWarning: Replaced PyCDT usage of DefectsAnalyzer objects with DefectPhaseDiagram objects from pymatgen.analysis.defects.thermodynamics
Will remove DefectsAnalyzer with Version 2.5 of PyCDT.
  DeprecationWarning)
/home/561/ak106/miniconda3/envs/py37/lib/python3.7/site-packages/pymatgen/io/vasp/sets.py:422: DeprecationWarning: 'potcar_functional' argument is deprecated. Use 'user_potcar_functional' instead.
  DeprecationWarning,
PyCDT is a script that generates vasp input files, parses vasp output files, and computes the formation energy of charged defects.

This script works based on several sub-commands with their own options. To see the options for sub-commands, type: pycdt -h

I have seen other users complain about this but the solution is not clear. I have set up my MP API and my potcars as described on the PyCDT webpage.

The other problem for me is that I have no real experience with pymatgen. The examples given with PyCDT relies heavily on pymatgen. But it is not clear how the output is generated. Everything is run and displayed in the notebook. For example, if I try:

from pymatgen.analysis.defects.generators import VacancyGenerator, SubstitutionGenerator, \
                                                VoronoiInterstitialGenerator
print('Vacancy Generator:')
for vac_defect in VacancyGenerator( bulk_structure):
    print("\tCreated Defect {} at site {}".format( vac_defect.name, vac_defect.site))

Nothing is generated in the directory where I am running my notebook. Is there a way to fix that?

One final thing, suppose I have set up my calculations manually. How can I set up the routines to apply defect corrections? In particular I am interested in the band filling correction, but that does not seem to be implemented in PyCDT, so I will have to rely once more on pymatgen.

Apologies for the many questions...

Regards,
Alfred


Shivani Srivastava

unread,
Jun 26, 2020, 8:59:26 AM6/26/20
to Alfred Koroma, PyCDT forum
Hi Alfred,

Please see below ...

On Thu, Jun 25, 2020 at 6:40 PM Alfred Koroma <alfred.k...@gmail.com> wrote:
Dear PyCDT developers,

I am trying to setup PyCDT. I am getting the following warning and no structures are generated:

pycdt generate_input -s POSCAR
/home/561/ak106/miniconda3/envs/py37/lib/python3.7/site-packages/pycdt-2.0.4-py3.7.egg/pycdt/core/defects_analyzer.py:91: DeprecationWarning: Replaced PyCDT usage of ComputedDefect objects with DefectEntry objects from pymatgen.analysis.defects.core
Will remove ComputedDefect with Version 2.5 of PyCDT.
  DeprecationWarning)
/home/561/ak106/miniconda3/envs/py37/lib/python3.7/site-packages/pycdt-2.0.4-py3.7.egg/pycdt/core/defects_analyzer.py:165: DeprecationWarning: Replaced PyCDT usage of DefectsAnalyzer objects with DefectPhaseDiagram objects from pymatgen.analysis.defects.thermodynamics
Will remove DefectsAnalyzer with Version 2.5 of PyCDT.
  DeprecationWarning)
/home/561/ak106/miniconda3/envs/py37/lib/python3.7/site-packages/pymatgen/io/vasp/sets.py:422: DeprecationWarning: 'potcar_functional' argument is deprecated. Use 'user_potcar_functional' instead.
  DeprecationWarning,
PyCDT is a script that generates vasp input files, parses vasp output files, and computes the formation energy of charged defects.

This script works based on several sub-commands with their own options. To see the options for sub-commands, type: pycdt -h

I have seen other users complain about this but the solution is not clear. I have set up my MP API and my potcars as described on the PyCDT webpage.

Can you share the pmgrc.yaml file generated? Are other pmg commands working?


The other problem for me is that I have no real experience with pymatgen. The examples given with PyCDT relies heavily on pymatgen. But it is not clear how the output is generated. Everything is run and displayed in the notebook. For example, if I try:

from pymatgen.analysis.defects.generators import VacancyGenerator, SubstitutionGenerator, \
                                                VoronoiInterstitialGenerator
print('Vacancy Generator:')
for vac_defect in VacancyGenerator( bulk_structure):
    print("\tCreated Defect {} at site {}".format( vac_defect.name, vac_defect.site))

Nothing is generated in the directory where I am running my notebook. Is there a way to fix that?

Are you trying to generate the directories in the same format as PyCDT? The code above will just create Vacancy objects in the notebook but won't create any VASP input files. For that pymatgen has separate functions to create VASP inputs based on structure and type of run. You can look at the input sets here


One final thing, suppose I have set up my calculations manually. How can I set up the routines to apply defect corrections? In particular I am interested in the band filling correction, but that does not seem to be implemented in PyCDT, so I will have to rely once more on pymatgen.
 
For using the correction scheme in pymatgen, you would need to create a DefectEntry object with relevant parameters for bandfilling correction and then just use that as an input to the BandFillingCorrection function. Something like:

from pymatgen.analysis.defects.corrections import BandFillingCorrection
bfc = BandFillingCorrection()
bfc.get_correction( dentry).   

Here dentry is a defect entry object (described here) with relevant parameters for bandfilling corrections like kpoint weights and eigenvalues (as described in the description of BandFillingCorrection in pymatgen.analysis.defects.corrections
For more information on parsing individual defect calculation from PyCDT, you might want to look at SingleDefectParser class here

Apologies for the many questions...
No worries! Let us know if this works.

Regards,
Alfred


--
You received this message because you are subscribed to the Google Groups "PyCDT forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pycdt-forum...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pycdt-forum/33a63990-f280-46f9-a7f3-b2cd2606f860o%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages