Commit 7578944f authored by Alvarez, Gonzalo's avatar Alvarez, Gonzalo
Browse files

ChemicalH: GaugeSpin hooked

parent 2b63c72b
......@@ -356,4 +356,6 @@ the "half filled" case). U=2
6010) Kitaev with Gammas
#6010) Kitaev
6500) Hybrid space-k ladders
7000) Chemical H: Gauge spin
#7001-7500 reserved for ChemicalH
#TAGEND DO NOT REMOVE THIS TAG
......@@ -76,6 +76,7 @@ DISCLOSED WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS.
#include "../Models/Kondo/Kondo.h"
#include "../Models/UlsOsu/UlsOsu.h"
#include "../Models/Graphene/Graphene.h"
#include "../Models/GaugeSpin/GaugeSpin.h"
#endif
......@@ -116,7 +117,7 @@ class ModelSelector {
typedef Kondo<ModelBaseType> KondoType;
typedef Graphene<ModelBaseType> GrapheneType;
typedef HolsteinThin<ModelBaseType> HolsteinThinType;
typedef GaugeSpin<ModelBaseType> GaugeSpinType;
#endif
// end models
......@@ -201,6 +202,8 @@ public:
model_ = new ModelHubbardType(solverParams, io, geometry, "RashbaSOC");
} else if (name_ == "Graphene") {
model_ = new GrapheneType(solverParams, io, geometry);
} else if (name_ == "GaugeSpin") {
model_ = new GaugeSpinType(solverParams, io, geometry);
}
#endif
else {
......
......@@ -96,7 +96,7 @@ public:
typedef typename ModelBaseType::ModelHelperType ModelHelperType;
typedef typename ModelHelperType::BasisType BasisType;
typedef typename ModelBaseType::GeometryType GeometryType;
typedef typename ModelBaseType::SuperGeometryType SuperGeometryType;
typedef typename ModelBaseType::LeftRightSuperType LeftRightSuperType;
typedef typename ModelBaseType::LinkType LinkType;
typedef typename ModelHelperType::OperatorsType OperatorsType;
......@@ -127,13 +127,11 @@ public:
GaugeSpin(const SolverParamsType& solverParams,
InputValidatorType& io,
const GeometryType& geometry,
PsimagLite::String)
const SuperGeometryType& geometry)
: ModelBaseType(solverParams,
geometry,
io),
modelParameters_(io),
geometry_(geometry)
modelParameters_(io)
{}
void write(PsimagLite::String label1, PsimagLite::IoNg::Out::Serializer& io) const
......@@ -150,11 +148,11 @@ public:
const BlockType& block,
RealType) const
{
SizeType linSize = geometry_.numberOfSites();
SizeType linSize = ModelBaseType::superGeometry().numberOfSites();
SizeType n = block.size();
assert(n == 1);
SizeType site = block[i];
SizeType site = block[0];
const OperatorType& sz = ModelBaseType::naturalOperator("sz", site, 0);
......@@ -173,54 +171,46 @@ protected:
HilbertBasisType natBasis(total);
for (SizeType i = 0; i < total; ++i) natBasis[i] = i;
setSymmetryRelated(qns, natBasis, block.size());
for (SizeType i=0;i<block.size();i++) {
// Set the operators S^+_i in the natural basis
SparseMatrixType tmpMatrix = findSplusMatrices(i, natBasis);
typename OperatorType::Su2RelatedType su2related;
su2related.source.push_back(i*DEGREES_OF_FREEDOM);
su2related.source.push_back(i*DEGREES_OF_FREEDOM+NUMBER_OF_ORBITALS);
su2related.source.push_back(i*DEGREES_OF_FREEDOM);
su2related.transpose.push_back(-1);
su2related.transpose.push_back(-1);
su2related.transpose.push_back(1);
su2related.offset = NUMBER_OF_ORBITALS;
OperatorType myOp(tmpMatrix,
ProgramGlobals::FermionOrBosonEnum::BOSON,
PairType(2, 2),
-1,
su2related);
this->createOpsLabel("splus").push(myOp);
// this->makeTrackable("splus");
myOp.dagger();
this->createOpsLabel("sminus").push(myOp);
// Set the operators S^z_i in the natural basis
tmpMatrix = findSzMatrices(i,natBasis);
typename OperatorType::Su2RelatedType su2related2;
OperatorType myOp2(tmpMatrix,
ProgramGlobals::FermionOrBosonEnum::BOSON,
PairType(2, 1),
1.0/sqrt(2.0),
su2related2);
this->createOpsLabel("sz").push(myOp2);
// this->makeTrackable("sz");
// Set the operators S^x_i in the natural basis
tmpMatrix = findSxMatrices(i,natBasis);
typename OperatorType::Su2RelatedType su2related3;
OperatorType myOp3(tmpMatrix,
ProgramGlobals::FermionOrBosonEnum::BOSON,
PairType(2, 1),
1.0/sqrt(2.0),
su2related3);
this->createOpsLabel("sx").push(myOp3);
this->makeTrackable("sx");
}
setSymmetryRelated(qns, natBasis);
// Set the operators S^+_i in the natural basis
SparseMatrixType tmpMatrix = findSplusMatrices(0, natBasis);
typename OperatorType::Su2RelatedType su2related;
OperatorType myOp(tmpMatrix,
ProgramGlobals::FermionOrBosonEnum::BOSON,
PairType(2, 2),
-1,
su2related);
this->createOpsLabel("splus").push(myOp);
// this->makeTrackable("splus");
myOp.dagger();
this->createOpsLabel("sminus").push(myOp);
// Set the operators S^z_i in the natural basis
tmpMatrix = findSzMatrices(0, natBasis);
typename OperatorType::Su2RelatedType su2related2;
OperatorType myOp2(tmpMatrix,
ProgramGlobals::FermionOrBosonEnum::BOSON,
PairType(2, 1),
1.0/sqrt(2.0),
su2related2);
this->createOpsLabel("sz").push(myOp2);
// this->makeTrackable("sz");
// Set the operators S^x_i in the natural basis
tmpMatrix = findSxMatrices(0, natBasis);
typename OperatorType::Su2RelatedType su2related3;
OperatorType myOp3(tmpMatrix,
ProgramGlobals::FermionOrBosonEnum::BOSON,
PairType(2, 1),
1.0/sqrt(2.0),
su2related3);
this->createOpsLabel("sx").push(myOp3);
this->makeTrackable("sx");
}
void fillModelLinks()
......@@ -228,7 +218,7 @@ protected:
if (BasisType::useSu2Symmetry())
err("SU(2): no longer supported\n");
auto lambda = []
//auto lambda = []
ModelTermType& plaquetteX = ModelBaseType::createTerm("PlaquetteX");
OpForLinkType sx("sx");
......@@ -323,9 +313,7 @@ private:
return Sx;
}
void setSymmetryRelated(VectorQnType& qns,
const HilbertBasisType& basis,
int n) const
void setSymmetryRelated(VectorQnType& qns, const HilbertBasisType& basis) const
{
// find j,m and flavors (do it by hand since we assume n==1)
// note: we use 2j instead of j
......@@ -344,7 +332,6 @@ private:
}
ParametersGaugeSpin<RealType, QnType> modelParameters_;
const GeometryType& geometry_;
}; // class GaugeSpin
} // namespace Dmrg
......
......@@ -96,6 +96,7 @@ struct ParametersGaugeSpin : public ParametersModelBase<RealType, QnType> {
ParametersGaugeSpin(IoInputType& io)
: BaseType(io, false)
{
SizeType nsites = 0;
io.readline(nsites, "TotalNumberOfSites=");
try {
......
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