qcmplab / cdmft-lanc-ed Goto Github PK
View Code? Open in Web Editor NEWExact Diagonalization solver for Quantum Cluster Problems.
Exact Diagonalization solver for Quantum Cluster Problems.
Ciao,
stavo riguardando il codice e confrontandolo con la versione NONSU2 del single site. Mi sono accorto di una discrepanza che potrebbe avere alcune conseguenze:
la premessa è che questo codice calcola G1=<c†_a+c†_b | c_a+c_b> e G2=<c†_a+ic†_b | c_a-ic_b> per le componenti offdiagonali. Se guardate a linea 96-98 di ED_GF_NORMAL.f90, la G off-diagonale è calcolata come 1/2(G1 -i*G2 -(1-i)G_aa -(1-i)G_bb).
Questo si può verificare controllando per esempio il fatto che il peso a linea 809 e 890 è -xi*norm2, quindi sta effettivamente sottraendo G2.
Ora, se si fa il conto con questa convenzione, quello che vien fuori non è G_ab, ma G_ba, se non ho sbagliato i calcoli.
Infatti questa implementazione risale al vecchio codice single-site, prima che N_up N_dw fossero disaccoppiati (ca. 2017).
Nel repo edipack2.0, adesso, viene usata un'altra convenzione: G1 e G2 sono calcolate come prima, ma la G off-diagonale è calcolata come 1/2(G1 +i*G2 -(1+i)G_aa -(1+i)G_bb), e qui sono d'accordo che questo effettivamente dia G_ab.
Ora, questo nella maggior parte dei casi potrebbe non aver alcun risvolto, ma consideriamo per esempio il BHZ, componenti G_sito12_orb12 e G_sito21_orb21. Queste hanno, per esempio, la parte immaginaria opposta. Non è che questo ci porta a costruire una G, e di conseguenza una Σ, ribaltate?
In ogni caso, una soluzione a questo sarebbe di portare la G anche qui alla nuova convenzione, ossia xi * norm2 e G_ab= 1/2(G1 +i*G2 -(1+i)G_aa -(1+i)G_bb)
as it stands, the norm of vvinit is broadcast in this way, whenever we need to add/remove a particle
if(MpiStatus)then
if(MpiComm /= MPI_COMM_NULL)call Bcast_MPI(MpiComm,norm2)
vecDim = vecDim_Hv_sector(jsector)
allocate(vvloc(vecDim))
if(MpiComm /= MPI_COMM_NULL) call scatter_vector_MPI(MpiComm,vvinit,vvloc)
call sp_lanc_tridiag(MpiComm,spHtimesV_p,vvloc,alfa_,beta_)
this creates an issue when a large number of cores is used, and the vector is small: only the cores in mpi_comm_group will get the norm, the others will get nothing. Then when they creare impG, the weights will all be 0. When they try to invert it in order to get Sigma, they will fail.
The solution can be
a) move the bcast after the delete_hv_sector line, where the communicator is reset
b) implement the new functions added in the single-site code (e.g. tridiag_Hv_sector_normal)
b) is preferred for uniformity and future-proof
As I was performing some initial tests on the incoming changes on fit_overhaul
branch, I noticed something is wrong with the Weiss field analytical gradient, as it is currently on master. By wrong I mean that the fitted field is qualitatively different from the original one, so seriously wrong.
Note that this happens only if I request the analytic gradient: switching to CG_METHOD=1
(minimize routine) solves everything, switching only CG_GRAD=1
but remaining with the NR routine gives the correct fit but takes forever to compute, basically freezing for several minutes (✨holy minimize, mighty va10a✨).
Also note that the hybridization gradient appears to work fine, so maybe the actual problem lies within grad_g0and_replica
. If that's the case I'll hit the wall very soon, when testing the gradients for the new 'elemental' norm. We'll see...
I did not include the real part in the figure for it is basically correct (but not totally: even with the numerical gradient I see some unwanted weight near the origin). Don't know if this could help, but I report it.
No restart file has been used, and here we are at one loop: we do not expect a brilliant fit, but a fair one yes.
I attach down here the input file, so that the problem could be reproduced with the current master head (dc046d8)
I've already added a warning for the user in commit b6351ff (fit_overhaul
), we might want to copy those lines on master without waiting for merge, if this is considered urgent.
inputHM2D.conf
WMIXING=0.500000000 !Mixing bath parameter
TS=2.500000000E-01 !hopping parameter
NX=1 !Number of cluster sites in x direction
NY=1 !Number of cluster sites in y direction
NKX=30 !Number of kx point for BZ integration
NKY=30 !Number of ky point for BZ integration
NLAT=1 !Number of cluster sites
NORB=1 !Number of impurity orbitals (max 5).
NBATH=7 !Number of bath sites:(normal=>Nbath per orb)(hybrid=>Nbath total)(replica=>Nbath=Nreplica)
NSPIN=1 !Number of spin degeneracy (max 2)
ULOC=1.000000000,0.d0,0.d0,0.d0,0.d0 !Values of the local interaction per orbital (max 5)
UST=0.d0 !Value of the inter-orbital interaction term
JH=0.d0 !Hunds coupling
JX=0.d0 !S-E coupling
JP=0.d0 !P-H coupling
BETA=300.000000000 !Inverse temperature, at T=0 is used as a IR cut-off.
XMU=0.d0 !Chemical potential. If HFMODE=T, xmu=0 indicates half-filling condition.
NLOOP=1 !Max number of DMFT iterations.
DMFT_ERROR=1.000000000E-05 !Error threshold for DMFT convergence
SB_FIELD=1.000000000E-01 !Value of a symmetry breaking field for magnetic solutions.
GF_FLAG=T !flag to evaluate GFs and related quantities.
DM_FLAG=F !flag to evaluate the cluster density matrix \rho_IMP = Tr_BATH(\rho))
ED_TWIN=F !flag to reduce (T) or not (F,default) the number of visited sector using twin symmetry.
ED_SECTORS=F !flag to reduce sector scan for the spectrum to specific sectors +/- ed_sectors_shift.
ED_SECTORS_SHIFT=1 !shift to ed_sectors
ED_SPARSE_H=T !flag to select storage of sparse matrix H (mem--, cpu++) if TRUE, or direct on-the-fly H*v product (mem++, cpu--) if FALSE
ED_GF_SYMMETRIC=F !flag to assume Gij = Gji
ED_PRINT_SIGMA=T !flag to print impurity Self-energies
ED_PRINT_G=T !flag to print impurity Greens function
ED_PRINT_G0=T !flag to print non-interacting impurity Greens function
ED_VERBOSE=5 !Verbosity level: 0=almost nothing --> 5:all. Really: all
NSUCCESS=1 !Number of successive iterations below threshold for convergence
LMATS=5000 !Number of Matsubara frequencies.
LREAL=5000 !Number of real-axis frequencies.
LTAU=1024 !Number of imaginary time points.
LFIT=1000 !Number of Matsubara frequencies used in the \Chi2 fit.
NREAD=0.d0 !Objective density for fixed density calculations.
NERR=1.000000000E-04 !Error threshold for fixed density calculations.
NDELTA=1.000000000E-01 !Initial step for fixed density calculations.
NCOEFF=1.000000000 !multiplier for the initial ndelta read from a file (ndelta-->ndelta*ncoeff).
WINI=-5.000000000 !Smallest real-axis frequency
WFIN=5.000000000 !Largest real-axis frequency
HFMODE=T !Flag to set the Hartree form of the interaction (n-1/2). see xmu.
EPS=1.000000000E-02 !Broadening on the real-axis.
CUTOFF=1.000000000E-09 !Spectrum cut-off, used to determine the number states to be retained.
GS_THRESHOLD=1.000000000E-09 !Energy threshold for ground state degeneracy loop up
HWBAND=2.000000000 !half-bandwidth for the bath initialization: flat in -hwband:hwband
LANC_METHOD=arpack !select the lanczos method to be used in the determination of the spectrum. ARPACK (default), LANCZOS (T=0 only), DVDSON (no MPI)
LANC_NSTATES_SECTOR=2 !Initial number of states per sector to be determined.
LANC_NSTATES_TOTAL=1 !Initial number of total states to be determined.
LANC_NSTATES_STEP=2 !Number of states added to the spectrum at each step.
LANC_NCV_FACTOR=10 !Set the size of the block used in Lanczos-Arpack by multiplying the required Neigen (Ncv=lanc_ncv_factor*Neigen+lanc_ncv_add)
LANC_NCV_ADD=0 !Adds up to the size of the block to prevent it to become too small (Ncv=lanc_ncv_factor*Neigen+lanc_ncv_add)
LANC_NITER=512 !Number of Lanczos iteration in spectrum determination.
LANC_NGFITER=200 !Number of Lanczos iteration in GF determination. Number of momenta.
LANC_TOLERANCE=1.000000000E-12 !Tolerance for the Lanczos iterations as used in Arpack and plain lanczos.
LANC_DIM_THRESHOLD=1024 !Min dimension threshold to use Lanczos determination of the spectrum rather than Lapack based exact diagonalization.
CG_METHOD=0 !Conjugate-Gradient method: 0=NR, 1=minimize.
CG_GRAD=0 !Gradient evaluation method: 0=analytic (default), 1=numeric.
CG_FTOL=1.000000000E-05 !Conjugate-Gradient tolerance.
CG_STOP=0 !Conjugate-Gradient stopping condition: 0-3, 0=C1.AND.C2, 1=C1, 2=C2 with C1=|F_n-1 -F_n|<tol*(1+F_n), C2=||x_n-1 -x_n||<tol*(1+||x_n||).
CG_NITER=500 !Max. number of Conjugate-Gradient iterations.
CG_WEIGHT=1 !Conjugate-Gradient weight form: 1=1.0, 2=1/n , 3=1/w_n.
CG_SCHEME=weiss !Conjugate-Gradient fit scheme: delta or weiss.
CG_POW=2 !Fit power for the calculation of the Chi distance function as 1/L*|G0 - G0and|**cg_pow
CG_MINIMIZE_VER=F !Flag to pick old/.false. (Krauth) or new/.true. (Lichtenstein) version of the minimize CG routine
CG_MINIMIZE_HH=1.000000000E-04 !Unknown parameter used in the CG minimize procedure.
HFILE=hamiltonian !File where to retrieve/store the bath parameters.
IMPHFILE=inputHLOC.in !File read the input local H.
LOGFILE=6 !LOG unit.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.