Hi there,
I am currently trying to use the atomate2 elastic workflow to reproduce the Elastic Constants given on https://next-gen.materialsproject.org, say for this one: https://next-gen.materialsproject.org/materials/mp-126.
Below is my script:
$ cat mp-elastic.py
# The final result is very different from https://next-gen.matialsproject.org/materials/mp-126:
#$ pyenv shell datasci
#$ module load vasp
#$ python $0
import numpy as np
from jobflow import run_locally
from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
from atomate2.common.schemas.elastic import ElasticDocument
from atomate2.vasp.flows.elastic import ElasticMaker
from atomate2.vasp.powerups import (
update_user_incar_settings,
update_user_potcar_functional,
update_user_kpoints_settings,
)
from pymatgen.core import Structure
from mp_api.client import MPRester
from atomate2.vasp.powerups import add_metadata_to_flow
user_potcar_functional = "PBE_64"
with MPRester() as mpr:
elasticity_docs = mpr.materials.elasticity.search(material_ids=["mp-126"])
structure = elasticity_docs[0].structure
structure = SpacegroupAnalyzer(structure).get_conventional_standard_structure()
flow = ElasticMaker().make(structure, conventional=True)
flow = update_user_incar_settings(flow, {
"GGA": "PE",
"ISMEAR": 2,
"SIGMA": 0.05
})
flow = update_user_potcar_functional(flow, user_potcar_functional)
# (Optional) add metadata to the flow task document.
# Could be useful to filter specific results from the database.
# For e.g., adding material project ID for the compound, use following lines
flow = add_metadata_to_flow(
flow=flow,
additional_fields={"mp_id": "mp-126", "submission_label": "mp-126_elastic_tensor-GGA-PE"},
)
responses = run_locally(flow, create_folders=True, ensure_success=True)
elastic_output = responses[flow.jobs[-1].uuid][1].output
matrix = np.array(elastic_output.elastic_tensor.ieee_format)
np.set_printoptions(precision=4, suppress=True)
print(matrix)
The result is as follows:
$ pyenv shell datasci
$ module load vasp
$ python mp-elastic.py
Retrieving ElasticityDoc documents: 100%|████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 13934.56it/s]
/home/werner/Public/repo/github.com/materialsproject/pymatgen.git/src/pymatgen/io/vasp/sets.py:288: BadInputSetWarning: Overriding the POTCAR functional is generally not recommended as it significantly affects the results of calculations and compatibility with other calculations done with the same input set. Note that some POTCAR symbols specified in the configuration file may not be available in the selected functional.
warnings.warn(
2024-10-29 16:53:28,720 INFO Started executing jobs locally
2024-10-29 16:53:28,729 INFO Starting job - tight relax 1 (23651f75-2df2-4b37-8e87-6155190237b1)
2024-10-29 16:53:59,866 INFO Finished job - tight relax 1 (23651f75-2df2-4b37-8e87-6155190237b1)
2024-10-29 16:53:59,866 WARNING Response.stored_data is not supported with local manager.
2024-10-29 16:53:59,867 INFO Starting job - tight relax 2 (661990a0-5a29-4f11-9a96-feb7902c1166)
/home/werner/Public/repo/github.com/materialsproject/atomate2.git/src/atomate2/common/files.py:268: UserWarning: /home/werner/elastic2ieee/atomate2/job_2024-10-29-08-53-59-867156-29532/INCAR is not gzipped, skipping...
file_client.gunzip(directory / file, host=host, force=force)
/home/werner/Public/repo/github.com/materialsproject/atomate2.git/src/atomate2/common/files.py:268: UserWarning: /home/werner/elastic2ieee/atomate2/job_2024-10-29-08-53-59-867156-29532/OUTCAR is not gzipped, skipping...
file_client.gunzip(directory / file, host=host, force=force)
/home/werner/Public/repo/github.com/materialsproject/atomate2.git/src/atomate2/common/files.py:268: UserWarning: /home/werner/elastic2ieee/atomate2/job_2024-10-29-08-53-59-867156-29532/CONTCAR is not gzipped, skipping...
file_client.gunzip(directory / file, host=host, force=force)
/home/werner/Public/repo/github.com/materialsproject/atomate2.git/src/atomate2/common/files.py:268: UserWarning: /home/werner/elastic2ieee/atomate2/job_2024-10-29-08-53-59-867156-29532/vasprun.xml is not gzipped, skipping...
file_client.gunzip(directory / file, host=host, force=force)
/home/werner/Public/repo/github.com/materialsproject/atomate2.git/src/atomate2/common/files.py:268: UserWarning: /home/werner/elastic2ieee/atomate2/job_2024-10-29-08-53-59-867156-29532/POTCAR is not gzipped, skipping...
file_client.gunzip(directory / file, host=host, force=force)
/home/werner/Public/repo/github.com/materialsproject/atomate2.git/src/atomate2/common/files.py:268: UserWarning: /home/werner/elastic2ieee/atomate2/job_2024-10-29-08-53-59-867156-29532/KPOINTS is not gzipped, skipping...
file_client.gunzip(directory / file, host=host, force=force)
2024-10-29 16:54:21,285 INFO Finished job - tight relax 2 (661990a0-5a29-4f11-9a96-feb7902c1166)
2024-10-29 16:54:21,285 WARNING Response.stored_data is not supported with local manager.
2024-10-29 16:54:21,285 INFO Starting job - structure_to_conventional (0d2e00d6-37b9-4c16-93e9-964674e184bf)
2024-10-29 16:54:21,314 INFO Finished job - structure_to_conventional (0d2e00d6-37b9-4c16-93e9-964674e184bf)
2024-10-29 16:54:21,315 INFO Starting job - generate_elastic_deformations (66b926b8-91db-4f8e-be6b-e5f400ab97da)
2024-10-29 16:54:22,261 INFO Finished job - generate_elastic_deformations (66b926b8-91db-4f8e-be6b-e5f400ab97da)
2024-10-29 16:54:22,261 INFO Starting job - run_elastic_deformations (c03aeca4-a17a-42d0-9876-018f12cff20b)
/home/werner/Public/repo/github.com/materialsproject/pymatgen.git/src/pymatgen/io/vasp/sets.py:288: BadInputSetWarning: Overriding the POTCAR functional is generally not recommended as it significantly affects the results of calculations and compatibility with other calculations done with the same input set. Note that some POTCAR symbols specified in the configuration file may not be available in the selected functional.
warnings.warn(
2024-10-29 16:54:22,629 INFO Finished job - run_elastic_deformations (c03aeca4-a17a-42d0-9876-018f12cff20b)
2024-10-29 16:54:22,634 INFO Starting job - elastic relax 1/6 (88abf11a-8bef-41f1-8dd5-074f55d9a75b)
2024-10-29 16:55:26,191 INFO Finished job - elastic relax 1/6 (88abf11a-8bef-41f1-8dd5-074f55d9a75b)
2024-10-29 16:55:26,191 WARNING Response.stored_data is not supported with local manager.
2024-10-29 16:55:26,192 INFO Starting job - elastic relax 2/6 (f34cb1fb-115d-44ab-abae-84a5891760fd)
2024-10-29 16:56:29,371 INFO Finished job - elastic relax 2/6 (f34cb1fb-115d-44ab-abae-84a5891760fd)
2024-10-29 16:56:29,371 WARNING Response.stored_data is not supported with local manager.
2024-10-29 16:56:29,372 INFO Starting job - elastic relax 3/6 (3b05aca4-2771-4c63-84bb-2408fc9cc778)
2024-10-29 16:57:32,885 INFO Finished job - elastic relax 3/6 (3b05aca4-2771-4c63-84bb-2408fc9cc778)
2024-10-29 16:57:32,885 WARNING Response.stored_data is not supported with local manager.
2024-10-29 16:57:32,885 INFO Starting job - elastic relax 4/6 (9db86c63-4010-43f6-9dd8-3782a9d20bc9)
2024-10-29 16:58:25,763 INFO Finished job - elastic relax 4/6 (9db86c63-4010-43f6-9dd8-3782a9d20bc9)
2024-10-29 16:58:25,764 WARNING Response.stored_data is not supported with local manager.
2024-10-29 16:58:25,764 INFO Starting job - elastic relax 5/6 (b58ae1e6-7e99-4033-96e6-d07c5c3a185d)
2024-10-29 16:59:49,881 INFO Finished job - elastic relax 5/6 (b58ae1e6-7e99-4033-96e6-d07c5c3a185d)
2024-10-29 16:59:49,881 WARNING Response.stored_data is not supported with local manager.
2024-10-29 16:59:49,882 INFO Starting job - elastic relax 6/6 (63fb7580-3b34-47e6-9899-b30a3ab826a9)
2024-10-29 17:01:13,971 INFO Finished job - elastic relax 6/6 (63fb7580-3b34-47e6-9899-b30a3ab826a9)
2024-10-29 17:01:13,971 WARNING Response.stored_data is not supported with local manager.
2024-10-29 17:01:13,971 INFO Starting job - store_inputs (c03aeca4-a17a-42d0-9876-018f12cff20b, 2)
2024-10-29 17:01:13,974 INFO Finished job - store_inputs (c03aeca4-a17a-42d0-9876-018f12cff20b, 2)
2024-10-29 17:01:13,974 INFO Starting job - fit_elastic_tensor (37ae793f-8698-4d85-843c-c4ef54706c0d)
2024-10-29 17:01:14,406 INFO Finished job - fit_elastic_tensor (37ae793f-8698-4d85-843c-c4ef54706c0d)
2024-10-29 17:01:14,406 INFO Finished executing jobs locally
[[329.1842 202.1619 202.1619 0. 0. -0. ]
[202.1619 329.1842 202.1619 0. 0. -0. ]
[202.1619 202.1619 329.1842 0. 0. -0. ]
[ 0. 0. 0. 72.9088 -0. 0. ]
[ 0. 0. 0. -0. 72.9088 0. ]
[ -0. -0. -0. 0. 0. 72.9088]]
As you can see, this is very different from the result reported on the materialsproject official site:
So, do you have any hints/tips/comments on using the atomate2 elastic workflow to reproduce the Elastic Constants given on https://next-gen.materialsproject.org?
See Use the atomate2 elastic workflow to reproduce the Elastic Constants given on next-gen.materialsproject.org. · Issue #4 · JaGeo/TutorialAtomate2Forcefields · GitHub for the related discussion.
Regards,
Zhao