Refactor dc_solver to use spin_kind_e and fix spin-polarized double counting#6
Open
jaemolihm wants to merge 1 commit intoTRIQS:unstablefrom
Open
Refactor dc_solver to use spin_kind_e and fix spin-polarized double counting#6jaemolihm wants to merge 1 commit intoTRIQS:unstablefrom
jaemolihm wants to merge 1 commit intoTRIQS:unstablefrom
Conversation
…ounting The dc_solver constructor now takes spin_kind_e instead of n_sigma, enabling correct spin-dependent behavior for Polarized systems. Previously, per-spin densities were unconditionally overridden to N_total/2, making sFLL/sAMF identical to cFLL/cAMF. - Add density matrix overloads for dc_self_energy and dc_energy - Change dc_energy return type from nda::matrix<double> to double - Add n_sigma_from_spin_kind free function to local_space.hpp - Register spin_kind_e enum in the dc Python module - Remove redundant free functions (double_counting, double_counting_sigma_dc, double_counting_energy_dc) - Add hardcoded-value tests for dc_formulas, density matrix overloads, Polarized vs NonPolarized, and NonColinear
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug fixed
N_sigmatoN_total/2, making spin-dependent DC formulas (sFLL, sAMF) identical to their charge-only counterparts (cFLL, cAMF). Now the override only applies when spin_kind != Polarized. When Polarized, actual per-spin densities are preserved, so sFLL/sAMF produce genuinely spin-dependent corrections.New entrypoints
One can now compute the self-energy given the density matrix. (Useful, e.g,. for CTHYB with density matrix measurement)
dc_solver::dc_self_energy(density_matrix)andDcSolver.dc_self_energy(density_matrix)dc_solver::dc_energy(density_matrix)andDcSolver.dc_energy(density_matrix)Breaking changes
triqs_modest.misc.double_counting(...),double_counting_sigma_dc, anddouble_counting_energy_dc. Their functionality is now fully covered by thedc_solverclass methods.dc_solver constructor:(long n_sigma, ...)→(spin_kind_e spin_kind, ...), same for Python DcSolver constructor.dc_solver::dc_energy(gimp):nda::matrix<double>→double(previously, it was returning the same value twice)