Commit 8345a19b authored by Alvarez, Gonzalo's avatar Alvarez, Gonzalo
Browse files

SaveDensityMatrixEigenvalues input line

SaveDensityMatrixEigenvalues=predicate awesome

The predicate may include the symbols s meaning site
and c meaning center (L/2).
parent 33b5295c
......@@ -207,6 +207,8 @@ public:
knownLabels_.push_back("RecoverySave");
knownLabels_.push_back("Intent");
knownLabels_.push_back("PrintHamiltonianAverage");
knownLabels_.push_back("SaveDensityMatrixEigenvalues");
for (SizeType i = 0; i < 10; ++i)
knownLabels_.push_back("Term" + ttos(i));
}
......@@ -349,8 +351,6 @@ public:
batched gemm and might need plugin sc
\item [KrylovNoAbridge] TBW
\item [fixLegacyBugs] TBW
\item [saveDensityMatrixEigenvalues] Save DensityMatrixEigenvalues
to the data file.
\item [KronNoUseLowerPart] Don't Use lower part of Kron matrix but
recompute it instead.
\item [shrinkStacksOnDisk] Store shrink stacks on disk instead of in memory
......@@ -420,7 +420,6 @@ public:
registerOpts.push_back("BatchedGemm");
registerOpts.push_back("KrylovNoAbridge");
registerOpts.push_back("fixLegacyBugs");
registerOpts.push_back("saveDensityMatrixEigenvalues");
registerOpts.push_back("KronNoUseLowerPart");
registerOpts.push_back("shrinkStacksOnDisk");
registerOpts.push_back("OperatorsChangeAll");
......
......@@ -160,6 +160,7 @@ struct ParametersDmrgSolver {
PsimagLite::String insitu;
PsimagLite::String recoverySave;
PsimagLite::String printHamiltonianAverage;
PsimagLite::String saveDensityMatrixEigenvalues;
RestartStruct checkpoint;
typename QnType::VectorQnType adjustQuantumNumbers;
VectorFiniteLoopType finiteLoop;
......@@ -189,6 +190,7 @@ struct ParametersDmrgSolver {
ioSerializer.write(root + "/insitu", insitu);
ioSerializer.write(root + "/recoverySave", recoverySave);
ioSerializer.write(root + "/printHamiltonianAverage", printHamiltonianAverage);
ioSerializer.write(root + "/saveDensityMatrixEigenvalues", saveDensityMatrixEigenvalues);
checkpoint.write(label + "/checkpoint", ioSerializer);
ioSerializer.write(root + "/adjustQuantumNumbers", adjustQuantumNumbers);
ioSerializer.write(root + "/finiteLoop", finiteLoop);
......@@ -365,6 +367,10 @@ struct ParametersDmrgSolver {
io.readline(printHamiltonianAverage, "PrintHamiltonianAverage=");
} catch (std::exception&) {}
try {
io.readline(saveDensityMatrixEigenvalues, "SaveDensityMatrixEigenvalues=");
} catch (std::exception&) {}
if (options.find("restart")!=PsimagLite::String::npos) {
if (!infLoopsIsAnInt and hasRestartFrom) {
PsimagLite::String tmp = "FATAL: RestartFilename found in input ";
......
......@@ -86,6 +86,7 @@ DISCLOSED WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS.
#include "Concurrency.h"
#include "Io/IoNg.h"
#include "Profiling.h"
#include "PredicateAwesome.h"
namespace Dmrg {
......@@ -186,7 +187,8 @@ public:
DensityMatrixBaseType* dmS = 0;
changeBasis(sBasis,
target,
keptStates, ProgramGlobals::DirectionEnum::EXPAND_SYSTEM,
keptStates,
ProgramGlobals::DirectionEnum::EXPAND_SYSTEM,
&dmS);
assert(dmS);
truncateBasis(sBasis,
......@@ -476,7 +478,16 @@ private:
void dumpEigs(const VectorRealType& eigs)
{
if (parameters_.options.find("saveDensityMatrixEigenvalues") == PsimagLite::String::npos)
SizeType last = lrs_.left().block().size();
assert(lrs_.left().block().size() > 0);
SizeType index = lrs_.left().block()[last - 1];
PsimagLite::String predicate = parameters_.saveDensityMatrixEigenvalues;
const SizeType center = geometry_.numberOfSites()/2;
PsimagLite::PredicateAwesome<>::replaceAll(predicate, "c", ttos(center));
PsimagLite::PredicateAwesome<> pAwesome(predicate);
if (!pAwesome.isTrue("s", index))
return;
PsimagLite::String label("DensityMatrixEigenvalues");
......@@ -492,10 +503,6 @@ private:
firstCall = false;
}
SizeType last = lrs_.left().block().size();
assert(lrs_.left().block().size() > 0);
SizeType index = lrs_.left().block()[last - 1];
assert(index < counterVector_.size());
SizeType counter = counterVector_[index];
......
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