Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Kazuyoshi Yoshimi authored and Kazuyoshi Yoshimi committed Nov 29, 2022
2 parents 2cd7e12 + 28018cb commit 69cd4fe
Show file tree
Hide file tree
Showing 10 changed files with 1,003 additions and 32 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@ modules.order
Module.symvers
Mkfile.old
dkms.conf

# Machine-specific Configuration File
make.sys
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set(SOURCES_StdFace
include_directories(sfmt)
add_definitions(-DMEXP=19937)

add_library(StdFace STATIC ChainLattice.c HoneycombLattice.c SquareLattice.c StdFace_main.c StdFace_ModelUtil.c TriangularLattice.c Ladder.c Kagome.c Orthorhombic.c Pyrochlore.c Wannier90.c FCOrtho.c setmemory.c)
add_library(StdFace STATIC ChainLattice.c HoneycombLattice.c SquareLattice.c StdFace_main.c StdFace_ModelUtil.c TriangularLattice.c Ladder.c Kagome.c Orthorhombic.c Pyrochlore.c Wannier90.c FCOrtho.c setmemory.c export_wannier90.c)

if (UHF)
add_executable(uhf_dry.out dry.c)
Expand Down
12 changes: 6 additions & 6 deletions src/FCOrtho.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ void StdFace_FCOrtho(
StdFace_PrintVal_d("Llength", &StdI->length[1], StdI->a);
StdFace_PrintVal_d("Hlength", &StdI->length[2], StdI->a);
StdFace_PrintVal_d("Wx", &StdI->direct[0][0], 0.0);
StdFace_PrintVal_d("Wy", &StdI->direct[0][1], 0.5 * StdI->length[0]);
StdFace_PrintVal_d("Wz", &StdI->direct[0][2], 0.5 * StdI->length[0]);
StdFace_PrintVal_d("Lx", &StdI->direct[1][0], 0.5 * StdI->length[1]);
StdFace_PrintVal_d("Wy", &StdI->direct[0][1], 0.5 * StdI->length[1]);
StdFace_PrintVal_d("Wz", &StdI->direct[0][2], 0.5 * StdI->length[2]);
StdFace_PrintVal_d("Lx", &StdI->direct[1][0], 0.5 * StdI->length[0]);
StdFace_PrintVal_d("Ly", &StdI->direct[1][1], 0.0);
StdFace_PrintVal_d("Lz", &StdI->direct[1][2], 0.5 * StdI->length[1]);
StdFace_PrintVal_d("Hx", &StdI->direct[2][0], 0.5 * StdI->length[2]);
StdFace_PrintVal_d("Hy", &StdI->direct[2][1], 0.5 * StdI->length[2]);
StdFace_PrintVal_d("Lz", &StdI->direct[1][2], 0.5 * StdI->length[2]);
StdFace_PrintVal_d("Hx", &StdI->direct[2][0], 0.5 * StdI->length[0]);
StdFace_PrintVal_d("Hy", &StdI->direct[2][1], 0.5 * StdI->length[1]);
StdFace_PrintVal_d("Hz", &StdI->direct[2][2], 0.0);

StdFace_PrintVal_d("phase0", &StdI->phase[0], 0.0);
Expand Down
2 changes: 1 addition & 1 deletion src/Orthorhombic.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void StdFace_Orthorhombic(
StdFace_PrintVal_d("Lz", &StdI->direct[1][2], 0.0);
StdFace_PrintVal_d("Hx", &StdI->direct[2][0], 0.0);
StdFace_PrintVal_d("Hy", &StdI->direct[2][1], 0.0);
StdFace_PrintVal_d("Hz", &StdI->direct[2][2], StdI->length[1]);
StdFace_PrintVal_d("Hz", &StdI->direct[2][2], StdI->length[2]);

StdFace_PrintVal_d("phase0", &StdI->phase[0], 0.0);
StdFace_PrintVal_d("phase1", &StdI->phase[1], 0.0);
Expand Down
12 changes: 6 additions & 6 deletions src/Pyrochlore.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ void StdFace_Pyrochlore(
StdFace_PrintVal_d("Llength", &StdI->length[1], StdI->a);
StdFace_PrintVal_d("Hlength", &StdI->length[2], StdI->a);
StdFace_PrintVal_d("Wx", &StdI->direct[0][0], 0.0);
StdFace_PrintVal_d("Wy", &StdI->direct[0][1], 0.5 * StdI->length[0]);
StdFace_PrintVal_d("Wz", &StdI->direct[0][2], 0.5 * StdI->length[0]);
StdFace_PrintVal_d("Lx", &StdI->direct[1][0], 0.5 * StdI->length[1]);
StdFace_PrintVal_d("Wy", &StdI->direct[0][1], 0.5 * StdI->length[1]);
StdFace_PrintVal_d("Wz", &StdI->direct[0][2], 0.5 * StdI->length[2]);
StdFace_PrintVal_d("Lx", &StdI->direct[1][0], 0.5 * StdI->length[0]);
StdFace_PrintVal_d("Ly", &StdI->direct[1][1], 0.0);
StdFace_PrintVal_d("Lz", &StdI->direct[1][2], 0.5 * StdI->length[1]);
StdFace_PrintVal_d("Hx", &StdI->direct[2][0], 0.5 * StdI->length[2]);
StdFace_PrintVal_d("Hy", &StdI->direct[2][1], 0.5 * StdI->length[2]);
StdFace_PrintVal_d("Lz", &StdI->direct[1][2], 0.5 * StdI->length[2]);
StdFace_PrintVal_d("Hx", &StdI->direct[2][0], 0.5 * StdI->length[0]);
StdFace_PrintVal_d("Hy", &StdI->direct[2][1], 0.5 * StdI->length[1]);
StdFace_PrintVal_d("Hz", &StdI->direct[2][2], 0.0);

StdFace_PrintVal_d("phase0", &StdI->phase[0], 0.0);
Expand Down
37 changes: 36 additions & 1 deletion src/StdFace_ModelUtil.c
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,17 @@ void StdFace_PrintXSF(struct StdIntList *StdI) {
FILE *fp;
int ii, jj, kk, isite, iCell;
double vec[3];

int do_convvec;

do_convvec = 0;
if (strcmp(StdI->lattice, "orthorhombic") == 0
|| strcmp(StdI->lattice, "face-centeredorthorhombic") == 0
|| strcmp(StdI->lattice, "fcorthorhombic") == 0
|| strcmp(StdI->lattice, "fco") == 0
|| strcmp(StdI->lattice, "pyrochlore") == 0) {
do_convvec = 1;
}

fp = fopen("lattice.xsf", "w");
fprintf(fp, "CRYSTAL\n");
fprintf(fp, "PRIMVEC\n");
Expand All @@ -955,6 +965,19 @@ void StdFace_PrintXSF(struct StdIntList *StdI) {
}
fprintf(fp, "%15.5f %15.5f %15.5f\n", vec[0], vec[1], vec[2]);
}
if (do_convvec) {
fprintf(fp, "CONVVEC\n");
for (ii = 0; ii < 3; ++ii) {
for (jj = 0; jj < 3; ++jj) {
if (ii == jj) {
fprintf(fp, "%15.5f ", StdI->length[ii]);
} else {
fprintf(fp, "%15.5f ", 0.0);
}
}
fprintf(fp, "\n");
}
}
fprintf(fp, "PRIMCOORD\n");
fprintf(fp, "%d 1\n", StdI->NCell * StdI->NsiteUC);
for (iCell = 0; iCell < StdI->NCell; iCell++) {
Expand Down Expand Up @@ -1159,6 +1182,13 @@ void StdFace_InputHopp(
@brief Print geometry of sites for the pos-process of correlation function
*/
void StdFace_PrintGeometry(struct StdIntList *StdI) {

#if defined(_UHF)
if (strcmp(StdI->calcmode, "uhfk") == 0) {
/* suppress output geometry.dat in UHFk mode */
} else {
#endif

FILE *fp;
int isite, iCell, ii;

Expand Down Expand Up @@ -1195,6 +1225,11 @@ void StdFace_PrintGeometry(struct StdIntList *StdI) {
}
fflush(fp);
fclose(fp);

#if defined(_UHF)
}
#endif

}/*void StdFace_PrintGeometry()*/
/**
@brief Malloc Arrays for interactions
Expand Down
81 changes: 64 additions & 17 deletions src/StdFace_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ The following lattices are supported:
#include "StdFace_vals.h"
#include "StdFace_ModelUtil.h"
#include <complex.h>
#if defined(_UHF)
#include "export_wannier90.h"
#endif

#if defined(_HPhi)
/**
Expand Down Expand Up @@ -83,7 +86,7 @@ static void PrintCalcMod(struct StdIntList *StdI)
{
FILE *fp;
int iCalcType, iCalcModel, iRestart, iCalcSpec,
iCalcEigenvec, iInitialVecTpye, InputEigenVec, OutputEigenVec,
iCalcEigenvec, iInitialVecType, InputEigenVec, OutputEigenVec,
iInputHam, iOutputHam, iOutputExVec;
/*
First, check all parameters and exit if invalid parameters
Expand Down Expand Up @@ -155,14 +158,14 @@ static void PrintCalcMod(struct StdIntList *StdI)
strcpy(StdI->InitialVecType, "c\0");
fprintf(stdout, " InitialVecType = c ###### DEFAULT VALUE IS USED ######\n");
if (strcmp(StdI->method, "tpq") == 0 || strcmp(StdI->method, "ctpq") == 0)
iInitialVecTpye = -1;
iInitialVecType = -1;
else
iInitialVecTpye = 0;
iInitialVecType = 0;
}/*if (strcmp(StdI->InitialVecType, "****") == 0)*/
else {
fprintf(stdout, " InitialVecType = %s\n", StdI->InitialVecType);
if (strcmp(StdI->InitialVecType, "c") == 0) iInitialVecTpye = 0;
else if (strcmp(StdI->InitialVecType, "r") == 0) iInitialVecTpye = 1;
if (strcmp(StdI->InitialVecType, "c") == 0) iInitialVecType = 0;
else if (strcmp(StdI->InitialVecType, "r") == 0) iInitialVecType = 1;
else {
fprintf(stdout, "\n ERROR ! Restart Mode : %s\n", StdI->Restart);
StdFace_exit(-1);
Expand Down Expand Up @@ -285,7 +288,7 @@ static void PrintCalcMod(struct StdIntList *StdI)
fprintf(fp, "ReStart %3d\n", iRestart);
fprintf(fp, "CalcSpec %3d\n", iCalcSpec);
fprintf(fp, "CalcEigenVec %3d\n", iCalcEigenvec);
fprintf(fp, "InitialVecType %3d\n", iInitialVecTpye);
fprintf(fp, "InitialVecType %3d\n", iInitialVecType);
fprintf(fp, "InputEigenVec %3d\n", InputEigenVec);
fprintf(fp, "OutputEigenVec %3d\n", OutputEigenVec);
fprintf(fp, "InputHam %3d\n", iInputHam);
Expand Down Expand Up @@ -1120,6 +1123,9 @@ static void StdFace_ResetVals(struct StdIntList *StdI) {
StdI->Hsub = StdI->NaN_i;
StdI->Lsub = StdI->NaN_i;
StdI->Wsub = StdI->NaN_i;
strcpy(StdI->calcmode, "****\0");
strcpy(StdI->fileprefix, "****\0");
StdI->export_all = StdI->NaN_i;
#endif
}/*static void StdFace_ResetVals*/
/*
Expand Down Expand Up @@ -1606,7 +1612,7 @@ static void Print1Green(struct StdIntList *StdI)
}/*for (ispin = 0; ispin <= SiMax; ispin++)*/
}/*for (isite = 0; isite < StdI->nsite; isite++)*/
}/*if (StdI->ioutputmode == 2)*/
}/*if (StdI->ioutputmode != 0)*/
}/*for (store = 0; store < 2; store++))*/

fp = fopen("greenone.def", "w");
fprintf(fp, "===============================\n");
Expand Down Expand Up @@ -1899,7 +1905,7 @@ static void CheckModPara(struct StdIntList *StdI)
StdFace_NotUsed_i("NSPStot", StdI->NSPStot);
}

if (StdI->AntiPeriod[0] == 1 || StdI->AntiPeriod[1] == 1 || StdI->AntiPeriod[2] == 2)
if (StdI->AntiPeriod[0] == 1 || StdI->AntiPeriod[1] == 1 || StdI->AntiPeriod[2] == 1)
StdFace_PrintVal_i("NMPTrans", &StdI->NMPTrans, -1);
else StdFace_PrintVal_i("NMPTrans", &StdI->NMPTrans, 1);

Expand Down Expand Up @@ -2784,6 +2790,12 @@ void StdFace_main(
else if (strcmp(keyword, "hsub") == 0) StoreWithCheckDup_i(keyword, value, &StdI->Hsub);
else if (strcmp(keyword, "lsub") == 0) StoreWithCheckDup_i(keyword, value, &StdI->Lsub);
else if (strcmp(keyword, "wsub") == 0) StoreWithCheckDup_i(keyword, value, &StdI->Wsub);
else if (strcmp(keyword, "eps") == 0) StoreWithCheckDup_i(keyword, value, &StdI->eps);
else if (strcmp(keyword, "epsslater") == 0) StoreWithCheckDup_i(keyword, value, &StdI->eps_slater);
else if (strcmp(keyword, "mix") == 0) StoreWithCheckDup_d(keyword, value, &StdI->mix);
else if (strcmp(keyword, "calcmode") == 0) StoreWithCheckDup_sl(keyword, value, StdI->calcmode);
else if (strcmp(keyword, "fileprefix") == 0) StoreWithCheckDup_sl(keyword, value, StdI->fileprefix);
else if (strcmp(keyword, "exportall") == 0) StoreWithCheckDup_i(keyword, value, &StdI->export_all);
#endif
else {
fprintf(stdout, "ERROR ! Unsupported Keyword in Standard mode!\n");
Expand Down Expand Up @@ -2906,20 +2918,36 @@ void StdFace_main(
fprintf(stdout, "\n");
fprintf(stdout, "###### Print Expert input files ######\n");
fprintf(stdout, "\n");

#if defined(_HPhi)
PrintLocSpin(StdI);
PrintTrans(StdI);
PrintInteractions(StdI);
CheckModPara(StdI);
PrintModPara(StdI);
#if defined(_HPhi)
PrintModPara(StdI);

PrintExcitation(StdI);
if (strcmp(StdI->method, "timeevolution") == 0) PrintPump(StdI);
PrintCalcMod(StdI);

CheckOutputMode(StdI);
Print1Green(StdI);
Print2Green(StdI);

PrintNamelist(StdI);

#elif defined(_mVMC)
PrintLocSpin(StdI);
PrintTrans(StdI);
PrintInteractions(StdI);
CheckModPara(StdI);
PrintModPara(StdI);

if(StdI->lGC == 0 && (StdI->Sz2 == 0 || StdI->Sz2 == StdI->NaN_i))
if (StdI->lGC == 0 && (StdI->Sz2 == 0 || StdI->Sz2 == StdI->NaN_i)) {
StdFace_PrintVal_i("ComplexType", &StdI->ComplexType, 0);
else StdFace_PrintVal_i("ComplexType", &StdI->ComplexType, 1);
} else {
StdFace_PrintVal_i("ComplexType", &StdI->ComplexType, 1);
}

StdFace_generate_orb(StdI);
StdFace_Proj(StdI);
Expand All @@ -2928,15 +2956,34 @@ void StdFace_main(
PrintOrbPara(StdI);
PrintGutzwiller(StdI);
PrintOrb(StdI);
#endif

CheckOutputMode(StdI);
Print1Green(StdI);
#if defined(_HPhi)
Print2Green(StdI);
#elif defined(_mVMC)
Print2Green(StdI);
#endif

PrintNamelist(StdI);

#elif defined(_UHF)
if (strcmp(StdI->calcmode, "uhfk") != 0) { /* UHF */

PrintLocSpin(StdI);
PrintTrans(StdI);
PrintInteractions(StdI);
CheckModPara(StdI);
PrintModPara(StdI);

CheckOutputMode(StdI);
Print1Green(StdI);

PrintNamelist(StdI);

} else { /* UHFk */

ExportGeometry(StdI);
ExportInteraction(StdI);

}
#endif
/*
Finalize All
*/
Expand Down
4 changes: 4 additions & 0 deletions src/StdFace_vals.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,10 @@ struct StdIntList {
int NCellsub;/**<@brief Number of cells in a sublattice*/
int boxsub[3][3];/**<@brief Sublattice*/
int rboxsub[3][3];/**<@brief Sublattice*/

char calcmode[256];/**<@brief Calculation Mode: UHF, UHFk */
char fileprefix[256];/**<@brief Prefix of output filenames */
int export_all;/**<@brief output zero elements in UHFk mode */
#endif

};
Loading

0 comments on commit 69cd4fe

Please sign in to comment.