43 else{ makenewLeft( denT); }
50 else{ makenewLeft( denL, denT, workmem); }
54 void CheMPS2::TensorF1::makenewRight(
TensorT * denT){
58 for (
int ikappa=0; ikappa<
nKappa; ikappa++){
63 for (
int geval=0; geval<2; geval++){
78 dgemm_(&trans,¬rans,&dimRU,&dimRD,&dimL,&alpha,BlockTup,&dimL,BlockTdo,&dimL,&beta,
storage+
kappa2index[ikappa],&dimRU);
87 void CheMPS2::TensorF1::makenewLeft(
TensorT * denT){
91 for (
int ikappa=0; ikappa<
nKappa; ikappa++){
96 for (
int geval=0; geval<2; geval++){
108 double alpha = fase * sqrt(3.0/(
sector_spin_up[ikappa]+1.0)) * (TwoSR + 1)
111 dgemm_(¬rans,&trans,&dimLU,&dimLD,&dimR,&alpha,BlockTup,&dimLU,BlockTdown,&dimLD,&beta,
storage+
kappa2index[ikappa],&dimLU);
120 void CheMPS2::TensorF1::makenewRight(
TensorL * denL,
TensorT * denT,
double * workmem){
124 for (
int ikappa=0; ikappa<
nKappa; ikappa++){
129 for (
int geval=0; geval<4; geval++){
130 int NLU,TwoSLU,ILU,TwoSLD,ILD;
163 if ((dimLU>0) && (dimLD>0) && (abs(TwoSLU-TwoSLD)<2)){
167 double * BlockL = denL->
gStorage(NLU, TwoSLU, ILU, NLU+1, TwoSLD, ILD );
181 dgemm_(&trans,¬rans,&dimUR,&dimLD,&dimLU,&alpha,BlockTup,&dimLU,BlockL,&dimLU,&beta,workmem,&dimUR);
186 dgemm_(¬rans,¬rans,&dimUR,&dimDR,&dimLD,&alpha,workmem,&dimUR,BlockTdown,&dimLD,&beta,
storage+
kappa2index[ikappa],&dimUR);
194 void CheMPS2::TensorF1::makenewLeft(
TensorL * denL,
TensorT * denT,
double * workmem){
198 for (
int ikappa=0; ikappa<
nKappa; ikappa++){
203 for (
int geval=0; geval<4; geval++){
204 int NRU,TwoSRU,IRU,TwoSRD,IRD;
237 if ((dimRU>0) && (dimRD>0) && (abs(TwoSRU-TwoSRD)<2)){
241 double * BlockL = denL->
gStorage(NRU, TwoSRU, IRU, NRU+1, TwoSRD, IRD);
248 alpha = fase * sqrt(3.0/(
sector_spin_up[ikappa]+1.0)) * (TwoSRD+1)
256 dgemm_(¬rans,¬rans,&dimUL,&dimRD,&dimRU,&alpha,BlockTup,&dimUL,BlockL,&dimRU,&beta,workmem,&dimUL);
262 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 ~TensorF1()
Destructor.
void makenew(TensorT *denT)
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.
TensorF1(const int boundary_index, const int Idiff, const bool moving_right, const SyBookkeeper *denBK)
Constructor.
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...