Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TK-SVM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LDAP_ls-schollwoeck
TK-SVM
Commits
fc685f60
Commit
fc685f60
authored
6 years ago
by
Jonas Greitemann
Browse files
Options
Downloads
Patches
Plain Diff
Add honeycomb lattice
parent
a52868f3
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
frustmag/CMakeLists.txt
+8
-0
8 additions, 0 deletions
frustmag/CMakeLists.txt
frustmag/lattice/honeycomb.hpp
+70
-0
70 additions, 0 deletions
frustmag/lattice/honeycomb.hpp
frustmag/main.cpp
+3
-0
3 additions, 0 deletions
frustmag/main.cpp
frustmag/test/lattice.cpp
+25
-0
25 additions, 0 deletions
frustmag/test/lattice.cpp
with
106 additions
and
0 deletions
frustmag/CMakeLists.txt
+
8
−
0
View file @
fc685f60
...
...
@@ -40,6 +40,12 @@ target_compile_definitions(heisenberg-triangular PUBLIC -DHEISENBERG -DTRIANGULA
add_executable
(
ising-triangular main.cpp
)
target_compile_definitions
(
ising-triangular PUBLIC -DISING -DTRIANGULAR
)
add_executable
(
heisenberg-honeycomb main.cpp
)
target_compile_definitions
(
heisenberg-honeycomb PUBLIC -DHEISENBERG -DHONEYCOMB
)
add_executable
(
ising-honeycomb main.cpp
)
target_compile_definitions
(
ising-honeycomb PUBLIC -DISING -DHONEYCOMB
)
# Use ALPSCore_LIBRARIES variable to link to ALPSCore
target_link_libraries
(
heisenberg-chain
${
ALPSCore_LIBRARIES
}
stdc++fs
)
target_link_libraries
(
ising-chain
${
ALPSCore_LIBRARIES
}
stdc++fs
)
...
...
@@ -49,6 +55,8 @@ target_link_libraries(heisenberg-cubic ${ALPSCore_LIBRARIES} stdc++fs)
target_link_libraries
(
ising-cubic
${
ALPSCore_LIBRARIES
}
stdc++fs
)
target_link_libraries
(
heisenberg-triangular
${
ALPSCore_LIBRARIES
}
stdc++fs
)
target_link_libraries
(
ising-triangular
${
ALPSCore_LIBRARIES
}
stdc++fs
)
target_link_libraries
(
heisenberg-honeycomb
${
ALPSCore_LIBRARIES
}
stdc++fs
)
target_link_libraries
(
ising-honeycomb
${
ALPSCore_LIBRARIES
}
stdc++fs
)
enable_testing
()
add_subdirectory
(
test
)
This diff is collapsed.
Click to expand it.
frustmag/lattice/honeycomb.hpp
0 → 100644
+
70
−
0
View file @
fc685f60
// SVM Order Parameters for Hidden Spin Order
// Copyright (C) 2018 Jonas Greitemann, Ke Liu, and Lode Pollet
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include
"lattice/bravais.hpp"
#include
<utility>
namespace
lattice
{
template
<
typename
Site
>
struct
honeycomb
:
bravais
<
Site
,
2ul
,
2ul
>
{
using
Base
=
bravais
<
Site
,
2ul
,
2ul
>
;
using
iterator
=
typename
Base
::
iterator
;
using
const_iterator
=
typename
Base
::
const_iterator
;
static
const
size_t
coordination
=
3
;
using
Base
::
bravais
;
auto
nearest_neighbors
(
iterator
const
&
it
)
->
std
::
array
<
iterator
,
coordination
>
{
if
(
it
.
basis_index
()
==
0
)
return
{
iterator
{
it
.
cell_it
(),
1
},
iterator
{
it
.
cell_it
().
down
(
0
),
1
},
iterator
{
it
.
cell_it
().
down
(
1
),
1
},
};
else
return
{
iterator
{
it
.
cell_it
(),
0
},
iterator
{
it
.
cell_it
().
up
(
0
),
0
},
iterator
{
it
.
cell_it
().
up
(
1
),
0
},
};
}
auto
nearest_neighbors
(
const_iterator
const
&
it
)
const
->
std
::
array
<
const_iterator
,
coordination
>
{
if
(
it
.
basis_index
()
==
0
)
return
{
const_iterator
{
it
.
cell_it
(),
1
},
const_iterator
{
it
.
cell_it
().
down
(
0
),
1
},
const_iterator
{
it
.
cell_it
().
down
(
1
),
1
},
};
else
return
{
const_iterator
{
it
.
cell_it
(),
0
},
const_iterator
{
it
.
cell_it
().
up
(
0
),
0
},
const_iterator
{
it
.
cell_it
().
up
(
1
),
0
},
};
}
};
}
This diff is collapsed.
Click to expand it.
frustmag/main.cpp
+
3
−
0
View file @
fc685f60
...
...
@@ -27,6 +27,7 @@
#include
"lattice/chain.hpp"
#include
"lattice/ortho.hpp"
#include
"lattice/triangular.hpp"
#include
"lattice/honeycomb.hpp"
#include
"update/single_flip.hpp"
#if defined HEISENBERG
...
...
@@ -47,6 +48,8 @@ using hamiltonian_t = hamiltonian_t_t<lattice::square>;
using
hamiltonian_t
=
hamiltonian_t_t
<
lattice
::
cubic
>
;
#elif defined TRIANGULAR
using
hamiltonian_t
=
hamiltonian_t_t
<
lattice
::
triangular
>
;
#elif defined HONEYCOMB
using
hamiltonian_t
=
hamiltonian_t_t
<
lattice
::
honeycomb
>
;
#else
#error Unknown lattice
#endif
...
...
This diff is collapsed.
Click to expand it.
frustmag/test/lattice.cpp
+
25
−
0
View file @
fc685f60
...
...
@@ -20,6 +20,7 @@
#include
<lattice/chain.hpp>
#include
<lattice/ortho.hpp>
#include
<lattice/triangular.hpp>
#include
<lattice/honeycomb.hpp>
#include
<algorithm>
#include
<iostream>
...
...
@@ -188,3 +189,27 @@ TEST_CASE("nn-triangular-5") {
};
test_nn
(
lattice
::
triangular
<
int_site
>
(
5
,
true
,
increment_gen
()),
nn_ind
);
}
TEST_CASE
(
"nn-honeycomb-3"
)
{
int
nn_ind
[][
3
]
=
{
{
1
,
5
,
13
},
{
0
,
2
,
6
},
{
1
,
3
,
15
},
{
2
,
4
,
8
},
{
3
,
5
,
17
},
{
0
,
4
,
10
},
{
1
,
7
,
11
},
{
6
,
8
,
12
},
{
3
,
7
,
9
},
{
8
,
10
,
14
},
{
5
,
9
,
11
},
{
6
,
10
,
16
},
{
7
,
13
,
17
},
{
0
,
12
,
14
},
{
9
,
13
,
15
},
{
2
,
14
,
16
},
{
11
,
15
,
17
},
{
4
,
12
,
16
},
};
test_nn
(
lattice
::
honeycomb
<
int_site
>
(
3
,
true
,
increment_gen
()),
nn_ind
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment