From 1d6e708083221f48d8de2f7bc74fa0de6b97f679 Mon Sep 17 00:00:00 2001 From: Alessandro Lupo Date: Tue, 12 Oct 2021 09:06:15 +0100 Subject: [PATCH] tests! --- configure.ac | 1 + tests/Makefile.am | 2 +- tests/sp2n/Makefile.am | 7 ++++ tests/sp2n/Test_project_on_Sp.cc | 35 ++++++++++++++++++++ tests/sp2n/Test_sp2n_lie_gen.cc | 55 ++++++++++++++++++++++++++++++++ 5 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 tests/sp2n/Makefile.am create mode 100644 tests/sp2n/Test_project_on_Sp.cc create mode 100644 tests/sp2n/Test_sp2n_lie_gen.cc diff --git a/configure.ac b/configure.ac index 406b0b74..aece85f9 100644 --- a/configure.ac +++ b/configure.ac @@ -815,6 +815,7 @@ AC_CONFIG_FILES(tests/lanczos/Makefile) AC_CONFIG_FILES(tests/smearing/Makefile) AC_CONFIG_FILES(tests/qdpxx/Makefile) AC_CONFIG_FILES(tests/testu01/Makefile) +AC_CONFIG_FILES(tests/Sp2n/Makefile) AC_CONFIG_FILES(benchmarks/Makefile) AC_CONFIG_FILES(examples/Makefile) AC_OUTPUT diff --git a/tests/Makefile.am b/tests/Makefile.am index 7928a7fe..c6380cda 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = . core forces hmc solver debug smearing IO lanczos +SUBDIRS = . core forces hmc solver debug smearing IO lanczos sp2n if BUILD_CHROMA_REGRESSION SUBDIRS+= qdpxx diff --git a/tests/sp2n/Makefile.am b/tests/sp2n/Makefile.am new file mode 100644 index 00000000..0ee7421c --- /dev/null +++ b/tests/sp2n/Makefile.am @@ -0,0 +1,7 @@ +.PHONY: check + +include Make.inc + +check: tests + ./Test_project_on_Sp + ./test_sp2n_lie_gen diff --git a/tests/sp2n/Test_project_on_Sp.cc b/tests/sp2n/Test_project_on_Sp.cc new file mode 100644 index 00000000..61ec6d0c --- /dev/null +++ b/tests/sp2n/Test_project_on_Sp.cc @@ -0,0 +1,35 @@ +#include + +using namespace Grid; + +int main (int argc, char **argv) +{ + Grid_init(&argc,&argv); + + + Coordinate latt_size = GridDefaultLatt(); + Coordinate simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); + Coordinate mpi_layout = GridDefaultMpi(); + + GridCartesian Grid(latt_size,simd_layout,mpi_layout); + GridRedBlackCartesian RBGrid(&Grid); + + + LatticeGaugeField Umu(&Grid); + LatticeColourMatrixD U(&Grid); + + std::vector pseeds({1,2,3,4,5}); + std::vector sseeds({6,7,8,9,10}); + GridParallelRNG pRNG(&Grid); pRNG.SeedFixedIntegers(pseeds); + GridSerialRNG sRNG; sRNG.SeedFixedIntegers(sseeds); + + SU::HotConfiguration(pRNG,Umu); + U = PeekIndex(Umu,0); + + + U = ProjectOnSpGroup(U); + + Grid_finalize(); + + +} diff --git a/tests/sp2n/Test_sp2n_lie_gen.cc b/tests/sp2n/Test_sp2n_lie_gen.cc new file mode 100644 index 00000000..6c3766e6 --- /dev/null +++ b/tests/sp2n/Test_sp2n_lie_gen.cc @@ -0,0 +1,55 @@ + + + +#include +#include + +using namespace Grid; + +int main(int argc, char** argv) { + Grid_init(&argc, &argv); + + //std::vector latt({4, 4, 4, 8}); + //GridCartesian* grid = SpaceTimeGrid::makeFourDimGrid( + //latt, GridDefaultSimd(Nd, vComplex::Nsimd()), GridDefaultMpi()); + //GridRedBlackCartesian* rbGrid = SpaceTimeGrid::makeFourDimRedBlackGrid(grid); + + std::cout << GridLogMessage << "*********************************************" + << std::endl; + std::cout << GridLogMessage << "* Generators for Sp(2)" << std::endl; + std::cout << GridLogMessage << "*********************************************" + << std::endl; + + Sp2::printGenerators(); + Sp2::testGenerators(); + + std::cout << GridLogMessage << "*********************************************" + << std::endl; + std::cout << GridLogMessage << "* Generators for Sp(4)" << std::endl; + std::cout << GridLogMessage << "*********************************************" + << std::endl; + + Sp4::printGenerators(); + Sp4::testGenerators(); + + std::cout << GridLogMessage << "*********************************************" + << std::endl; + std::cout << GridLogMessage << "* Generators for Sp(6)" << std::endl; + std::cout << GridLogMessage << "*********************************************" + << std::endl; + + Sp6::printGenerators(); + Sp6::testGenerators(); + + std::cout << GridLogMessage << "*********************************************" + << std::endl; + std::cout << GridLogMessage << "* Generators for Sp(8)" << std::endl; + std::cout << GridLogMessage << "*********************************************" + << std::endl; + + Sp8::printGenerators(); + Sp8::testGenerators(); + + + Grid_finalize(); +}