Closed davkovacs closed 2 years ago
max levels shouldn't be used to filter. The filter does something else it is to introduce holes into the basis, e.g. enforce the sum l = even and sum m = 0 constraints.
Look at these lines:
level(b::Onepb, Bsel::AbstractSparseBasis, basis::OneParticleBasis) =
degree(b, basis, Bsel.weight)
level(bb::Prodb, Bsel::AbstractSparseBasis, basis::OneParticleBasis) = (
length(bb) == 0 ? 0.0
: norm( level.(bb, Ref(Bsel), Ref(basis)), Bsel.p ) )
maxlevel(bb::Prodb, Bsel::AbstractSparseBasis, basis::OneParticleBasis) =
maxlevel(length(bb), Bsel, basis)
maxlevel(ord::Integer, Bsel::AbstractSparseBasis, basis::OneParticleBasis) =
( haskey(Bsel.maxlevels, ord) ? Bsel.maxlevels[ord]
: Bsel.maxlevels["default"] )
All basis functions b
or bb
will be constructed such that level(b or bb) <= maxlevel
. The maxlevel
function depends on the order.
Looking at it now, maybe we are missing a maxlevel
function for 1-particle basis functions b
?
CC @JPDarby
We may need to write some decent documentation for this.
This is not an issue anymore - I was on an old commit and misunderstanding
max levels shouldn't be used to filter. The filter does something else it is to introduce holes into the basis, e.g. enforce the sum l = even and sum m = 0 constraints.
The fix in 5b7eaf3b464a6c9397c3438286b0ccfe45d920d0 solved the problem.
So close this?
Yes, I think it works now. Though the dipole fits are still really bad, so there is something to debug there. I just need to figure out if it is the basis or the fitting that has the bug.
can you send me the data?
The SparseBasis Basis selector does not filter the basis functions based on the
maxlevels
dictionary.