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
fc704be9
Commit
fc704be9
authored
Dec 27, 2019
by
Alvarez, Gonzalo
Browse files
Operators: clean up again
parent
2a968697
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/Engine/BasisWithOperators.h
View file @
fc704be9
...
...
@@ -243,19 +243,18 @@ public:
assert
(
operatorsPerSite_
.
size
()
>
0
);
}
Pair
Type
localOperatorInd
ices
(
SizeType
i
,
SizeType
sigma
)
const
Size
Type
localOperatorInd
ex
(
SizeType
i
,
SizeType
sigma
)
const
{
SizeType
sum
=
0
;
for
(
SizeType
j
=
0
;
j
<
i
;
j
++
)
{
assert
(
j
<
operatorsPerSite_
.
size
());
assert
(
i
<=
operatorsPerSite_
.
size
());
for
(
SizeType
j
=
0
;
j
<
i
;
++
j
)
sum
+=
operatorsPerSite_
[
j
];
}
assert
(
i
<
operatorsPerSite_
.
size
());
return
PairType
(
sum
+
sigma
,
operatorsPerSite_
[
i
])
;
assert
(
i
<
operatorsPerSite_
.
size
());
return
sum
+
sigma
;
}
const
OperatorType
&
localOperator
ByIndex
(
int
i
)
const
const
OperatorType
&
localOperator
(
SizeType
i
)
const
{
return
operators_
.
getLocalByIndex
(
i
);
}
...
...
@@ -325,7 +324,7 @@ private:
const
SizeType
nlocalOps
=
numberOfLocalOperators
();
for
(
SizeType
i
=
0
;
i
<
nlocalOps
;
++
i
)
{
if
(
i
<
basis2
.
numberOfLocalOperators
())
{
const
OperatorType
&
myOp
=
basis2
.
localOperator
ByIndex
(
i
);
const
OperatorType
&
myOp
=
basis2
.
localOperator
(
i
);
bool
isFermion
=
(
myOp
.
fermionOrBoson
()
==
ProgramGlobals
::
FermionOrBosonEnum
::
FERMION
);
if
(
savedSign
!=
myOp
.
fermionOrBoson
()
||
fermionicSigns
.
size
()
==
0
)
{
...
...
@@ -344,7 +343,7 @@ private:
}
else
{
const
OperatorType
&
myOp
=
basis3
.
localOperator
ByIndex
(
i
-
basis2
.
numberOfLocalOperators
());
localOperator
(
i
-
basis2
.
numberOfLocalOperators
());
bool
isFermion
=
(
myOp
.
fermionOrBoson
()
==
ProgramGlobals
::
FermionOrBosonEnum
::
FERMION
);
...
...
src/Engine/ManyToTwoConnection.h
View file @
fc704be9
...
...
@@ -107,15 +107,12 @@ private:
SizeType
i
,
SizeType
sigma
)
const
{
PairSizeType
ii
;
if
(
type
==
ProgramGlobals
::
SysOrEnvEnum
::
SYSTEM
)
{
ii
=
lrs_
.
left
().
localOperatorIndices
(
i
,
sigma
);
}
else
{
assert
(
type
==
ProgramGlobals
::
SysOrEnvEnum
::
ENVIRON
);
ii
=
lrs_
.
right
().
localOperatorIndices
(
i
,
sigma
);
}
assert
(
type
==
ProgramGlobals
::
SysOrEnvEnum
::
SYSTEM
||
type
==
ProgramGlobals
::
SysOrEnvEnum
::
ENVIRON
);
return
ii
.
first
;
return
(
type
==
ProgramGlobals
::
SysOrEnvEnum
::
SYSTEM
)
?
lrs_
.
left
().
localOperatorIndex
(
i
,
sigma
)
:
lrs_
.
right
().
localOperatorIndex
(
i
,
sigma
);
}
PairSizeType
finalIndices4sites
(
const
VectorSizeType
&
hItems
)
const
...
...
src/Engine/OperatorsCached.h
View file @
fc704be9
...
...
@@ -59,10 +59,10 @@ public:
const
OperatorStorageType
*
m
=
0
;
if
(
type
==
ProgramGlobals
::
SysOrEnvEnum
::
SYSTEM
)
{
m
=
&
(
lrs_
.
left
().
localOperator
ByIndex
(
iifirst
).
getStorage
());
m
=
&
(
lrs_
.
left
().
localOperator
(
iifirst
).
getStorage
());
}
else
{
assert
(
type
==
ProgramGlobals
::
SysOrEnvEnum
::
ENVIRON
);
m
=&
(
lrs_
.
right
().
localOperator
ByIndex
(
iifirst
).
getStorage
());
m
=&
(
lrs_
.
right
().
localOperator
(
iifirst
).
getStorage
());
}
m
->
checkValidity
();
...
...
src/Engine/PrinterInDetail.h
View file @
fc704be9
...
...
@@ -9,6 +9,8 @@ class PrinterInDetail {
typedef
typename
LeftRightSuperType
::
BasisWithOperatorsType
BasisWithOperatorsType
;
typedef
typename
BasisWithOperatorsType
::
QnType
QnType
;
typedef
typename
BasisWithOperatorsType
::
OperatorsType
OperatorsType
;
typedef
typename
OperatorsType
::
OperatorType
OperatorType
;
public:
...
...
@@ -57,11 +59,10 @@ private:
os
<<
"Operators at site "
<<
site
<<
" ("
<<
siteC
<<
")
\n
"
;
for
(
SizeType
sigma
=
0
;
sigma
<
end
;
++
sigma
)
{
typename
BasisWith
Operator
s
Type
::
PairType
p
=
basis
.
localOperator
Indices
(
siteC
,
sigma
);
const
OperatorType
&
myo
p
=
basis
.
localOperator
(
basis
.
localOperatorIndex
(
siteC
,
sigma
)
)
;
os
<<
sigma
<<
" non-zeroes="
;
os
<<
basis
.
localOperatorByIndex
(
p
.
first
).
getStorage
().
nonZeros
();
os
<<
" rows="
<<
basis
.
localOperatorByIndex
(
p
.
first
).
getStorage
().
rows
()
<<
"
\n
"
;
os
<<
myop
.
getStorage
().
nonZeros
()
<<
" rows="
<<
myop
.
getStorage
().
rows
()
<<
"
\n
"
;
}
}
...
...
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