Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Laurell, Pontus Bengt Johan
dmrgpp
Commits
6cff7e2f
Commit
6cff7e2f
authored
Dec 27, 2019
by
Alvarez, Gonzalo
Browse files
BasisWithOperators: ops marked local
parent
75d85972
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/Engine/BasisWithOperators.h
View file @
6cff7e2f
...
...
@@ -232,7 +232,7 @@ public:
OperatorStorageType
hOp
(
h
);
operators_
.
setHamiltonian
(
hOp
);
operators_
.
set
Operators
(
ops
);
operators_
.
set
Local
(
ops
);
// one site basis is assumed ordered
...
...
@@ -257,14 +257,14 @@ public:
const
OperatorType
&
getOperatorByIndex
(
int
i
)
const
{
return
operators_
.
get
Operator
ByIndex
(
i
);
return
operators_
.
get
Local
ByIndex
(
i
);
}
SizeType
numberOfOperators
()
const
{
return
operators_
.
numberOfOperators
();
}
SizeType
numberOf
Local
Operators
()
const
{
return
operators_
.
sizeOfLocal
();
}
SizeType
superOperatorIndices
(
const
VectorSizeType
&
sites
,
SizeType
sigma
)
const
{
return
operators_
.
super
Operator
Indices
(
sites
,
sigma
);
return
operators_
.
superIndices
(
sites
,
sigma
);
}
SizeType
operatorsPerSite
(
SizeType
i
)
const
...
...
@@ -287,7 +287,7 @@ public:
typename
PsimagLite
::
EnableIf
<
PsimagLite
::
IsOutputLike
<
SomeOutputType
>::
True
,
int
*>::
Type
=
0
)
const
{
write
(
io
,
prefix
+
"/"
+
this
->
name
(),
mode
,
option
);
write
(
io
,
prefix
+
"/"
+
BasisType
::
name
(),
mode
,
option
);
}
template
<
typename
SomeOutputType
>
...
...
@@ -313,20 +313,19 @@ private:
void
setToProduct
(
const
ThisType
&
basis2
,
const
ThisType
&
basis3
)
{
assert
(
!
this
->
useSu2Symmetry
());
BasisType
&
parent
=
*
this
;
// reorder the basis
parent
.
setToProduct
(
basis2
,
basis3
);
BasisType
::
setToProduct
(
basis2
,
basis3
);
typename
PsimagLite
::
Vector
<
RealType
>::
Type
fermionicSigns
;
SizeType
x
=
basis2
.
numberOfOperators
()
+
basis3
.
numberOfOperators
();
SizeType
x
=
basis2
.
numberOf
Local
Operators
()
+
basis3
.
numberOf
Local
Operators
();
operators_
.
setToProduct
(
x
);
ApplyFactors
<
FactorsType
>
apply
(
this
->
getFactors
(),
this
->
useSu2Symmetry
());
ApplyFactors
<
FactorsType
>
apply
(
BasisType
::
getFactors
(),
BasisType
::
useSu2Symmetry
());
ProgramGlobals
::
FermionOrBosonEnum
savedSign
=
ProgramGlobals
::
FermionOrBosonEnum
::
BOSON
;
for
(
SizeType
i
=
0
;
i
<
this
->
numberOfOperators
();
i
++
)
{
if
(
i
<
basis2
.
numberOfOperators
())
{
const
SizeType
nlocalOps
=
numberOfLocalOperators
();
for
(
SizeType
i
=
0
;
i
<
nlocalOps
;
++
i
)
{
if
(
i
<
basis2
.
numberOfLocalOperators
())
{
const
OperatorType
&
myOp
=
basis2
.
getOperatorByIndex
(
i
);
bool
isFermion
=
(
myOp
.
fermionOrBoson
()
==
ProgramGlobals
::
FermionOrBosonEnum
::
FERMION
);
...
...
@@ -346,7 +345,7 @@ private:
}
else
{
const
OperatorType
&
myOp
=
basis3
.
getOperatorByIndex
(
i
-
basis2
.
numberOfOperators
());
getOperatorByIndex
(
i
-
basis2
.
numberOf
Local
Operators
());
bool
isFermion
=
(
myOp
.
fermionOrBoson
()
==
ProgramGlobals
::
FermionOrBosonEnum
::
FERMION
);
...
...
src/Engine/Operators.h
View file @
6cff7e2f
...
...
@@ -263,19 +263,18 @@ public:
err
(
"Operators::setChangeAll(true) called to late
\n
"
);
}
void
set
Operators
(
const
typename
PsimagLite
::
Vector
<
OperatorType
>::
Type
&
ops
)
void
set
Local
(
const
typename
PsimagLite
::
Vector
<
OperatorType
>::
Type
&
ops
)
{
operators_
=
ops
;
}
const
OperatorType
&
get
OperatorByIndex
(
int
i
)
const
const
OperatorType
&
get
LocalByIndex
(
SizeType
i
)
const
{
assert
(
!
BasisType
::
useSu2Symmetry
());
assert
(
i
>=
0
&&
SizeType
(
i
)
<
operators_
.
size
());
assert
(
i
<
operators_
.
size
());
return
operators_
[
i
];
}
SizeType
numberOfOperators
()
const
SizeType
sizeOfLocal
()
const
{
return
operators_
.
size
();
}
...
...
@@ -415,15 +414,13 @@ public:
io
.
write
(
hamiltonian_
,
s
+
"/Hamiltonian"
);
}
SizeType
size
()
const
{
return
operators_
.
size
();
}
void
clear
()
{
operators_
.
clear
();
hamiltonian_
.
clear
();
}
SizeType
super
Operator
Indices
(
const
VectorSizeType
&
,
SizeType
)
const
SizeType
superIndices
(
const
VectorSizeType
&
,
SizeType
)
const
{
PsimagLite
::
String
msg
(
__FILE__
);
throw
PsimagLite
::
RuntimeError
(
msg
+
"::superOperatorIndices() not implemented yet
\n
"
);
...
...
src/Engine/Truncation.h
View file @
6cff7e2f
...
...
@@ -289,7 +289,7 @@ private:
bool
expandSys
=
(
direction
==
ProgramGlobals
::
DirectionEnum
::
EXPAND_SYSTEM
);
const
BasisWithOperatorsType
&
basis
=
(
expandSys
)
?
lrs_
.
left
()
:
lrs_
.
right
();
size_t
mostRecent
=
superGeometry_
.
hollowOutRadius
(
maxOpsPerSiteLeft
());
size_t
numOfOp
=
basis
.
numberOfOperators
();
size_t
numOfOp
=
basis
.
numberOf
Local
Operators
();
PairSizeSizeType
startEnd
(
0
,
numOfOp
);
if
(
startEnd
.
second
>
mostRecent
)
{
if
(
expandSys
)
startEnd
.
first
=
startEnd
.
second
-
mostRecent
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment