-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjust fundamental operator set to respect order in gf_struct #342 #686
Conversation
-In acc with the type gf_struct_t=vector<pair<int,vec<int/str>>> that describes the Block Green function structure this commit adjusts the fundamental operator set to respect this block-order -Contains unfixed test failures for atom_diag
I'll look at the code a bit later... Now I only have a quick question about |
You are indeed correct. The type is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are only a couple of small remarks.
Besides, I fixed the test failures in krivenko@b84c865.
|
||
/// The set represented as a plain `std::vector` | ||
/// The basic container `std::vector<indices_t>` | ||
using reduction_t = std::vector<indices_t>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that fundamental_operator_set
is just a vector with some convenience methods, I'd rather rename this type to data_t
or something similar.
} | ||
|
||
// Dereference type for const_iterator | ||
struct _cdress { | ||
indices_t const &index; | ||
int linear_index; | ||
_cdress(typename map_t::const_iterator _it) : index(_it->first), linear_index(_it->second) {} | ||
using base_const_iterator = triqs::utility::details::enum_iter<reduction_t::const_iterator>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drawing things from details
namespace is not what one should be doing. Consider moving enum_iter
into triqs::utility
.
…_operator_set `fundamental_operator_set` used to store operator index combinations in the lexicographical order. Now they are stored in the order they were inserted.
LGTM, thank you! |
PR TRIQS#686 changed the order in which `fundamental_operator_set` stores index combinations. Before that PR, mutual order of two index combinations was dictated by the result of `operator<()`, which had been consistent with the way `many_body_operator` orders canonical operators within a monomial. Now the order of the index combinations and - consequently - of single particle bits forming a Fock state is arbitrary. When computing fermionic sign prefactor, the constructor of `imperative_operator` relied on ordering of the bits being consistent with the ordering of the monomial. PR TRIQS#686 broke that assumption, which resulted in a dangerous and hard-to-find bug -- sign of some matrix elements can be erroneously flipped. This commit fixes the issue by sorting monomials in `imperative_operator`'s constructor and revealing a possible sign change due to a permutation of canonical operators caused by `fops`.
PR #686 changed the order in which `fundamental_operator_set` stores index combinations. Before that PR, mutual order of two index combinations was dictated by the result of `operator<()`, which had been consistent with the way `many_body_operator` orders canonical operators within a monomial. Now the order of the index combinations and - consequently - of single particle bits forming a Fock state is arbitrary. When computing fermionic sign prefactor, the constructor of `imperative_operator` relied on ordering of the bits being consistent with the ordering of the monomial. PR #686 broke that assumption, which resulted in a dangerous and hard-to-find bug -- sign of some matrix elements can be erroneously flipped. This commit fixes the issue by sorting monomials in `imperative_operator`'s constructor and revealing a possible sign change due to a permutation of canonical operators caused by `fops`.
PR #686 changed the order in which `fundamental_operator_set` stores index combinations. Before that PR, mutual order of two index combinations was dictated by the result of `operator<()`, which had been consistent with the way `many_body_operator` orders canonical operators within a monomial. Now the order of the index combinations and - consequently - of single particle bits forming a Fock state is arbitrary. When computing fermionic sign prefactor, the constructor of `imperative_operator` relied on ordering of the bits being consistent with the ordering of the monomial. PR #686 broke that assumption, which resulted in a dangerous and hard-to-find bug -- sign of some matrix elements can be erroneously flipped. This commit fixes the issue by sorting monomials in `imperative_operator`'s constructor and revealing a possible sign change due to a permutation of canonical operators caused by `fops`.
PR #686 changed the order in which `fundamental_operator_set` stores index combinations. Before that PR, mutual order of two index combinations was dictated by the result of `operator<()`, which had been consistent with the way `many_body_operator` orders canonical operators within a monomial. Now the order of the index combinations and - consequently - of single particle bits forming a Fock state is arbitrary. When computing fermionic sign prefactor, the constructor of `imperative_operator` relied on ordering of the bits being consistent with the ordering of the monomial. PR #686 broke that assumption, which resulted in a dangerous and hard-to-find bug -- sign of some matrix elements can be erroneously flipped. This commit fixes the issue by sorting monomials in `imperative_operator`'s constructor and revealing a possible sign change due to a permutation of canonical operators caused by `fops`.
In accordance with the type-change of
gf_struct_t
tothat was introduced in a746ba5 this commit adjusts the
fundamental_operator_set
to respect the order of blocks in gf_structThis PR still contains unfixed test failures for the atom_diag part of triqs.
@krivenko Could you comment on/review this PR and have a look at the test failures in atom_diag?