Skip to content

Commit

Permalink
Unify to HPhi 7eb9d81fe504a89861eb570f492bd48748ab8385
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsuaki1987 committed Aug 22, 2017
1 parent 3381d84 commit 63d25b8
Show file tree
Hide file tree
Showing 16 changed files with 993 additions and 877 deletions.
63 changes: 32 additions & 31 deletions src/StdFace/ChainLattice.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**@file
@brief Standard mode for the chain lattice
*/
#include "StdFace_vals.h"
#include <stdlib.h>
#include <stdio.h>
Expand All @@ -24,24 +27,23 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <string.h>

/**
*
* Setup a Hamiltonian for the Hubbard model on a Chain lattice
*
* @author Mitsuaki Kawamura (The University of Tokyo)
*/
void StdFace_Chain(struct StdIntList *StdI, char *model)
@brief Setup a Hamiltonian for the Hubbard model on a Chain lattice
@author Mitsuaki Kawamura (The University of Tokyo)
*/
void StdFace_Chain(
struct StdIntList *StdI//!<[inout]
)
{
FILE *fp;
int isite, jsite;
int isite, jsite, ntransMax, nintrMax;
int iL;
double complex Cphase;

/**/
fprintf(stdout, "\n");
fprintf(stdout, "####### Parameter Summary #######\n");
fprintf(stdout, "\n");
/*
Initialize Cell
/**@brief
(1) Compute the shape of the super-cell and sites in the super-cell
*/
fp = fopen("lattice.gp", "w");
/**/
Expand All @@ -67,7 +69,9 @@ void StdFace_Chain(struct StdIntList *StdI, char *model)
StdI->W = 1;
StdFace_InitSite(StdI, fp, 2);
StdI->tau[0][0] = 0.0; StdI->tau[0][1] = 0.0; StdI->tau[0][2] = 0.0;
/**/
/**@brief
(2) check & store parameters of Hamiltonian
*/
fprintf(stdout, "\n @ Hamiltonian \n\n");
StdFace_NotUsed_J("J1", StdI->J1All, StdI->J1);
StdFace_NotUsed_J("J2", StdI->J2All, StdI->J2);
Expand Down Expand Up @@ -122,8 +126,9 @@ void StdFace_Chain(struct StdIntList *StdI, char *model)
}
}/*if (strcmp(StdI->model, "spin") != 0 )*/
fprintf(stdout, "\n @ Numerical conditions\n\n");
/*
Local Spin
/**@brief
(3) Set local spin flag (StdIntList::locspinflag) and
the number of sites (StdIntList::nsite)
*/
StdI->nsite = StdI->L;
if (strcmp(StdI->model, "kondo") == 0 ) StdI->nsite *= 2;
Expand All @@ -138,30 +143,28 @@ void StdFace_Chain(struct StdIntList *StdI, char *model)
StdI->locspinflag[isite] = StdI->S2;
StdI->locspinflag[isite + StdI->nsite / 2] = 0;
}
/*
The number of Transfer & Interaction
/**@brief
(4) Compute the upper limit of the number of Transfer & Interaction and malloc them.
*/
if (strcmp(StdI->model, "spin") == 0 ) {
StdI->ntrans = StdI->L * (StdI->S2 + 1/*h*/ + 2 * StdI->S2/*Gamma*/);
StdI->nintr = StdI->L * (StdI->NsiteUC/*D*/ + 1/*J*/ + 1/*J'*/)
ntransMax = StdI->L * (StdI->S2 + 1/*h*/ + 2 * StdI->S2/*Gamma*/);
nintrMax = StdI->L * (StdI->NsiteUC/*D*/ + 1/*J*/ + 1/*J'*/)
* (3 * StdI->S2 + 1) * (3 * StdI->S2 + 1);
}
else {
StdI->ntrans = StdI->L * 2/*spin*/ * (2 * StdI->NsiteUC/*mu+h+Gamma*/ + 2/*t*/ + 2/*t'*/);
StdI->nintr = StdI->L * (StdI->NsiteUC/*U*/ + 4 * (1/*V*/ + 1/*V'*/));
ntransMax = StdI->L * 2/*spin*/ * (2 * StdI->NsiteUC/*mu+h+Gamma*/ + 2/*t*/ + 2/*t'*/);
nintrMax = StdI->L * (StdI->NsiteUC/*U*/ + 4 * (1/*V*/ + 1/*V'*/));

if (strcmp(StdI->model, "kondo") == 0) {
StdI->ntrans += StdI->L * (StdI->S2 + 1/*h*/ + 2 * StdI->S2/*Gamma*/);
StdI->nintr += StdI->nsite / 2 * (3 * 1 + 1) * (3 * StdI->S2 + 1);
ntransMax += StdI->L * (StdI->S2 + 1/*h*/ + 2 * StdI->S2/*Gamma*/);
nintrMax += StdI->nsite / 2 * (3 * 1 + 1) * (3 * StdI->S2 + 1);
}/*if (strcmp(StdI->model, "kondo") == 0)*/
}
/**/
StdFace_MallocInteractions(StdI);
/*
Set Transfer & Interaction
StdFace_MallocInteractions(StdI, ntransMax, nintrMax);
/**@brief
(5) Set Transfer & Interaction
*/
StdI->ntrans = 0;
StdI->nintr = 0;
for (iL = 0; iL < StdI->L; iL++){

isite = iL;
Expand All @@ -171,7 +174,7 @@ void StdFace_Chain(struct StdIntList *StdI, char *model)
*/
if (strcmp(StdI->model, "spin") == 0 ) {
StdFace_MagField(StdI, StdI->S2, -StdI->h, -StdI->Gamma, isite);
StdFace_GeneralJ(StdI, StdI->D, StdI->S2, StdI->S2, isite, jsite);
StdFace_GeneralJ(StdI, StdI->D, StdI->S2, StdI->S2, isite, isite);
}/*if (strcmp(StdI->model, "spin") == 0 )*/
else {
StdFace_HubbardLocal(StdI, StdI->mu, -StdI->h, -StdI->Gamma, StdI->U, isite);
Expand Down Expand Up @@ -214,10 +217,8 @@ void StdFace_Chain(struct StdIntList *StdI, char *model)

#if defined(_HPhi)
/**
*
* Setup a Hamiltonian for the generalized Heisenberg model on a Chain lattice
*
* @author Mitsuaki Kawamura (The University of Tokyo)
@brief Setup a Hamiltonian for the generalized Heisenberg model on a Chain lattice
@author Mitsuaki Kawamura (The University of Tokyo)
*/
void StdFace_Chain_Boost(struct StdIntList *StdI)
{
Expand Down
54 changes: 29 additions & 25 deletions src/StdFace/FCOrtho.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**@file
@brief Standard mode for the face centered orthorhombic lattice
*/
#include "StdFace_vals.h"
#include "StdFace_ModelUtil.h"
#include <stdlib.h>
Expand All @@ -24,23 +27,23 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <string.h>

/**
*
* Setup a Hamiltonian for the Face-Centered Orthorhombic lattice
*
* @author Mitsuaki Kawamura (The University of Tokyo)
*/
void StdFace_FCOrtho(struct StdIntList *StdI, char *model)
@brief Setup a Hamiltonian for the Face-Centered Orthorhombic lattice
@author Mitsuaki Kawamura (The University of Tokyo)
*/
void StdFace_FCOrtho(
struct StdIntList *StdI//!<[inout]
)
{
int isite, jsite;
int isite, jsite, ntransMax, nintrMax;
int iL, iW, iH, kCell;
FILE *fp;
double complex Cphase;

fprintf(stdout, "\n");
fprintf(stdout, "####### Parameter Summary #######\n");
fprintf(stdout, "\n");
/*
Initialize Cell
/**@brief
(1) Compute the shape of the super-cell and sites in the super-cell
*/
fp = fopen("lattice.xsf", "w");
/**/
Expand Down Expand Up @@ -68,7 +71,9 @@ void StdFace_FCOrtho(struct StdIntList *StdI, char *model)
/**/
StdFace_InitSite(StdI, fp, 3);
StdI->tau[0][0] = 0.0; StdI->tau[0][1] = 0.0; ; StdI->tau[0][2] = 0.0;
/**/
/**@brief
(2) check & store parameters of Hamiltonian
*/
fprintf(stdout, "\n @ Hamiltonian \n\n");
StdFace_NotUsed_d("K", StdI->K);
StdFace_PrintVal_d("h", &StdI->h, 0.0);
Expand Down Expand Up @@ -137,8 +142,9 @@ void StdFace_FCOrtho(struct StdIntList *StdI, char *model)

}/*if (model != "spin")*/
fprintf(stdout, "\n @ Numerical conditions\n\n");
/*
Local Spin
/**@brief
(3) Set local spin flag (StdIntList::locspinflag) and
the number of sites (StdIntList::nsite)
*/
StdI->nsite = StdI->NsiteUC * StdI->NCell;
if (strcmp(StdI->model, "kondo") == 0 ) StdI->nsite *= 2;
Expand All @@ -153,30 +159,28 @@ void StdFace_FCOrtho(struct StdIntList *StdI, char *model)
StdI->locspinflag[iL] = StdI->S2;
StdI->locspinflag[iL + StdI->nsite / 2] = 0;
}
/*
The number of Transfer & Interaction
/**@brief
(4) Compute the upper limit of the number of Transfer & Interaction and malloc them.
*/
if (strcmp(StdI->model, "spin") == 0 ) {
StdI->ntrans = StdI->nsite * (StdI->S2 + 1/*h*/ + 2 * StdI->S2/*Gamma*/);
StdI->nintr = StdI->NCell * (StdI->NsiteUC/*D*/ + 6/*J*/ + 3/*J'*/ + 0/*J''*/)
ntransMax = StdI->nsite * (StdI->S2 + 1/*h*/ + 2 * StdI->S2/*Gamma*/);
nintrMax = StdI->NCell * (StdI->NsiteUC/*D*/ + 6/*J*/ + 3/*J'*/ + 0/*J''*/)
* (3 * StdI->S2 + 1) * (3 * StdI->S2 + 1);
}
else {
StdI->ntrans = StdI->NCell * 2/*spin*/ * (2 * StdI->NsiteUC/*mu+h+Gamma*/ + 12/*t*/ + 6/*t'*/ + 0/*t''*/);
StdI->nintr = StdI->NCell * (StdI->NsiteUC/*U*/ + 4 * (6/*V*/ + 3/*V'*/ + 0/*V''*/));
ntransMax = StdI->NCell * 2/*spin*/ * (2 * StdI->NsiteUC/*mu+h+Gamma*/ + 12/*t*/ + 6/*t'*/ + 0/*t''*/);
nintrMax = StdI->NCell * (StdI->NsiteUC/*U*/ + 4 * (6/*V*/ + 3/*V'*/ + 0/*V''*/));

if (strcmp(StdI->model, "kondo") == 0) {
StdI->ntrans += StdI->nsite / 2 * (StdI->S2 + 1/*h*/ + 2 * StdI->S2/*Gamma*/);
StdI->nintr += StdI->nsite / 2 * (3 * StdI->S2 + 1) * (3 * StdI->S2 + 1);
ntransMax += StdI->nsite / 2 * (StdI->S2 + 1/*h*/ + 2 * StdI->S2/*Gamma*/);
nintrMax += StdI->nsite / 2 * (3 * StdI->S2 + 1) * (3 * StdI->S2 + 1);
}/*if (strcmp(StdI->model, "kondo") == 0)*/
}
/**/
StdFace_MallocInteractions(StdI);
/*
Set Transfer & Interaction
StdFace_MallocInteractions(StdI, ntransMax, nintrMax);
/**@brief
(5) Set Transfer & Interaction
*/
StdI->ntrans = 0;
StdI->nintr = 0;
for (kCell = 0; kCell < StdI->NCell; kCell++){
/**/
iW = StdI->Cell[kCell][0];
Expand Down
52 changes: 27 additions & 25 deletions src/StdFace/HoneycombLattice.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**@file
@brief Standard mode for the honeycomb lattice
*/
#include "StdFace_vals.h"
#include "StdFace_ModelUtil.h"
#include <stdlib.h>
Expand All @@ -24,23 +27,21 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <string.h>

/**
*
* Setup a Hamiltonian for the Hubbard model on a Honeycomb lattice
*
* @author Mitsuaki Kawamura (The University of Tokyo)
*/
void StdFace_Honeycomb(struct StdIntList *StdI, char *model)
@brief Setup a Hamiltonian for the Hubbard model on a Honeycomb lattice
@author Mitsuaki Kawamura (The University of Tokyo)
*/
void StdFace_Honeycomb(struct StdIntList *StdI)
{
int isite, jsite, kCell;
int isite, jsite, kCell, ntransMax, nintrMax;
int iL, iW;
FILE *fp;
double complex Cphase;

fprintf(stdout, "\n");
fprintf(stdout, "####### Parameter Summary #######\n");
fprintf(stdout, "\n");
/*
Initialize Cell
/**@brief
(1) Compute the shape of the super-cell and sites in the super-cell
*/
fp = fopen("lattice.gp", "w");
/**/
Expand All @@ -62,7 +63,9 @@ void StdFace_Honeycomb(struct StdIntList *StdI, char *model)
StdFace_InitSite(StdI, fp, 2);
StdI->tau[0][0] = 0.0; StdI->tau[0][1] = 0.0; StdI->tau[0][2] = 0.0;
StdI->tau[1][0] = 1.0 / 3.0; StdI->tau[1][1] = 1.0 / 3.0; StdI->tau[1][2] = 0.0;
/**/
/**@brief
(2) check & store parameters of Hamiltonian
*/
fprintf(stdout, "\n @ Hamiltonian \n\n");
StdFace_NotUsed_J("J1'", StdI->J1pAll, StdI->J1p);
StdFace_NotUsed_J("J2'", StdI->J2pAll, StdI->J2p);
Expand Down Expand Up @@ -125,8 +128,9 @@ void StdFace_Honeycomb(struct StdIntList *StdI, char *model)

}/*if (model != "spin")*/
fprintf(stdout, "\n @ Numerical conditions\n\n");
/*
Local Spin
/**@brief
(3) Set local spin flag (StdIntList::locspinflag) and
the number of sites (StdIntList::nsite)
*/
StdI->nsite = StdI->NsiteUC * StdI->NCell;
if (strcmp(StdI->model, "kondo") == 0 ) StdI->nsite *= 2;
Expand All @@ -141,30 +145,28 @@ void StdFace_Honeycomb(struct StdIntList *StdI, char *model)
StdI->locspinflag[iL] = StdI->S2;
StdI->locspinflag[iL + StdI->nsite / 2] = 0;
}
/*
The number of Transfer & Interaction
/**@brief
(4) Compute the upper limit of the number of Transfer & Interaction and malloc them.
*/
if (strcmp(StdI->model, "spin") == 0 ) {
StdI->ntrans = StdI->nsite * (StdI->S2 + 1/*h*/ + 2 * StdI->S2/*Gamma*/);
StdI->nintr = StdI->NCell * (StdI->NsiteUC/*D*/ + 3/*J*/ + 6/*J'*/)
ntransMax = StdI->nsite * (StdI->S2 + 1/*h*/ + 2 * StdI->S2/*Gamma*/);
nintrMax = StdI->NCell * (StdI->NsiteUC/*D*/ + 3/*J*/ + 6/*J'*/)
* (3 * StdI->S2 + 1) * (3 * StdI->S2 + 1);
}
else {
StdI->ntrans = StdI->NCell * 2/*spin*/ * (2 * StdI->NsiteUC/*mu+h+Gamma*/ + 6/*t*/ + 12/*t'*/);
StdI->nintr = StdI->NCell * (StdI->NsiteUC/*U*/ + 4 * (3/*V*/ + 6/*V'*/));
ntransMax = StdI->NCell * 2/*spin*/ * (2 * StdI->NsiteUC/*mu+h+Gamma*/ + 6/*t*/ + 12/*t'*/);
nintrMax = StdI->NCell * (StdI->NsiteUC/*U*/ + 4 * (3/*V*/ + 6/*V'*/));

if (strcmp(StdI->model, "kondo") == 0) {
StdI->ntrans += StdI->nsite / 2 * (StdI->S2 + 1/*h*/ + 2 * StdI->S2/*Gamma*/);
StdI->nintr += StdI->nsite / 2 * (3 * StdI->S2 + 1) * (3 * StdI->S2 + 1);
ntransMax += StdI->nsite / 2 * (StdI->S2 + 1/*h*/ + 2 * StdI->S2/*Gamma*/);
nintrMax += StdI->nsite / 2 * (3 * StdI->S2 + 1) * (3 * StdI->S2 + 1);
}/*if (strcmp(StdI->model, "kondo") == 0)*/
}
/**/
StdFace_MallocInteractions(StdI);
/*
Set Transfer & Interaction
StdFace_MallocInteractions(StdI, ntransMax, nintrMax);
/**@brief
(5) Set Transfer & Interaction
*/
StdI->ntrans = 0;
StdI->nintr = 0;
for (kCell = 0; kCell < StdI->NCell; kCell++) {
/**/
iW = StdI->Cell[kCell][0];
Expand Down
Loading

0 comments on commit 63d25b8

Please sign in to comment.