Skip to content
Snippets Groups Projects
Commit b4c2785f authored by Jonas Greitemann's avatar Jonas Greitemann
Browse files

Add kagome lattice

parent 93937c04
No related branches found
No related tags found
No related merge requests found
......@@ -46,6 +46,12 @@ target_compile_definitions(heisenberg-honeycomb PUBLIC -DHEISENBERG -DHONEYCOMB)
add_executable(ising-honeycomb main.cpp)
target_compile_definitions(ising-honeycomb PUBLIC -DISING -DHONEYCOMB)
add_executable(heisenberg-kagome main.cpp)
target_compile_definitions(heisenberg-kagome PUBLIC -DHEISENBERG -DKAGOME)
add_executable(ising-kagome main.cpp)
target_compile_definitions(ising-kagome PUBLIC -DISING -DKAGOME)
# 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)
......@@ -57,6 +63,8 @@ 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)
target_link_libraries(heisenberg-kagome ${ALPSCore_LIBRARIES} stdc++fs)
target_link_libraries(ising-kagome ${ALPSCore_LIBRARIES} stdc++fs)
enable_testing()
add_subdirectory(test)
// 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 kagome : bravais<Site, 2ul, 3ul> {
using Base = bravais<Site, 2ul, 3ul>;
using iterator = typename Base::iterator;
using const_iterator = typename Base::const_iterator;
static const size_t coordination = 4;
using Base::bravais;
auto nearest_neighbors(iterator const& it)
-> std::array<iterator, coordination>
{
switch (it.basis_index()) {
case 0:
return {
iterator{it.cell_it(), 1},
iterator{it.cell_it(), 2},
iterator{it.cell_it().down(0), 1},
iterator{it.cell_it().down(1), 2},
};
case 1:
{
auto up = it.cell_it().up(0);
return {
iterator{it.cell_it(), 0},
iterator{it.cell_it(), 2},
iterator{up, 0},
iterator{up.down(1), 2},
};
}
case 2:
{
auto up = it.cell_it().up(1);
return {
iterator{it.cell_it(), 0},
iterator{it.cell_it(), 1},
iterator{up, 0},
iterator{up.down(0), 1},
};
}
default:
return {};
}
}
auto nearest_neighbors(const_iterator const& it) const
-> std::array<const_iterator, coordination>
{
switch (it.basis_index()) {
case 0:
return {
const_iterator{it.cell_it(), 1},
const_iterator{it.cell_it(), 2},
const_iterator{it.cell_it().down(0), 1},
const_iterator{it.cell_it().down(1), 2},
};
case 1:
{
auto up = it.cell_it().up(0);
return {
const_iterator{it.cell_it(), 0},
const_iterator{it.cell_it(), 2},
const_iterator{up, 0},
const_iterator{up.down(1), 2},
};
}
case 2:
{
auto up = it.cell_it().up(1);
return {
const_iterator{it.cell_it(), 0},
const_iterator{it.cell_it(), 1},
const_iterator{up, 0},
const_iterator{up.down(0), 1},
};
}
default:
return {};
}
}
};
}
......@@ -28,6 +28,7 @@
#include "lattice/ortho.hpp"
#include "lattice/triangular.hpp"
#include "lattice/honeycomb.hpp"
#include "lattice/kagome.hpp"
#include "update/single_flip.hpp"
#if defined HEISENBERG
......@@ -50,6 +51,8 @@ using hamiltonian_t = hamiltonian_t_t<lattice::cubic>;
using hamiltonian_t = hamiltonian_t_t<lattice::triangular>;
#elif defined HONEYCOMB
using hamiltonian_t = hamiltonian_t_t<lattice::honeycomb>;
#elif defined KAGOME
using hamiltonian_t = hamiltonian_t_t<lattice::kagome>;
#else
#error Unknown lattice
#endif
......
......@@ -21,6 +21,7 @@
#include <lattice/ortho.hpp>
#include <lattice/triangular.hpp>
#include <lattice/honeycomb.hpp>
#include <lattice/kagome.hpp>
#include <algorithm>
#include <iostream>
......@@ -213,3 +214,36 @@ TEST_CASE("nn-honeycomb-3") {
};
test_nn(lattice::honeycomb<int_site>(3, true, increment_gen()), nn_ind);
}
TEST_CASE("nn-kagome-3") {
int nn_ind[][4] = {
{ 1, 2, 7, 20},
{ 0, 2, 3, 23},
{ 0, 1, 9, 16},
{ 1, 4, 5, 23},
{ 3, 5, 6, 26},
{ 3, 4, 10, 12},
{ 4, 7, 8, 26},
{ 0, 6, 8, 20},
{ 6, 7, 13, 15},
{ 2, 10, 11, 16},
{ 5, 9, 11, 12},
{ 9, 10, 18, 25},
{ 5, 10, 13, 14},
{ 8, 12, 14, 15},
{12, 13, 19, 21},
{ 8, 13, 16, 17},
{ 2, 9, 15, 17},
{15, 16, 22, 24},
{11, 19, 20, 25},
{14, 18, 20, 21},
{ 0, 7, 18, 19},
{14, 19, 22, 23},
{17, 21, 23, 24},
{ 1, 3, 21, 22},
{17, 22, 25, 26},
{11, 18, 24, 26},
{ 4, 6, 24, 25},
};
test_nn(lattice::kagome<int_site>(3, true, increment_gen()), nn_ind);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment