43 else{ makenewLeft( denL, denT, workmem); }
47 void CheMPS2::TensorS1::makenewRight(
TensorL * denL,
TensorT * denT,
double * workmem){
51 for (
int ikappa=0; ikappa<
nKappa; ikappa++){
56 for (
int geval=0; geval<4; geval++){
57 int NLU,TwoSLU,ILU,TwoSLD,ILD;
90 if ((dimLU>0) && (dimLD>0) && (abs(TwoSLU-TwoSLD)<2)){
94 double * BlockL = denL->
gStorage(NLU, TwoSLU, ILU, NLU+1, TwoSLD, ILD );
108 dgemm_(&trans,¬rans,&dimUR,&dimLD,&dimLU,&alpha,BlockTup,&dimLU,BlockL,&dimLU,&beta,workmem,&dimUR);
113 dgemm_(¬rans,¬rans,&dimUR,&dimDR,&dimLD,&alpha,workmem,&dimUR,BlockTdown,&dimLD,&beta,
storage+
kappa2index[ikappa],&dimUR);
121 void CheMPS2::TensorS1::makenewLeft(
TensorL * denL,
TensorT * denT,
double * workmem){
125 for (
int ikappa=0; ikappa<
nKappa; ikappa++){
130 for (
int geval=0; geval<4; geval++){
131 int NRU,TwoSRU,IRU,TwoSRD,IRD;
164 if ((dimRU>0) && (dimRD>0) && (abs(TwoSRD-TwoSRU)<2)){
168 double * BlockL = denL->
gStorage(NRU, TwoSRU, IRU, NRU+1, TwoSRD, IRD);
177 int fase = ((((
sector_spin_up[ikappa] + TwoSRD + 1)/2)%2)!=0)?-1:1;
182 dgemm_(¬rans,¬rans,&dimUL,&dimRD,&dimRU,&alpha,BlockTup,&dimUL,BlockL,&dimRU,&beta,workmem,&dimUL);
188 dgemm_(¬rans,&trans,&dimUL,&dimDL,&dimRD,&alpha,workmem,&dimUL,BlockTdown,&dimDL,&beta,
storage+
kappa2index[ikappa],&dimUL);
static double wigner6j(const int two_ja, const int two_jb, const int two_jc, const int two_jd, const int two_je, const int two_jf)
Wigner-6j symbol (gsl api)
int index
Index of the Tensor object. For TensorT: a site index; for other tensors: a boundary index...
int * sector_nelec_up
The up particle number sector.
int * sector_spin_down
The down spin symmetry sector (pointer points to sectorTwoS1 if two_j == 0)
int gCurrentDim(const int boundary, const int N, const int TwoS, const int irrep) const
Get the current virtual dimensions.
virtual ~TensorS1()
Destructor.
TensorS1(const int boundary_index, const int Idiff, const bool moving_right, const SyBookkeeper *denBK)
Constructor.
void makenew(TensorL *denL, TensorT *denT, double *workmem)
double * gStorage()
Get the pointer to the storage.
bool moving_right
Whether or not moving right.
int * sector_spin_up
The up spin symmetry sector.
double * gStorage()
Get the pointer to the storage.
int n_irrep
The (real-valued abelian) point group irrep difference between the symmetry sectors of the lower and ...
static int directProd(const int Irrep1, const int Irrep2)
Get the direct product of the irreps with numbers Irrep1 and Irrep2: a bitwise XOR for psi4's convent...
int * sector_irrep_up
The up spin symmetry sector.
const SyBookkeeper * bk_up
The bookkeeper of the upper MPS.
int * kappa2index
kappa2index[kappa] indicates the start of tensor block kappa in storage. kappa2index[nKappa] gives th...
int get_irrep() const
Get the (real-valued abelian) point group irrep difference between the symmetry sectors of the lower ...
void clear()
Set all storage variables to 0.0.
int nKappa
Number of Tensor blocks.
int gIrrep(const int orbital) const
Get an orbital irrep.
double * storage
The actual variables. Tensor block kappa begins at storage+kappa2index[kappa] and ends at storage+kap...