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

ReflectionOperator removed

parent 5213f2a7
......@@ -111,7 +111,6 @@ public:
typedef typename ModelType::ModelHelperType ModelHelperType;
typedef typename ModelHelperType::LeftRightSuperType LeftRightSuperType;
typedef typename LeftRightSuperType::ParamsForKroneckerDumperType ParamsForKroneckerDumperType;
typedef typename ModelType::ReflectionSymmetryType ReflectionSymmetryType;
typedef typename TargetingType::MatrixVectorType MatrixVectorType;
typedef typename ModelType::InputValidatorType InputValidatorType;
typedef typename PsimagLite::Vector<RealType>::Type VectorRealType;
......@@ -130,7 +129,6 @@ public:
Diagonalization(const ParametersType& parameters,
const ModelType& model,
const bool& verbose,
ReflectionSymmetryType& reflectionOperator,
InputValidatorType& io,
const typename QnType::VectorQnType& quantumSector,
WaveFunctionTransfType& waveFunctionTransformation,
......@@ -138,7 +136,6 @@ public:
: parameters_(parameters),
model_(model),
verbose_(verbose),
reflectionOperator_(reflectionOperator),
io_(io),
progress_("Diag."),
quantumSector_(quantumSector),
......@@ -157,7 +154,6 @@ public:
SizeType loopIndex = 0;
VectorSizeType sectors;
targetedSymmetrySectors(sectors,target.lrs());
reflectionOperator_.update(sectors);
RealType gsEnergy = internalMain_(target,direction,loopIndex,blockLeft);
// targeting:
target.evolve(gsEnergy,direction,blockLeft,blockRight,loopIndex);
......@@ -434,12 +430,8 @@ private:
const TargetVectorType& initialVector,
SizeType loopIndex)
{
ReflectionSymmetryType *rs = 0;
if (reflectionOperator_.isEnabled()) rs = &reflectionOperator_;
typename LanczosOrDavidsonBaseType::MatrixType lanczosHelper(model_,
hc,
rs);
hc);
const SizeType saveOption = parameters_.finiteLoop[loopIndex].saveOption;
......@@ -472,10 +464,6 @@ private:
return;
}
if (reflectionOperator_.isEnabled())
err("ReflectionOperator enabled is not longer supported\n");
try {
energyTmp = computeLevel(*lanczosOrDavidson,tmpVec,initialVector);
} catch (std::exception& e) {
......@@ -563,7 +551,6 @@ private:
const ParametersType& parameters_;
const ModelType& model_;
const bool& verbose_;
ReflectionSymmetryType& reflectionOperator_;
InputValidatorType& io_;
PsimagLite::ProgressIndicator progress_;
// quantumSector_ needs to be a reference since DmrgSolver will change it
......
......@@ -130,7 +130,6 @@ public:
typedef Checkpoint<ModelType, WaveFunctionTransfType> CheckpointType;
typedef Recovery<CheckpointType, TargetingType> RecoveryType;
typedef typename DmrgSerializerType::FermionSignType FermionSignType;
typedef typename ModelType::ReflectionSymmetryType ReflectionSymmetryType;
typedef typename PsimagLite::Vector<BlockType>::Type VectorBlockType;
typedef typename PsimagLite::Vector<SizeType>::Type VectorSizeType;
typedef typename TargetingType::LanczosSolverType LanczosSolverType;
......@@ -153,19 +152,14 @@ public:
stepCurrent_(0),
checkpoint_(parameters_, ioIn, model, false),
wft_(parameters_),
reflectionOperator_(lrs_,
model_.hilbertSize(0),
parameters_.useReflectionSymmetry,
ProgramGlobals::DirectionEnum::EXPAND_SYSTEM),
diagonalization_(parameters_,
model,
verbose_,
reflectionOperator_,
ioIn,
quantumSector_,
wft_,
checkpoint_.energy()),
truncate_(reflectionOperator_,
truncate_(lrs_,
wft_,
parameters_,
model.geometry(),
......@@ -690,7 +684,6 @@ obtain ordered
CheckpointType checkpoint_;
WaveFunctionTransfType wft_;
VectorBlockType sitesIndices_;
ReflectionSymmetryType reflectionOperator_;
DiagonalizationType diagonalization_;
TruncationType truncate_;
ObservablesInSituType inSitu_;
......
......@@ -99,7 +99,6 @@ public:
typedef typename ModelType::ModelHelperType ModelHelperType;
typedef typename ModelType::ParametersType ParametersType;
typedef typename ModelHelperType::RealType RealType;
typedef typename ModelType::ReflectionSymmetryType ReflectionSymmetryType;
typedef InitKronHamiltonian<ModelType> InitKronType;
typedef KronMatrix<InitKronType> KronMatrixType;
typedef typename ModelHelperType::SparseMatrixType SparseMatrixType;
......@@ -111,8 +110,7 @@ public:
typedef typename ModelType::HamiltonianConnectionType HamiltonianConnectionType;
MatrixVectorKron(const ModelType& model,
const HamiltonianConnectionType& hc,
ReflectionSymmetryType* = 0)
const HamiltonianConnectionType& hc)
: params_(model.params()),
initKron_(model, hc),
kronMatrix_(initKron_, "Hamiltonian"),
......
......@@ -94,7 +94,6 @@ public:
typedef ModelType_ ModelType;
typedef typename ModelType::ModelHelperType ModelHelperType;
typedef typename ModelHelperType::RealType RealType;
typedef typename ModelType::ReflectionSymmetryType ReflectionSymmetryType;
typedef typename ModelHelperType::SparseMatrixType SparseMatrixType;
typedef typename SparseMatrixType::value_type value_type;
typedef typename SparseMatrixType::value_type ComplexOrRealType;
......@@ -103,8 +102,7 @@ public:
typedef typename ModelType::HamiltonianConnectionType HamiltonianConnectionType;
MatrixVectorOnTheFly(const ModelType& model,
const HamiltonianConnectionType& hc,
ReflectionSymmetryType* = 0)
const HamiltonianConnectionType& hc)
: model_(model), hc_(hc)
{
int maxMatrixRankStored = model.params().maxMatrixRankStored;
......
......@@ -96,7 +96,6 @@ public:
typedef typename ModelType::ModelHelperType ModelHelperType;
typedef typename ModelHelperType::SparseMatrixType SparseMatrixType;
typedef typename ModelHelperType::RealType RealType;
typedef typename ModelType::ReflectionSymmetryType ReflectionSymmetryType;
typedef typename SparseMatrixType::value_type value_type;
typedef typename SparseMatrixType::value_type ComplexOrRealType;
typedef typename PsimagLite::Vector<RealType>::Type VectorRealType;
......@@ -104,8 +103,7 @@ public:
typedef typename ModelType::HamiltonianConnectionType HamiltonianConnectionType;
MatrixVectorStored(const ModelType& model,
const HamiltonianConnectionType& hc,
const ReflectionSymmetryType* rs=0)
const HamiltonianConnectionType& hc)
: model_(model),
matrixStored_(2),
pointer_(0),
......@@ -113,25 +111,15 @@ public:
{
PsimagLite::String options = model.params().options;
bool debugMatrix = (options.find("debugmatrix") != PsimagLite::String::npos);
if (!rs) {
matrixStored_[0].clear();
model.fullHamiltonian(matrixStored_[0], hc);
assert(isHermitian(matrixStored_[0],true));
PsimagLite::OstringStream msg;
msg<<"fullHamiltonian has rank="<<matrixStored_[0].rows();
msg<<" nonzeros="<<matrixStored_[0].nonZeros();
progress_.printline(msg,std::cout);
if (debugMatrix)
printFullMatrix(matrixStored_[0],"matrix",1);
return;
}
SparseMatrixType matrix2;
model.fullHamiltonian(matrix2, hc);
rs->transform(matrixStored_[0],matrixStored_[1],matrix2);
matrixStored_[0].clear();
model.fullHamiltonian(matrixStored_[0], hc);
assert(isHermitian(matrixStored_[0],true));
PsimagLite::OstringStream msg;
msg<<" sector="<<matrixStored_[0].rows()<<" and sector="<<matrixStored_[1].rows();
msg<<"fullHamiltonian has rank="<<matrixStored_[0].rows();
msg<<" nonzeros="<<matrixStored_[0].nonZeros();
progress_.printline(msg,std::cout);
if (debugMatrix)
printFullMatrix(matrixStored_[0],"matrix",1);
}
SizeType rows() const { return matrixStored_[pointer_].rows(); }
......
......@@ -79,7 +79,6 @@ DISCLOSED WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS.
#ifndef MODEL_BASE_H
#define MODEL_BASE_H
#include "ReflectionOperatorEmpty.h"
#include "Vector.h"
#include "Sort.h"
#include "MemResolv.h"
......@@ -109,7 +108,6 @@ public:
typedef typename ModelHelperType::BasisType MyBasis;
typedef typename ModelHelperType::BasisWithOperatorsType BasisWithOperatorsType;
typedef typename ModelHelperType::LeftRightSuperType LeftRightSuperType;
typedef ReflectionOperatorEmpty<LeftRightSuperType> ReflectionSymmetryType;
typedef typename OperatorsType::OperatorType OperatorType;
typedef typename OperatorType::StorageType OperatorStorageType;
typedef typename PsimagLite::Vector<OperatorType>::Type VectorOperatorType;
......
......@@ -151,7 +151,6 @@ struct ParametersDmrgSolver {
SizeType dumperBegin;
SizeType dumperEnd;
SizeType precision;
int useReflectionSymmetry;
bool autoRestart;
PairRealSizeType truncationControl;
PsimagLite::String filename;
......@@ -159,7 +158,6 @@ struct ParametersDmrgSolver {
PsimagLite::String options;
PsimagLite::String model;
PsimagLite::String insitu;
PsimagLite::String fileForDensityMatrixEigs;
PsimagLite::String recoverySave;
RestartStruct checkpoint;
typename QnType::VectorQnType adjustQuantumNumbers;
......@@ -182,14 +180,12 @@ struct ParametersDmrgSolver {
ioSerializer.write(root + "/dumperBegin", dumperBegin);
ioSerializer.write(root + "/dumperEnd", dumperEnd);
ioSerializer.write(root + "/precision", precision);
ioSerializer.write(root + "/useReflectionSymmetry", useReflectionSymmetry);
ioSerializer.write(root + "/truncationControl", truncationControl);
ioSerializer.write(root + "/filename", filename);
ioSerializer.write(root + "/version", version);
ioSerializer.write(root + "/options", options);
ioSerializer.write(root + "/model", model);
ioSerializer.write(root + "/insitu", insitu);
ioSerializer.write(root + "/fileForDensityMatrixEigs", fileForDensityMatrixEigs);
ioSerializer.write(root + "/recoverySave", recoverySave);
checkpoint.write(label + "/checkpoint", ioSerializer);
ioSerializer.write(root + "/adjustQuantumNumbers", adjustQuantumNumbers);
......@@ -295,15 +291,6 @@ struct ParametersDmrgSolver {
throw PsimagLite::RuntimeError(s.c_str());
}
useReflectionSymmetry=0;
try {
io.readline(useReflectionSymmetry,"UseReflectionSymmetry=");
} catch (std::exception&) {}
fileForDensityMatrixEigs="";
try {
io.readline(fileForDensityMatrixEigs,"FileForDensityMatrixEigs=");
} catch (std::exception&) {}
insitu = "";
try {
io.readline(insitu,"insitu=");
......
......@@ -109,7 +109,6 @@ class Truncation {
typedef typename DensityMatrixBaseType::BlockDiagonalMatrixType BlockDiagonalMatrixType;
typedef typename TargetingType::ModelType ModelType;
typedef typename ModelType::GeometryType GeometryType;
typedef typename ModelType::ReflectionSymmetryType ReflectionSymmetryType;
typedef typename PsimagLite::Vector<RealType>::Type VectorRealType;
public:
......@@ -126,13 +125,12 @@ public:
}; // TruncationCache
Truncation(ReflectionSymmetryType& reflectionOperator,
Truncation(const LeftRightSuperType& lrs,
WaveFunctionTransfType& waveFunctionTransformation,
const ParametersType& parameters,
const GeometryType& geometry,
IoOutType& ioOut)
: reflectionOperator_(reflectionOperator),
lrs_(reflectionOperator_.leftRightSuper()),
: lrs_(lrs),
waveFunctionTransformation_(waveFunctionTransformation),
parameters_(parameters),
geometry_(geometry),
......@@ -512,7 +510,6 @@ private:
++counterVector_[index];
}
ReflectionSymmetryType& reflectionOperator_;
const LeftRightSuperType& lrs_;
WaveFunctionTransfType& waveFunctionTransformation_;
const ParametersType& parameters_;
......
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