Skip to content

[Dependency] Operator layer source_hamilt depending back on electronic state/methods #7599

Description

@Critsium-xy

Describe the Code Quality Issue

  • Symptom:
    • module_xc/* includes estate/module_charge/charge.h (libxc_pot.cpp, xc_functional.h, libxc_tools.cpp);
    • module_xc/exx_info_*.h includes lcao/module_ri/conv_coulomb_pot_k.h;
    • includes pw/module_pwdft/structure_factor.h.
  • Fix:
    • apply dependency inversion for charge: define an abstract PotBase/density interface in the hamilt layer, have estate implement it, and let hamilt hold only an interface pointer;
    • the EXX-config dependency on RI (which lives in lcao) needs restructuring: move the RI-coupled parts of exx_info up to the method layer / esolver;
    • inject structure_factor from above.
  • Acceptance: cut hamilt ↔ estate and hamilt → lcao/pw.

Additional Context

No response

Task list for Issue attackers (only for developers)

  • Identify the specific code file or section with the code quality issue.
  • Investigate the issue and determine the root cause.
  • Research best practices and potential solutions for the identified issue.
  • Refactor the code to improve code quality, following the suggested solution.
  • Ensure the refactored code adheres to the project's coding standards.
  • Test the refactored code to ensure it functions as expected.
  • Update any relevant documentation, if necessary.
  • Submit a pull request with the refactored code and a description of the changes made.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions