code updated with all the development from branch:devel
successfull tests for 1 and 2imp PAM.
added Lanczos T=0 code for pd-imp PAM on Bethe lattice.
intermediate edit.
building a multi-band system to solve the pd-problem.
merge by hand with devel_lanczos_mpi and devel
intermediate commitment.
Code updated but not yet tested. Compile up to ED_CHI2FIT, this is ok
because the FIT for multi-band is not yet upgraded.
This is a major update.
multi-orbital code (special case PD-model for the time being) finished.
Compile and runs.
Working on the debug.
first debug completed.
Hubbard model FULLED is working. Crosscheck with devel branch same code, gives
perfect comparison, but the egs. This depends most probably on the fit,given
that the hamiltonian.restart files are very similar but not identical, whereas
all the local and impurity GF are identical within many digits.
I need to debug a little the CHI**2 fit routines.
Go on with more tests.
testing the PAM case with pd-impurity.
First results on the laptop look ok, using a not-so-weird-in-the-end
self-consistency in which all the components of the Delta function but the
pp one are set to zero. This is clear from Bethe lattice self-consistency of
the tdd_PAM (todo): the other components have the form Delta_dd,pd = (at_pp)**2/a**2t_ppG_dd,pd
that in the case of PAM (a=0) disappear.
testing the Lanczos multi-band case. Hubbard model.
first lanczos multi-orbital debug completed.
Hubbard mode give the very same results as single-band code.
Small issues found that should be fixed also in the single-band version:
1. the pointer to groundstate vector should be nullified inside the izero loop over
degenerate groundstate sectors. This is because something can happen to the vector (
manipulating the pointer will affect the vector itself).
This created problem with the calculation of observables in the multi-band code. FIXED.
2. evaluation of GF in lanczos, by adding contribution from particle and hole excitations
was reverted to old-style, for precaution reasons.
3. changed the printing information system within ED_GETOBS. This should allow for
a better data manipulation.
4. IMPORTANT. I noticed that (P)ARPACK has a problem (error exit with floating overflow)
when code is compiled with debugging option and we use normal (non-debugging) libraries.
I am investigating this point.
testing pd-model using lanced_lda driver against lanced_pam_2imp.
Both codes are not working well. So serious debug is in order now.
lanced_pam_2imp shows some misbehavior at low frequency and gives
wrong results when calculating GF on real-axis.
update: I cured the code by imposing that vbath==0 (no direct hopping
from the correlated impurity to the bath) when solving PAM with tdd=0
I should study a method to impose generic condition on the bath.
mid-term commitment. Proceeding with debugging of the multi-band tdd-pam.
Although this model is not strictly necessary is a nice play ground to debug
as I know the solution from single band.
**AT THIS POINT PROBLEMS ARISE FOR THE SELF-ENERGY IN THE IMPURITY
SIGNALING THAT THE MIXED GREEN FUNCTION IS EVALUATED IN A WRONG WAY.
AN IDEA IS TO TEST THE FIRST G_pd AGAINST THE OUTPUT OF 1-IMP CODE
LOCAL NON-DIAGONAL GF.**
updated off-diagonal GF calculation with complex lanczos.
Still not working. Need to compare with previous calculations.
THE STATUS NOW IS THE FOLLOWING:
-debugging lanced_tddpam_2imp VS. lanced_tddpam_bethe (1imp)
at one loop the two codes give different GF.

update:
hint to debug:
1. code the true multi-band Hamiltonian case with interaction over all imp orbitals
2. solve the 1-imp case with N bath sites (N small, i.e. N=3) at 1loop and convergence
3. solve the 2-imp case with 2N bath sites with NO hybridization, decoupled Hubbard problems.
Use N bath sites per impurity by setting to zero the un-necessary link from/to imp.
This corresponds to work in the irreducible base or diagonal local hamiltonian (in this case
no rotation is required). -> the solutions of each imp must be identical and equal to the
already solve 1imp case. The off diagonal GF must be zero
4. restore the general case and turn off interaction. Self-energy must be identically zero for
all components

update2:
talked to M.Capone. Test the tpd=0 decoupled case at 1-loop setting to 0 the bath-hybridizations
mixing the impurity-bath coupling, so to mimick the decoupled bath case.
The entire code has been extended to multi-orbital case in the 'irreducible' representation of the Bath.
This requires that NO correlated orbital-orbital 'hybridizations' are present, which would requires
mixed gf calculations and full bath representation. [this is actually under development in the _nomix branch].
The code was tested for single and two-band case in the Bethe Lattice (easiest) for both FULLED and LANCED channels.
Results are perfect, though some care is needed when solving multi-band with Lanczos: converged is harder to get!
In general I noticed that a large fake-Temperature is needed to converge (that is the code find it hard to resolve
finer energy scales).

I coded the full Kanamori type Hamiltonian with:
-Uloc = same orbital, opposite spins interaction term
-Ust  = different orbital, opposite spins interaction term
-Und  = (Ust-J) different orbital, parallel spins interaction term (Hund's effect)
-Jh   = Spin-Exchange and Pair-Hopping terms, turned off with Jhflag=F
NB: I DID NOT TEST ALL THE INTERACTIONS  TERM, THIS REQUIRE ADDITIONAL NECESSARY WORK.

-->  FURTHER TETS REQUIRED BEFORE TO MERGE WITH STABLE-DEVEL  <--
I would like to perform some additional tests for stability and reliability before
merging with the stable development branch and then to stable branch master.
This is a paranoid-security procedure, to ensure that this codes produces the very same results of
the _devel branch code (one-band).
Merge after some merging errors appeared.
The old devel branch was far behind the devel_multi-orbital_nomix, that indeed was
recreated from a past multi-orbital branch.
I included all the developments from the multi-orbital branch plus the
bug fixed in the devel branch and not yet imported into the multi-orbital one.
Most important is the NBLOCK_LANCZOS_BUG  that raised a problem when the
size of the block was not enough to converge the required eigenvalues.
Now you are allowed to ask for more than 1 [lowest] eigenvalue [T=0], as a future
development in finite temperature calculation, though the code will consider the lowest only.

>>>Merge branch 'devel_multi-orbital_nomix' into devel
<<<The 'devel_multi-orbital_nomix' is to be deleted soon after testing is perfoemd.

Conflicted files:
	ARPACK_LANCZOS.f90
	ED_AUX_FUNX.f90
	ED_BATH.f90
	ED_CHI2FIT.f90
	ED_DIAG.f90
	ED_GETGF.f90
	ED_GETH.f90
	ED_GETOBS.f90
	ED_VARS_GLOBAL.f90
	MATRIX_SPARSE.f90
	Makefile
	drivers/fulled_hm_bethe.f90
	drivers/fulled_lda1b.f90
	drivers/fulled_pam_2imp.f90
	drivers/fulled_pam_bethe.f90
	drivers/lanced_hm_bethe.f90
	drivers/lanced_lda1b.f90
	drivers/lanced_pam_bethe.f90
Small commmitment after devel_multi-orbital_nomix merge with conclicts.
remove included files (now in .repo).
>>> SOME DRIVERS HAVE CONFLICT TO BE FIXED <<<
DRIVERS CONFLICTS RESOLVED. UPDATED BUT NOT TESTED.