<div style="font-family: Arial; font-size: 14px;"><br></div><div style="font-family: Arial; font-size: 14px;">Dear all,</div><div style="font-family: Arial; font-size: 14px;">I am trying to run the QE using ase. A mwe is:</div><div style="font-family: Arial; font-size: 14px;"><span style="font-family: Menlo, Consolas, "Courier New", monospace;">#!/usr/bin/env python</span><div><br></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;">import </span><span><a target="_blank" rel="noreferrer nofollow noopener" href="http://ase.io"><span style="font-family: Menlo, Consolas, "Courier New", monospace;">ase.io</span></a></span><span style="font-family: Menlo, Consolas, "Courier New", monospace;"> as aio</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;">import ase.io.espresso as aie</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;">from ase.calculators.espresso import Espresso</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;">from ase.constraints import ExpCellFilter</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;">from ase.dft.dos import DOS</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;">from ase.optimize import BFGS</span></div><div><br></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;">structure = aio.read("Fe_mp-13_symmetrized.cif")</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;">pseudolst = {"Fe": "Fe.pbe-spn-kjpaw_psl.1.0.0.UPF"}</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;">for atoms in structure:</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;"> atoms.magmom = "3"</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;">input_data = {</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;"> "nspin": 2,</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;"> "degauss": 0.04,</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;"> 'occupations': 'smearing',</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;"> 'smearing': 'gaussian',</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;">}</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;">input_dos = {</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;"> "calculation": "nscf",</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;"> "occupations": "tetrahedra",</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;">}</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;">kpts_dos = (3, 3, 3)</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;">structure.magmom = '3.0'</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;">calc = Espresso(</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;"> pseudopotentials=pseudolst,</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;"> tstress=True,</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;"> tprnfor=True,</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;"> input_data=input_data,</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;"> crystal_coordinates=True,</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;">)</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;">structure.calc = calc</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;">ucf = ExpCellFilter(structure)</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;">opt = BFGS(ucf, trajectory="structure.traj", restart="structure.restart")</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;">opt.run(fmax=0.25)</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;">structure.get_potential_energy()</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;">input_data.update(input_dos)</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;">del input_data["smearing"]</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;">del input_data["degauss"]</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;">op = aio.read("structure.traj")</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;">input_data.update(input_dos)</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;">dos_cal = Espresso(pseudopotentials=pseudolst,</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;"> input_data=input_data,</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;"> kpts=kpts_dos)</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;">op.dos_cal = dos_cal</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;">dos = DOS(dos_cal)</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;"># with open("trial_in", "w") as k:</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;"># aie.write_espresso_in(</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;"># k,</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;"># op,</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;"># pseudopotentials=pseudolst,</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;"># input_data=input_data,</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;"># crystal_coordinates=True,</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;"># kpts=kpts_dos,</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;"># )</span></div><div><br></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;"># dos = DOS(calc)</span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;"><br></span></div><div><span style="font-family: Arial;">While, the relax+scf is working properly, I am getting error in nscf, as:</span></div><div><span style="font-family: Arial;"><br></span></div><div><span style="font-family: Menlo, Consolas, "Courier New", monospace;"><span>python <a target="_blank" rel="noreferrer nofollow noopener" href="http://mwe.py">mwe.py</a> </span><div><span>/home/rudra/.local/lib/python3.11/site-packages/ase/calculators/espresso.py:170: FutureWarning: Espresso calculator is being restructured. Please use e.g. Espresso(profile=EspressoProfile(argv=['mpiexec', 'pw.x'])) to customize command-line arguments.</span></div><div><span> warnings.warn(compatibility_msg, FutureWarning)</span></div><div><span> Step Time Energy fmax</span></div><div><span>BFGS: 0 09:19:25 -8965.723058 4.521557</span></div><div><span>BFGS: 1 09:19:38 -8965.984876 0.086497</span></div><div><span>/home/rudra/.local/lib/python3.11/site-packages/ase/calculators/espresso.py:170: FutureWarning: Espresso calculator is being restructured. Please use e.g. Espresso(profile=EspressoProfile(argv=['mpiexec', 'pw.x'])) to customize command-line arguments.</span></div><div><span> warnings.warn(compatibility_msg, FutureWarning)</span></div><div><span>Traceback (most recent call last):</span></div><div><span> File "/home/rudra/.local/lib/python3.11/site-packages/ase/calculators/abc.py", line 77, in _get</span></div><div><span> return dct[name]</span></div><div><span> ~~~^^^^^^</span></div><div><span>KeyError: 'kpoint_weights'</span></div><div><br></div><div><span>During handling of the above exception, another exception occurred:</span></div><div><br></div><div><span>Traceback (most recent call last):</span></div><div><span> File "/home/rudra/Projects/ASE/QE/mwe.py", line 47, in <module></span></div><div><span> dos = DOS(dos_cal)</span></div><div><span> ^^^^^^^^^^^^</span></div><div><span> File "/home/rudra/.local/lib/python3.11/site-packages/ase/dft/dos.py", line 32, in __init__</span></div><div><span> self.w_k = calc.get_k_point_weights()</span></div><div><span> ^^^^^^^^^^^^^^^^^^^^^^^^^^</span></div><div><span> File "/home/rudra/.local/lib/python3.11/site-packages/ase/calculators/abc.py", line 88, in get_k_point_weights</span></div><div><span> return self._get('kpoint_weights')</span></div><div><span> ^^^^^^^^^^^^^^^^^^^^^^^^^^^</span></div><div><span> File "/home/rudra/.local/lib/python3.11/site-packages/ase/calculators/abc.py", line 79, in _get</span></div><div><span> raise PropertyNotPresent(name)</span></div><div><span>ase.calculators.calculator.PropertyNotPresent: kpoint_weights</span></div><span></span><br></span></div><span></span>I agree that its more of ASE question rather than QE. But, as my last hope, I am expecting some peoplemust be using ase+qe and may help.</div><div style="font-family: Arial; font-size: 14px;"><br></div><div style="font-family: Arial; font-size: 14px;">Regards,</div>
<div class="protonmail_signature_block" style="font-family: Arial; font-size: 14px;">
<div class="protonmail_signature_block-user protonmail_signature_block-empty">
</div>
<div class="protonmail_signature_block-proton">
Sent with <a target="_blank" href="https://proton.me/" rel="noopener noreferrer">Proton Mail</a> secure email.
</div>
</div>