@brief Test if an excitation generator generates all and only expected states with the correct pgen.
@author Werner Dobrautz, Oskar Weser
@details
The pgen_diagnostic is given by
\f[\sum_i \frac{1}{p_i N}\f]
and should be roughly one.
All problematic states with respect to that diagnostic are
printed in the end with their pgen_diagnostic,
excitation type (ic), matrix element, and pgen.
@param[in] excit_gen, An excitation generator.
@param[in] excit_gen_name, The name of the excitation generator.
@param[in] opt_nI, An optional reference state.
@param[in] opt_n_dets, An optional number of valid determinants to generate. Defaults to 100000.
(Does not count determinants with nJ(1) == 0!)
@param[in] gen_all_excits, An optional subroutine to generate all states
that can be reached from the reference state.
@param[in] calc_pgen, An optional function that calculates the pgen
for a given reference an excitation. If a state is never generated,
the pgen cannot be taken from the excitation generator.
Adds an additional column to the output table.
@param[in] problem_filter, An optional predicate function.
Return true, if an excitation exc from determinant det_I
and a given pgen_diagnostic (sum 1/pgen) is considered
to be problematic.
If it returns true, an entry in the final table is printed.
If there is any problematic excitation, the out parameter
successful will become .false..
By default all states with a pgen_diagnostic that deviate
with more than 5\,\% from 100\,\% and have nonzereo matrix element
are printed.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| procedure(generate_excitation_t) | :: | excit_gen | ||||
| character(len=*), | intent(in) | :: | excit_gen_name | |||
| integer, | intent(in), | optional | :: | opt_nI(nel) | ||
| integer, | intent(in), | optional | :: | opt_n_dets | ||
| procedure(generate_all_excits_t), | optional | :: | gen_all_excits | |||
| procedure(calc_pgen_t), | optional | :: | calc_pgen | |||
| procedure(problem_filter_t), | optional | :: | problem_filter | |||
| integer, | intent(in), | optional | :: | i_unit | ||
| logical, | intent(out), | optional | :: | successful |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ExcitationGenerator_t), | intent(inout) | :: | exc_generator | |||
| character(len=*), | intent(in) | :: | excit_gen_name | |||
| integer, | intent(in), | optional | :: | opt_nI(nel) | ||
| integer, | intent(in), | optional | :: | opt_n_dets | ||
| procedure(problem_filter_t), | optional | :: | problem_filter | |||
| integer, | intent(in), | optional | :: | i_unit | ||
| logical, | intent(out), | optional | :: | successful |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | nI(nel) | |||
| integer(kind=n_int), | intent(in) | :: | ilutI(0:NIfTot) | |||
| integer, | intent(in) | :: | ex(2,maxExcit) | |||
| integer, | intent(in) | :: | ic | |||
| integer, | intent(in) | :: | ClassCount2(ScratchSize) | |||
| integer, | intent(in) | :: | ClassCountUnocc2(ScratchSize) |
Return true, if an excitation exc from determinant det_I and a given pgen_diagnostic (sum 1/pgen) is considered to be problematic.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | nI(nEl) | |||
| integer, | intent(in) | :: | exc(2,maxExcit) | |||
| integer, | intent(in) | :: | ic | |||
| real(kind=dp), | intent(in) | :: | pgen_diagnostic |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=n_int), | intent(in) | :: | list_ilut(:,:) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | list_nI(:,:) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | list_nI(:,:) | |||
| integer, | intent(in), | optional | :: | spin_opt |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | list_nI(:,:) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | H(:,:) | |||
| real(kind=dp), | intent(in), | optional | :: | t_mat_opt(:,:) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | hamil(:,:) | |||
| integer, | intent(in) | :: | n_pairs |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | nI_in(:) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=n_int), | intent(in) | :: | tgt_ilut(0:niftot) | |||
| integer, | intent(in) | :: | n_states | |||
| integer(kind=n_int), | intent(in) | :: | ilut_list_in(0:niftot,n_states) | |||
| logical, | intent(in), | optional | :: | t_sorted_opt |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | nI(:) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(lattice), | intent(in) | :: | in_lat |
@brief Test if an excitation generator generates all and only expected states with the correct pgen.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| procedure(generate_excitation_t) | :: | excit_gen | ||||
| character(len=*), | intent(in) | :: | excit_gen_name | |||
| integer, | intent(in), | optional | :: | opt_nI(nel) | ||
| integer, | intent(in), | optional | :: | opt_n_dets | ||
| procedure(generate_all_excits_t), | optional | :: | gen_all_excits | |||
| procedure(calc_pgen_t), | optional | :: | calc_pgen | |||
| procedure(problem_filter_t), | optional | :: | problem_filter | |||
| integer, | intent(in), | optional | :: | i_unit | ||
| logical, | intent(out), | optional | :: | successful |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ExcitationGenerator_t), | intent(inout) | :: | exc_generator | |||
| character(len=*), | intent(in) | :: | excit_gen_name | |||
| integer, | intent(in), | optional | :: | opt_nI(nel) | ||
| integer, | intent(in), | optional | :: | opt_n_dets | ||
| procedure(problem_filter_t), | optional | :: | problem_filter | |||
| integer, | intent(in), | optional | :: | i_unit | ||
| logical, | intent(out), | optional | :: | successful |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(PgenUnitTestSpec_t), | intent(in) | :: | pgen_unit_test_spec |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | nI(nel) | |||
| integer, | intent(out) | :: | n_states | |||
| integer, | intent(out), | allocatable | :: | state_list_ni(:,:) | ||
| integer(kind=n_int), | intent(out), | allocatable | :: | state_list_ilut(:,:) | ||
| procedure(generate_all_excits_t), | optional | :: | gen_all_excits_opt |