update.
- evaluates spin-spin and density-density correlations <n_a,n_b>
- introduced numbering in the columns.info file from greater readibility.
bugs fixed:
- now evaluates spin-spin <sz_a,sz_b> rather than moment-moment <m_a,m_b> correlation
function.
- found a bug in the printing routine for the irreducible bath chi^2 fit:
always printed G0 field rather than G0 or \Delta depending on the value of
cg_scheme.
- new bath initialization: generate a smart bath in the range -Hband:Hband (input of
ed_init_solver, default=2) and optionally read bath from file so that
restarting from different bath levels is possible. bath center is at 1.d-4.
update: wrote the get_gf part.
To be done:
- evaluate the order parameter in ED_OBSERVABLES
- code the fit procedure for the Nambu Green's function
- write the driver for the self-consistency for the Bethe lattice.
- DEBUG - DEBUG - DEBUG - DEBUG - DEBUG - DEBUG - DEBUG - DEBUG - DEBUG

in the middle of writing the superconducting extension of the code.
update:
found a bug in the stopping condition for iloop > nloop. fixed in all drivers.

update.
- evaluates spin-spin and density-density correlations <n_a,n_b>
- introduced numbering in the columns.info file from greater readibility.
bugs fixed:
- now evaluates spin-spin <sz_a,sz_b> rather than moment-moment <m_a,m_b> correlation
function.
- found a bug in the printing routine for the irreducible bath chi^2 fit:
always printed G0 field rather than G0 or \Delta depending on the value of
cg_scheme.
- new bath initialization: generate a smart bath in the range -Hband:Hband (input of
ed_init_solver, default=2) and optionally read bath from file so that
restarting from different bath levels is possible. bath center is at 1.d-4.
Code entirely written.
First debug successfull and tested against Massimo Capone lanczos code (MClanc).
Results at first DMFT loop for U=0 and U=1 give very same spectrum.
Green's functions are found in very good agreement and even better
fullfillment of the symmetry (i.e. Re_G or Re_Sigma identically zero).

Initial results for fully converged DMFT calculation obtained for U=2.
Order parameter is found to be on top of MClanc code.

To be fixed:
- Code to be cleaned.
- Delta functions routines in ED_BATH to be replaced with a unique subroutine
for real or matsubara frequencies.
- not interacting Grenn's function (impG0 and impF0) of the Anderson problem looks wrong.
Inversion to be check out.

Test against F. Petocchi results for bethe lattice in order.
Code cleaned. Ready to be merged with the +devel branch.
Delta functions routines have been fixed: there are now 4routines:
2 to get normal component Delta (matsubara,real),
2 to get anomalous component FDelta (matsubara,real).

bug fixed: a bug in the calculation of delta_imp observables was found
and fixed in ED_OBSERVABLES.

Benchmarks against M.Capone and F.Petocchi data are very satisfactory.
update:
code little revisioned, some bug fixed.
- order parameter +phi was evaluated as twice is value
- an sign error in the definition of the anomalous hybridization functio on the real-axis
(fdelta_bath_real) caused a wrong evaluation of the self-enrergy (impSAreal) and thus
of the spectral density at the self-consistency.
- bug in the evaluation of the G0,F0 has been fixed (wrong definition of the determinant).

Test against IPT real-axis code show very good results at zero temperature.
Keep testing at finite temperature.
Merge branch 'devel_sc' into merge_devel_and_develSC

Conflicts:
	.gitignore
	ED_AUX_FUNX.f90
	ED_CHI2FIT.f90
	ED_HAMILTONIAN.f90
	ED_OBSERVABLES.f90
	drivers/ed_tddpam_bethe.f90
reshape:
code structure slightly updated.
Input variables are pushed into a separate module to better handle wrapping into larger codes (e.g. RDMFT).
The global variables are still kept into the ED_VARS_GLOBAL module. A separate module was created for the BATH_TYPE which
can NOT be included in the ED_BATH module, because this latter needs some global variable on its own.

update:
found a bug in the stopping condition for iloop > nloop. fixed in all drivers.

update.
- evaluates spin-spin and density-density correlations <n_a,n_b>
- introduced numbering in the columns.info file from greater readibility.
bugs fixed:
- now evaluates spin-spin <sz_a,sz_b> rather than moment-moment <m_a,m_b> correlation
function.
- found a bug in the printing routine for the irreducible bath chi^2 fit:
always printed G0 field rather than G0 or \Delta depending on the value of
cg_scheme.
- new bath initialization: generate a smart bath in the range -Hband:Hband (input of
ed_init_solver, default=2) and optionally read bath from file so that
restarting from different bath levels is possible. bath center is at 1.d-4.
update:
input module has been modified to exploit new version of PARSE_INPUT module in SciFor library.
This permits to avoid use a namelist, reading variables from a file or command line indifferently (cmd-line updates last).

any non-conflicting number of variables can be added to the list, read from file or cmd-line.
This is very useful either for the drivers, treating and saving additional variables as input variables, and for the
integration with RDMFT (see RDMFT code).

small modifications in the initialize_ed_solver routine to setup the main pointer and perform allocations only once, in
case multiple instances of the solver need to be started.

some little reshape of the code.
input variables moved into the ED_INPUT_VARS module for better handling.
this required some work on the Hloc reading & manipulation.

