Commit bdc0680b authored by Alvarez, Gonzalo's avatar Alvarez, Gonzalo
Browse files

Operators: clean up

parent 6cff7e2f
......@@ -215,7 +215,7 @@ public:
}
template<typename SomeModelType>
void setVarious(const VectorSizeType& block,
void setOneSite(const VectorSizeType& block,
const SomeModelType& model,
RealType time)
{
......@@ -319,7 +319,7 @@ private:
typename PsimagLite::Vector<RealType>::Type fermionicSigns;
SizeType x = basis2.numberOfLocalOperators()+basis3.numberOfLocalOperators();
operators_.setToProduct(x);
operators_.setToProduct(basis2, basis3, x);
ApplyFactors<FactorsType> apply(BasisType::getFactors(), BasisType::useSu2Symmetry());
ProgramGlobals::FermionOrBosonEnum savedSign = ProgramGlobals::FermionOrBosonEnum::BOSON;
......@@ -336,12 +336,12 @@ private:
savedSign = myOp.fermionOrBoson();
}
operators_.externalProduct(i,
myOp,
basis3.size(),
fermionicSigns,
true,
BaseType::permutationInverse());
operators_.crossProductForLocal(i,
myOp,
basis3.size(),
fermionicSigns,
true,
BaseType::permutationInverse());
} else {
const OperatorType& myOp = basis3.
......@@ -357,12 +357,12 @@ private:
savedSign = myOp.fermionOrBoson();
}
operators_.externalProduct(i,
myOp,
basis2.size(),
fermionicSigns,
false,
BaseType::permutationInverse());
operators_.crossProductForLocal(i,
myOp,
basis2.size(),
fermionicSigns,
false,
BaseType::permutationInverse());
}
}
......
......@@ -245,8 +245,8 @@ public:
} else { // move this block elsewhere:
RealType time = 0;
pE.setVarious(E, model_, time);
pS.setVarious(S, model_, time);
pE.setOneSite(E, model_, time);
pS.setOneSite(S, model_, time);
infiniteDmrgLoop(X,Y,E,pS,pE,psi);
}
......
......@@ -363,7 +363,7 @@ private:
{
BasisWithOperatorsType Xbasis("Xbasis");
typedef LeftRightSuper<BasisWithOperatorsType, BasisType> LeftRightSuper2Type;
Xbasis.setVarious(X, model, time);
Xbasis.setOneSite(X, model, time);
leftOrRight.setToProduct(pS, Xbasis, dir);
SparseMatrixType matrix = leftOrRight.hamiltonian().getCRS();
......
......@@ -300,12 +300,9 @@ public:
ChangeOfBasisType::changeBasis(hamiltonian_, ftransform);
}
void setMomentumOfOperators(const VectorSizeType& momentum)
{
momentumOfOperators_ = momentum;
}
void setToProduct(SizeType x)
void setToProduct(const BasisType& basis1,
const BasisType& basis2,
SizeType x)
{
operators_.resize(x);
}
......@@ -334,12 +331,12 @@ public:
internal degree of freedom $\sigma$. See PTEXREF{setToProductOps}
and PTEXREF{HERE}.
*/
void externalProduct(SizeType i,
const OperatorType& m,
int x,
const VectorRealType& fermionicSigns,
bool option,
const VectorSizeType& permutationFull)
void crossProductForLocal(SizeType i,
const OperatorType& m,
int x,
const VectorRealType& fermionicSigns,
bool option,
const VectorSizeType& permutationFull)
{
assert(!BasisType::useSu2Symmetry());
operators_[i].outerProduct(m,
......@@ -459,7 +456,6 @@ private:
typename PsimagLite::Vector<OperatorType>::Type operators_;
StorageType hamiltonian_;
PsimagLite::ProgressIndicator progress_;
VectorSizeType momentumOfOperators_;
}; //class Operators
template<typename T>
......
......@@ -231,7 +231,7 @@ public:
if (X[0] != 0 && X[0] != lrs_.super().block().size()-1)
return;
basisWithOps.setVarious(X, model_, commonTargeting_.aoe().time());
basisWithOps.setOneSite(X, model_, commonTargeting_.aoe().time());
}
virtual bool end() const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment