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
825faf78
Commit
825faf78
authored
Dec 23, 2019
by
Alvarez, Gonzalo
Browse files
ChemicalH: GaugeSpin compiles
parent
7578944f
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Engine/ModelLinks.h
View file @
825faf78
...
...
@@ -170,6 +170,58 @@ public:
vModifier
));
}
template
<
typename
OpaqueOp
>
void
push4
(
const
OpaqueOp
&
op1
,
char
mod1
,
const
OpaqueOp
&
op2
,
char
mod2
,
const
OpaqueOp
&
op3
,
char
mod3
,
const
OpaqueOp
&
op4
,
char
mod4
,
LambdaType
vModifier
=
[](
ComplexOrRealType
&
)
{},
Su2Properties
su2properties
=
Su2Properties
())
{
if
(
links_
.
size
()
>
0
)
{
if
(
!
areSitesCompatible
(
VectorSizeType
{
op1
.
kindOfSite
,
op2
.
kindOfSite
,
op3
.
kindOfSite
,
op4
.
kindOfSite
}))
err
(
"Term "
+
name_
+
" incompatible atom kinds at push
\n
"
);
}
else
{
vectorKind_
=
VectorSizeType
{
op1
.
kindOfSite
,
op2
.
kindOfSite
,
op3
.
kindOfSite
,
op4
.
kindOfSite
};
}
SizeType
index1
=
findIndexOfOp
(
op1
.
name
,
op1
.
dof
);
SizeType
index2
=
findIndexOfOp
(
op2
.
name
,
op2
.
dof
);
SizeType
index3
=
findIndexOfOp
(
op3
.
name
,
op2
.
dof
);
SizeType
index4
=
findIndexOfOp
(
op3
.
name
,
op2
.
dof
);
ProgramGlobals
::
FermionOrBosonEnum
fermionOrBoson
=
ProgramGlobals
::
FermionOrBosonEnum
::
BOSON
;
// FIXME:
if
(
op1
.
fermionOrBoson
==
ProgramGlobals
::
FermionOrBosonEnum
::
FERMION
||
op2
.
fermionOrBoson
==
ProgramGlobals
::
FermionOrBosonEnum
::
FERMION
||
op3
.
fermionOrBoson
==
ProgramGlobals
::
FermionOrBosonEnum
::
FERMION
||
op4
.
fermionOrBoson
==
ProgramGlobals
::
FermionOrBosonEnum
::
FERMION
)
err
(
PsimagLite
::
String
(
__FILE__
)
+
"::push4(): Unsupported fermionic ops
\n
"
);
// can we also infer angularMomentum, angularFactor, and category? FIXME TODO
PsimagLite
::
String
modStr
(
"NNNN"
);
modStr
[
0
]
=
mod1
;
modStr
[
1
]
=
mod2
;
modStr
[
2
]
=
mod3
;
modStr
[
3
]
=
mod4
;
links_
.
push_back
(
OneLink
(
VectorSizeType
{
index1
,
index2
,
index3
,
index4
},
VectorSizeType
{
op1
.
edof
,
op2
.
edof
,
op3
.
edof
,
op4
.
edof
},
fermionOrBoson
,
modStr
,
su2properties
.
angularMomentum
,
su2properties
.
angularFactor
,
su2properties
.
category
,
vModifier
));
}
SizeType
size
()
const
{
return
links_
.
size
();
}
const
OneLinkType
&
operator
()(
SizeType
dof
)
const
...
...
src/Engine/SuperGeometry.h
View file @
825faf78
...
...
@@ -18,10 +18,26 @@ public:
typedef
typename
GeometryType
::
RealType
RealType
;
typedef
PsimagLite
::
GeometryDca
<
RealType
,
GeometryType
>
GeometryDcaType
;
typedef
PsimagLite
::
Vector
<
PsimagLite
::
String
>::
Type
VectorStringType
;
SuperGeometry
(
InputType_
&
io
)
:
geometry_
(
io
),
dcaPtr_
(
0
)
{}
{
// add super terms as needed
const
SizeType
n
=
geometry_
.
terms
();
for
(
SizeType
i
=
0
;
i
<
n
;
++
i
)
{
if
(
geometry_
.
directions
(
i
)
>
0
)
continue
;
// super term found
// it's gotta be "SuperPlaquette" for now, (only one option, sorry!)
if
(
geometry_
.
options
(
i
)
==
"SuperPlaquette"
)
{
if
(
std
::
find
(
superStrings_
.
begin
(),
superStrings_
.
end
(),
"SuperPlaquette"
)
!=
superStrings_
.
end
())
continue
;
superStrings_
.
push_back
(
"SuperPlaquette"
);
}
}
}
~
SuperGeometry
()
{
...
...
@@ -103,15 +119,15 @@ public:
return
blockSize
*
(
blockSize
/
2
+
1
);
// + superc_.size();
}
//
SizeType addSuperConnections(VectorVectorSizeType& data,
//
SizeType smax,
//
SizeType emin,
//
const VectorSizeType& block,
//
SizeType counter) const
//
{
//
SizeType c =
superc_.
addSuperConnections(data, smax, emin, block);
//
return c + counter;
//
}
SizeType
addSuperConnections
(
VectorVectorSizeType
&
data
,
SizeType
smax
,
SizeType
emin
,
const
VectorSizeType
&
block
,
SizeType
counter
)
const
{
SizeType
c
=
addSuperConnections
_
(
data
,
smax
,
emin
,
block
);
return
c
+
counter
;
}
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
SuperGeometry
&
supergeometry
)
{
...
...
@@ -121,6 +137,42 @@ public:
private:
SizeType
addSuperConnections_
(
VectorVectorSizeType
&
data
,
SizeType
smax
,
SizeType
emin
,
const
VectorSizeType
&
block
)
{
return
(
smax
+
1
==
emin
)
?
addSuperConnectionsFinite_
(
data
,
smax
,
emin
,
block
)
:
0
;
// : addSuperConnectionsInfinite_(data, smax, emin, block);
}
SizeType
addSuperConnectionsInfinite_
(
VectorVectorSizeType
&
data
,
SizeType
smax
,
SizeType
emin
,
const
VectorSizeType
&
block
)
{
if
(
superStrings_
.
size
()
==
0
)
return
0
;
assert
(
superStrings_
.
size
()
==
1
);
assert
(
superStrings_
[
0
]
==
"SuperPlaquette"
);
const
SizeType
linSize
=
geometry_
.
numberOfSites
();
// smax - 1, smax, emin, emin + 1
if
(
smax
>
0
&&
emin
+
1
<
linSize
)
data
.
push_back
(
VectorSizeType
{
smax
-
1
,
smax
,
emin
,
emin
+
1
});
// smax, emin, emin + 1, emin + 2
if
(
emin
+
2
<
linSize
)
data
.
push_back
(
VectorSizeType
{
smax
,
emin
,
emin
+
1
,
emin
+
2
});
// smax - 2, smax -1, smax, emin
if
(
smax
>
1
)
data
.
push_back
(
VectorSizeType
{
smax
-
2
,
smax
-
1
,
smax
,
emin
});
}
static
void
checkVectorHasTwoEntries
(
const
VectorSizeType
&
hItems
)
{
if
(
hItems
.
size
()
!=
2
)
...
...
@@ -129,6 +181,7 @@ private:
const
GeometryType
geometry_
;
mutable
GeometryDcaType
*
dcaPtr_
;
VectorStringType
superStrings_
;
};
}
...
...
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