TRIQS/triqs_modest 3.3.0
Brillouin zone summation
Loading...
Searching...
No Matches
Wien2k.cpp
Go to the documentation of this file.
1// Copyright (c) 2025--present, The Simons Foundation
2// This file is part of TRIQS/modest and is licensed under the terms of GPLv3 or later.
3// SPDX-License-Identifier: GPL-3.0-or-later
4// See LICENSE in the root of this distribution for details.
5
6#include "../dft_code_specific.hpp"
7#include <stdexcept>
8
10
11 nda::matrix<dcomplex> get_spherical_to_dft_rotation_Wien2k(long l) {
12 if (l == 0) std::runtime_error("No l=0 implementation");
13
14 auto size = 2 * l + 1;
15 auto Ylm = nda::zeros<dcomplex>(size, size);
16 if (l == 1) {
17 Ylm(0, 0) = 1.0 / std::sqrt(2.0);
18 Ylm(1, 0) = dcomplex(0, 1.0) / std::sqrt(2.0);
19 Ylm(2, 1) = 1.0;
20 Ylm(0, 2) = -1.0 / std::sqrt(2.0);
21 Ylm(1, 2) = dcomplex(0, 1.0) / std::sqrt(2.0);
22 } else if (l == 2) {
23 Ylm(0, 2) = 1.0;
24 Ylm(1, 0) = 1.0 / std::sqrt(2);
25 Ylm(2, 0) = -1.0 / std::sqrt(2);
26 Ylm(3, 1) = 1.0 / std::sqrt(2);
27 Ylm(4, 1) = 1.0 / std::sqrt(2);
28 Ylm(1, 4) = 1.0 / std::sqrt(2);
29 Ylm(2, 4) = 1.0 / std::sqrt(2);
30 Ylm(3, 3) = -1.0 / std::sqrt(2);
31 Ylm(4, 3) = 1.0 / std::sqrt(2);
32 } else if (l == 3) {
33 Ylm(0, 0) = 1.0 / std::sqrt(2);
34 Ylm(1, 1) = 1.0 / std::sqrt(2);
35 Ylm(2, 2) = 1.0 / std::sqrt(2);
36 Ylm(0, 6) = 1.0 / std::sqrt(2);
37 Ylm(1, 5) = 1.0 / std::sqrt(2);
38 Ylm(2, 4) = 1.0 / std::sqrt(2);
39 Ylm(3, 3) = 1.0;
40 Ylm(4, 2) = dcomplex(0, 1.0) / std::sqrt(2);
41 Ylm(5, 1) = dcomplex(0, 1.0) / std::sqrt(2);
42 Ylm(6, 0) = dcomplex(0, 1.0) / std::sqrt(2);
43 Ylm(4, 4) = dcomplex(0, 1.0) / std::sqrt(2);
44 Ylm(5, 5) = dcomplex(0, -1.0) / std::sqrt(2);
45 Ylm(6, 6) = dcomplex(0, 1.0) / std::sqrt(2);
46 }
47 return Ylm;
48 }
49} // namespace triqs::modest::dft_code
nda::matrix< dcomplex > get_spherical_to_dft_rotation_Wien2k(long l)
Definition Wien2k.cpp:11
std::complex< double > dcomplex
Definition nda_supp.hpp:8