Skip to content

Commit

Permalink
Some bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bastonero committed Oct 12, 2022
1 parent 4b1d7a1 commit c04c5f0
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions src/aiida_quantumespresso/data/hubbard_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,16 +333,12 @@ def _get_quantum_espresso_hubbard_info(self) -> tuple:

return sc_indecis, sc_positions, sc_symbols

def get_quantum_espresso_hubbard_card(self, shuffle: bool = False) -> str:
"""Get QuantumESPRESSO `HUBBARD` input card for `pw.x` for versions > v.7.1.
:param shuffle: when using multiple Hubbard parameters on the same atoms (or couple of atoms), the order
with which they are given to QE is important. When True, it will rearrange the
Hubbard parameters correctly."""
hubbard_parameters = self._get_quantum_espresso_ordered_params() if shuffle else self.hubbard_parameters

def get_quantum_espresso_hubbard_card(self) -> str:
"""Get QuantumESPRESSO `HUBBARD` input card for `pw.x` for versions > v.7.1."""
hubbard_parameters = self.hubbard_parameters
sites = self.sites
natoms = len(sites)

card = f'HUBBARD ({self.hubbard_projectors})\n'
sc_indecis, _, _ = self._get_quantum_espresso_hubbard_info()

Expand Down Expand Up @@ -693,7 +689,16 @@ def initialize_onsites_hubbard(
hubbard_type="dudarev"
):
"""Initialize and append onsite Hubbard values of atoms with specific name."""
self.initialize_intersites_hubbard(atom_name, atom_manifold, atom_name, atom_manifold, value, number_of_neighbours=1, hubbard_type=hubbard_type)
self.initialize_intersites_hubbard(
atom_name,
atom_manifold,
atom_name,
atom_manifold,
value,
number_of_neighbours=1,
use_kinds=use_kinds,
hubbard_type=hubbard_type
)

def hubbard_parameters_to_new_structure(self, new_structure: StructureData, thr=1e-5):
"""It produces the Hubbard parameters for a new structure (e.g. a supercell) from the local parameters.
Expand Down

0 comments on commit c04c5f0

Please sign in to comment.