Line data Source code
1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include <cstddef> 7 : 8 : #include "DataStructures/ModalVector.hpp" 9 : #include "DataStructures/Tensor/Tensor.hpp" 10 : #include "Utilities/TMPL.hpp" 11 : 12 : namespace ylm { 13 : /// @{ 14 : /*! 15 : * \brief Converts real spherical harmonic coefficients of degree l into a 16 : * symmetric trace-free tensor of rank l. 17 : * 18 : * \details Spherical harmonics of degree l are equivalent to symmetric 19 : * trace-free tensors of rank l. This equivalence and the transformation is 20 : * given e.g. in \cite Thorne1980, Eqs. (2.10) - (2.14). The conversion 21 : * coefficients are hard-coded to numerical precision and implemented up to 22 : * order l=2. 23 : * 24 : * The spherical harmonic coefficients are expected to be sorted with ascending 25 : * m, i.e. (-m, -m+1, ... , m) 26 : */ 27 1 : Scalar<double> ylm_to_stf_0(const ModalVector& l0_coefs); 28 : 29 : template <typename Frame> 30 1 : tnsr::i<double, 3, Frame> ylm_to_stf_1(const ModalVector& l1_coefs); 31 : 32 : template <typename Frame> 33 1 : tnsr::ii<double, 3, Frame> ylm_to_stf_2(const ModalVector& l2_coefs); 34 : /// @} 35 : } // namespace ylm