20 #ifndef TENSOROPERATOR_CHEMPS2_H 21 #define TENSOROPERATOR_CHEMPS2_H 25 #include "SyBookkeeper.h" 77 int gKappa(
const int N1,
const int TwoS1,
const int I1,
const int N2,
const int TwoS2,
const int I2 )
const;
92 double *
gStorage(
const int N1,
const int TwoS1,
const int I1,
const int N2,
const int TwoS2,
const int I2 );
void update(TensorOperator *previous, TensorT *mps_tensor_up, TensorT *mps_tensor_down, double *workmem)
Clear and update.
virtual ~TensorOperator()
Destructor.
int * sector_nelec_up
The up particle number sector.
int get_2j() const
Get twice the spin of the tensor operator.
int * sector_spin_down
The down spin symmetry sector (pointer points to sectorTwoS1 if two_j == 0)
int get_nelec() const
Get how many electrons there are more in the symmetry sector of the lower leg compared to the upper l...
int gKappa(const int N1, const int TwoS1, const int I1, const int N2, const int TwoS2, const int I2) const
Get the index corresponding to a certain tensor block.
bool prime_last
Convention in which the tensor operator is stored (see class information)
const SyBookkeeper * bk_down
The bookkeeper of the lower MPS.
int gKappa2index(const int kappa) const
Get the storage jump corresponding to a certain tensor block.
double * gStorage()
Get the pointer to the storage.
double inproduct(TensorOperator *buddy, const char trans) const
Make the in-product of two TensorOperator.
void daxpy(double alpha, TensorOperator *to_add)
daxpy for TensorOperator
bool moving_right
Whether or not moving right.
int * sector_spin_up
The up spin symmetry sector.
int n_irrep
The (real-valued abelian) point group irrep difference between the symmetry sectors of the lower and ...
void update_moving_left(const int ikappa, TensorOperator *previous, TensorT *mps_tensor_up, TensorT *mps_tensor_down, double *workmem)
Update moving left.
int * sector_irrep_up
The up spin symmetry sector.
TensorOperator(const int boundary_index, const int two_j, const int n_elec, const int n_irrep, const bool moving_right, const bool prime_last, const bool jw_phase, const SyBookkeeper *bk_up, const SyBookkeeper *bk_down)
Constructor.
void daxpy_transpose_tensorCD(const double alpha, TensorOperator *to_add)
daxpy_transpose for C- and D-tensors (with special spin-dependent factors)
int gNKappa() const
Get the number of symmetry blocks.
const SyBookkeeper * bk_up
The bookkeeper of the upper MPS.
bool jw_phase
Whether or not to include a Jordan-Wigner phase due to the fermion anti-commutation relations...
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 gIndex() const
Get the boundary index.
int n_elec
How many electrons there are more in the symmetry sector of the lower leg compared to the upper leg...
int two_j
Twice the spin of the tensor operator.
void update_moving_right(const int ikappa, TensorOperator *previous, TensorT *mps_tensor_up, TensorT *mps_tensor_down, double *workmem)
Update moving right.