renamed some variables in the input file, this will cause some problem at runtime
using old input file:
- lanc_neigen --> lanc_nstates_sector
- lanc_nstates --> lanc_nstates_total
- NL --> Lmats
- Nw --> Lreal
- Nfit --> Lfit

Merge branch 'devel' into merge_devel_and_develSC

Conflicts:
	ED_AUX_FUNX.f90
	ED_CHI2FIT.f90
	ED_DIAG.f90
	ED_HAMILTONIAN.f90
	ED_OBSERVABLES.f90
	ED_VARS_GLOBAL.f90
	Makefile
This is mid-term version of the code.
I developed the AFM-BHZ topological insulator driver, not tested yet based
on a version of teh code that apparently does not work fine in the SuperConducting
part.

So I put the developed code in this branch, while a debug the devel branch.
stable version of the code.

implemented debug corrections from G.Mazza branch (+devel_sc_gm)
The changed from G.Mazza fix some problems with the real-axis normal/anomalous GFs following
the +correct+ calculations he did.

This version of the code gives same results as the other branches with SC extension.
Ready to move on and import the changes that have been stashed to devel_wbhz (temporarily).
This version of the code was tested for the superconducting part against debugged
version from G.Mazza.
The results are identical (== numerically exact) with respect to previous version of the code.

Merge branch 'devel_wbhz' into devel

REDO:
input module has been modified to exploit new version of PARSE_INPUT module in SciFor library.
This permits to avoid use a namelist, reading variables from a file or command line indifferently (cmd-line updates last).

any non-conflicting number of variables can be added to the list, read from file or cmd-line.
This is very useful either for the drivers, treating and saving additional variables as input variables, and for the
integration with RDMFT (see RDMFT code).

small modifications in the initialize_ed_solver routine to setup the main pointer and perform allocations only once, in
case multiple instances of the solver need to be started.

some little reshape of the code.
input variables moved into the ED_INPUT_VARS module for better handling.
this required some work on the Hloc reading & manipulation.

renamed some variables in the input file, this will cause some problem at runtime
using old input file:
- lanc_neigen --> lanc_nstates_sector
- lanc_nstates --> lanc_nstates_total
- NL --> Lmats
- Nw --> Lreal
- Nfit --> Lfit

Conflicts:
	ED_GREENS_FUNCTIONS.f90
	ED_VARS_GLOBAL.f90
	Makefile
update: changed the suffix in the output.
Not ed_file_suffix controls a suffix placed between the filename and the actual extension of the
file.
In the code there are two reserved extensions: .ed for generic output, .restart for the bath output.

minor changes due to BHZ-AFM driver.

worked on the output of the code to better integrate with RDMFT.
As Giacomo noticed, calling many times in parallel the ed_solver routine
will overwrite the different outputs on the same file.
We introduced a suffix, +ed_file_suffix input variable, default is ".ed", to
each output file from the impurity solver (not the driver !!).
We took care of removing all the ".ed" from the bath input file, +Hfile input variable.
To avoid overwriting or accidental erasing.

Ready to embed into RDMFT.
CODE UPDATE:
- driver for BHZ-AFM tested and running.
- minor changes in ED_OBSERVABLES for pretty printing of the observables.
we got some problems with inequivalent sites or real-space DMFT.
Now the control variables are printed in a separate files at each loop.
The number of the loop is not printed in these files.
UPDATE: parallellism completed removed and stored in a new branch devel_MPI

Waiting for debug there, a serial version is necessary to avoid errors in RDMFT now.
subtle bug:
micro bug remove in the initialization of the bath from scratch.
The very small value of the hybridization vbath seemed to create
problems to the cg_scheme=weiss fitting procedure, by causing the
minimization to flow to large unphysical value of the parameters.

Fixed by requiring that V is at least 0.1.

Slight update of the ED_CHI2FIT.f90 module, with routines re-naming for
better understanding.
In addition re-use of the fg_delta_xxx function is implemented in the
evaluation of the fg_weiss. This ease the calculation and improve reliability.

introduced a variable ed_verbose to handle the general verbosity level of the ED code.
update: ed_verbose update to different level of verbosity for the ED program.
0 = print all (pedantic-mode; DEFAULT)
1 = print major info: no progress, no impG0
2 = print less info: no impG, no timing, partial fit info
3 = print few info (cow-boy mode): only impSigma and observables from impurity at last loop
4 = print almost nothing (crazy mode): only hamiltonian restart and observables at last loop.

Minor modification in the Chi^2 module following update of the OPTIMIZATION_MINIMIZATION in SciFor.
update: BHZ-AFM driver updated with A(k,w) evaluation.

update: added analytic gradient for the chi^2 fit also in the
Superconducting channel for cg_scheme=delta. Test for Bethe lattice
successful.
Merge branch 'devel'

Conflicts:
	ED_AUX_FUNX.f90
	ED_BATH.f90
	ED_CHI2FIT.f90
	ED_DIAG.f90
	ED_GREENS_FUNCTIONS.f90
	ED_HAMILTONIAN.f90
	ED_OBSERVABLES.f90
	MATRIX_SPARSE.f90
	Makefile
	drivers/ed_hm_bethe.f90
	drivers/ed_lda.f90
	ed_full_chi.f90
	ed_htimesv_direct_mpi.f90
	ed_lanc_chi.f90