15template <
typename Kind, std::
size_t N,
typename Scalar_>
18template <
typename Kind_, std::
size_t N_,
typename Scalar__>
21 constexpr static int Nq = 1;
33template <
typename Kind, std::
size_t N,
typename Scalar_ =
double>
37 static constexpr size_t Nq = 1;
43 static constexpr std::array<bool, Nq>
ABELIAN = {
true};
44 static constexpr std::array<bool, Nq>
IS_TRIVIAL = {
false};
45 static constexpr std::array<bool, Nq>
IS_MODULAR = {
true};
49 static constexpr std::array<int, Nq>
MOD_N = {
N};
74 if constexpr(
IS_SPIN[0]) {
return true; }
80 if constexpr(not
IS_SPIN[0]) {
return true; }
94 if constexpr(
N == 2) {
95 return std::array<qType, 1>{{
qarray<1>(std::array<int, 1>{{1}})}};
97 return std::array<qType, 2>{{
qarray<1>(std::array<int, 1>{{1}}),
qarray<1>(std::array<int, 1>{{
N - 1}})}};
101 inline static std::string
name()
104 if(
N == 2) {
return prefix +
"Zā"; }
105 if(
N == 3) {
return prefix +
"Zā"; }
106 if(
N == 4) {
return prefix +
"Zā"; }
107 if(
N == 5) {
return prefix +
"Zā
"; }
108 if(
N == 36) {
return prefix +
"Zāā"; }
109 if(
N == 64) {
return prefix +
"Zāā"; }
110 return prefix +
"Z(" + std::to_string(
N) +
")";
113 inline static constexpr std::array<KIND, Nq>
kind() {
return {Kind::name}; }
115 inline static qType conj(
const qType& q) {
return {util::constFct::posmod<N>(-q[0])}; }
144 return (q[0] % 2 != 0) ? -1. : 1.;
149 template <
typename PlainLib>
152 typedef typename PlainLib::Indextype IndexType;
153 auto T = PlainLib::template construct<Scalar>(std::array<IndexType, 2>{1, 1}, world);
154 std::array<IndexType, 2> index = {0, 0};
155 PlainLib::template setVal<Scalar, 2>(
T, index,
Scalar(1.));
166 template <
typename PlainLib>
176 return coeff_6j(q1, q2, Q12, q3, Q, Q23);
189 bool parity = (ql[0] % 2 != 0) and (qr[0] % 2 != 0);
190 sign = parity ? -1. : 1.;
191 SPDLOG_INFO(
"ql,pl={},{}; qr,pr={},{}; sign={}\n", ql[0], ql[0] % 2 != 0, qr[0], qr[0] % 2 != 0, sign);
200template <
typename Kind, std::
size_t N,
typename Scalar_>
203 std::vector<qType> vout;
204 vout.push_back({util::constFct::posmod<N>({ql[0] + qr[0]})});
208template <
typename Kind, std::
size_t N,
typename Scalar_>
209template <
typename PlainLib>
213 typedef typename PlainLib::Indextype IndexType;
214 auto T = PlainLib::template construct<Scalar>(std::array<IndexType, 3>{1, 1, 1}, world);
215 if(triangle(q1, q2, q3)) {
216 std::array<IndexType, 3> index = {0, 0, 0};
217 PlainLib::template setVal<Scalar, 3>(
T, index,
Scalar(1.));
219 std::array<IndexType, 3> index = {0, 0, 0};
220 PlainLib::template setVal<Scalar, 3>(
T, index,
Scalar(0.));
225template <
typename Kind, std::
size_t N,
typename Scalar_>
228 if(triangle(q1, q2, q3) and triangle(q1, q6, q5) and triangle(q2, q4, q6) and triangle(q3, q4, q5)) {
return Scalar(1.); }
232template <
typename Kind, std::
size_t N,
typename Scalar_>
236 if(util::constFct::posmod<N>(q1[0] + q2[0]) == q3[0]) {
return true; }
Definition: CombSym.hpp:8
@ FN
Definition: functions.hpp:38
@ M
Definition: functions.hpp:39
@ T
Definition: functions.hpp:35
@ N
Definition: functions.hpp:37
XpedWorld & getUniverse()
Definition: Mpi.hpp:49
int threadSafeRandUniform< int, int >(int min, int max, bool FIXED_SEED)
Definition: Random.hpp:32
CTF::Tensor< Scalar > TType
Definition: PlainInterface_Cyclops_impl.cpp:13
Definition: SymBase.hpp:14
qarray< Nq > qType
Definition: ZN.hpp:22
Scalar__ Scalar
Definition: ZN.hpp:23
Definition: SymBase.hpp:10
static constexpr bool IS_SPIN_U1()
Definition: ZN.hpp:72
static constexpr bool ALL_NON_ABELIAN
Definition: ZN.hpp:61
static constexpr auto lowest_qs()
Definition: ZN.hpp:92
static constexpr bool ALL_HAS_MULTIPLICITIES
Definition: ZN.hpp:60
static Scalar coeff_swap(const qType &ql, const qType &qr, const qType &qf)
Definition: ZN.hpp:185
static std::string name()
Definition: ZN.hpp:101
Scalar_ Scalar
Definition: ZN.hpp:36
static constexpr size_t Nq
Definition: ZN.hpp:37
static Scalar coeff_FS(const qType &)
Definition: ZN.hpp:147
static constexpr bool ANY_NON_ABELIAN
Definition: ZN.hpp:52
qarray< Nq > qType
Definition: ZN.hpp:39
static std::size_t multiplicity(const qType &q1, const qType &q2, const qType &q3)
Definition: ZN.hpp:130
static constexpr std::array< bool, Nq > ABELIAN
Definition: ZN.hpp:43
static constexpr std::array< KIND, Nq > kind()
Definition: ZN.hpp:113
static bool triangle(const qType &q1, const qType &q2, const qType &q3)
Definition: ZN.hpp:233
ZN()
Definition: ZN.hpp:89
static constexpr bool ANY_IS_BOSONIC
Definition: ZN.hpp:57
static qType conj(const qType &q)
Definition: ZN.hpp:115
static constexpr bool ANY_HAS_MULTIPLICITIES
Definition: ZN.hpp:51
static PlainLib::template TType< Scalar_, 2 > one_j_tensor(const qType &, const mpi::XpedWorld &world=mpi::getUniverse())
Definition: ZN.hpp:150
static constexpr std::array< bool, Nq > IS_SPIN
Definition: ZN.hpp:48
static qType random_q()
Definition: ZN.hpp:118
static constexpr bool ALL_IS_MODULAR
Definition: ZN.hpp:64
static Scalar coeff_rightOrtho(const qType &, const qType &)
Definition: ZN.hpp:159
static constexpr bool NO_CHARGE_SYM()
Definition: ZN.hpp:83
static Scalar coeff_dot(const qType &)
Definition: ZN.hpp:139
static constexpr std::array< bool, Nq > IS_TRIVIAL
Definition: ZN.hpp:44
static constexpr std::array< int, Nq > MOD_N
Definition: ZN.hpp:49
static constexpr std::array< bool, Nq > IS_FERMIONIC
Definition: ZN.hpp:46
static constexpr qType qvacuum()
Definition: ZN.hpp:91
static Scalar coeff_turn(const qType &ql, const qType &qr, const qType &qf)
Definition: ZN.hpp:170
static constexpr bool ANY_IS_FERMIONIC
Definition: ZN.hpp:56
static constexpr bool ANY_IS_TRIVIAL
Definition: ZN.hpp:54
static Scalar coeff_recouple(const qType &q1, const qType &q2, const qType &q3, const qType &Q, const qType &Q12, const qType &Q23)
Definition: ZN.hpp:174
static constexpr std::array< bool, Nq > IS_MODULAR
Definition: ZN.hpp:45
static constexpr bool ALL_IS_SPIN
Definition: ZN.hpp:67
static constexpr bool ANY_ABELIAN
Definition: ZN.hpp:53
static Scalar coeff_3j(const qType &q1, const qType &q2, const qType &q3, int, int, int)
Definition: ZN.hpp:161
static constexpr bool ALL_ABELIAN
Definition: ZN.hpp:62
static Scalar coeff_twist(const qType &q)
Definition: ZN.hpp:141
static constexpr bool ALL_IS_FERMIONIC
Definition: ZN.hpp:65
static constexpr bool NO_SPIN_SYM()
Definition: ZN.hpp:78
static Scalar coeff_9j(const qType &, const qType &, const qType &, const qType &, const qType &, const qType &, const qType &, const qType &, const qType &)
Definition: ZN.hpp:180
static constexpr bool ANY_IS_MODULAR
Definition: ZN.hpp:55
static constexpr bool IS_SPIN_SU2()
Definition: ZN.hpp:70
static std::vector< qType > basis_combine(const qType &ql, const qType &qr)
Definition: ZN.hpp:201
static PlainLib::template TType< Scalar_, 3 > CGC(const qType &q1, const qType &q2, const qType &q3, const std::size_t, const mpi::XpedWorld &world=mpi::getUniverse())
Definition: ZN.hpp:211
static constexpr bool ALL_IS_BOSONIC
Definition: ZN.hpp:66
static int degeneracy(const qType &)
Definition: ZN.hpp:116
static constexpr bool IS_CHARGE_SU2()
Definition: ZN.hpp:69
static constexpr std::array< bool, Nq > NON_ABELIAN
Definition: ZN.hpp:42
static constexpr std::array< bool, Nq > IS_BOSONIC
Definition: ZN.hpp:47
static constexpr bool ANY_IS_SPIN
Definition: ZN.hpp:58
static Scalar coeff_6j(const qType &q1, const qType &q2, const qType &q3, const qType &q4, const qType &q5, const qType &q6)
Definition: ZN.hpp:226
static constexpr std::array< bool, Nq > HAS_MULTIPLICITIES
Definition: ZN.hpp:41
static constexpr bool ALL_IS_TRIVIAL
Definition: ZN.hpp:63
Definition: qarray.hpp:30