diff --git a/src/aiida_quantumespresso/calculations/functions/seekpath_structure_analysis.py b/src/aiida_quantumespresso/calculations/functions/seekpath_structure_analysis.py index a2603aa63..5d89dc64d 100644 --- a/src/aiida_quantumespresso/calculations/functions/seekpath_structure_analysis.py +++ b/src/aiida_quantumespresso/calculations/functions/seekpath_structure_analysis.py @@ -41,9 +41,11 @@ def seekpath_structure_analysis(structure, **kwargs): def update_structure_with_hubbard(structure, orig_structure): """Update the structure based on Hubbard parameters if the input structure is a HubbardStructureData.""" + from aiida_quantumespresso.utils.hubbard import is_intersite_hubbard + hubbard_structure = HubbardStructureData.from_structure(structure) - if any(parameter.hubbard_type == 'V' for parameter in orig_structure.hubbard.parameters): + if is_intersite_hubbard(orig_structure.hubbard): raise NotImplementedError('Intersite Hubbard parameters are not yet supported.') for parameter in orig_structure.hubbard.parameters: diff --git a/tests/calculations/functions/test_seekpath_analysis.py b/tests/calculations/functions/test_seekpath_analysis.py index 81e939731..cbf150d71 100644 --- a/tests/calculations/functions/test_seekpath_analysis.py +++ b/tests/calculations/functions/test_seekpath_analysis.py @@ -56,3 +56,14 @@ def test_seekpath_analysis(data_regression): 'hubbard': conv_structure.hubbard.to_list(), } }) + + +# pylint: disable=W0621 +@pytest.mark.usefixtures('aiida_profile') +def test_seekpath_analysis_intersite(generate_structure): + """Test that the `seekpath_structure_analysis` with intersite hubbard corrections fails.""" + orig_structure = HubbardStructureData.from_structure(generate_structure('silicon-kinds')) + orig_structure.initialize_intersites_hubbard('Si0', '2p', 'Si1', '2p', 4.0, 'V', True) + + with pytest.raises(NotImplementedError, match='Intersite Hubbard parameters are not yet supported.'): + seekpath_structure_analysis(orig_structure)