MolSSI Integral Reference Project
shell.h
Go to the documentation of this file.
1 /*! \file
2  *
3  * \brief Functions related to gaussians and shells
4  */
5 
6 #include <arb.h>
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 /*! \brief Number of cartesian functions for a given angular momentum */
13 #define MIRP_NCART(am) ((((am)+1)*((am)+2))/2)
14 
15 /*! \brief Number of cartesian functions for 2 shells */
16 #define MIRP_NCART2(am1, am2) \
17  (MIRP_NCART((am1)) * MIRP_NCART((am2)))
18 
19 /*! \brief Number of cartesian functions for 4 shells */
20 #define MIRP_NCART4(am1, am2, am3, am4) \
21  (MIRP_NCART2((am1),(am2)) * MIRP_NCART2((am3),(am4)))
22 
23 /*! \brief Number of cartesian functions for an lmn triplet */
24 #define MIRP_NCART_LMN(lmn) \
25  (MIRP_NCART((lmn[0])+(lmn[1])+(lmn[2])))
26 
27 /*! \brief Number of cartesian functions for 2 lmn triplets */
28 #define MIRP_NCART_LMN2(lmn1, lmn2) \
29  (MIRP_NCART_LMN((lmn1)) * MIRP_NCART_LMN((lmn2)))
30 
31 /*! \brief Number of cartesian functions for 4 lmn triplets */
32 #define MIRP_NCART_LMN4(lmn1, lmn2, lmn3, lmn4) \
33  (MIRP_NCART_LMN2((lmn1),(lmn2)) * MIRP_NCART_LMN2((lmn3),(lmn4)))
34 
35 
36 /*! \brief Find the next gaussian in the ordering
37  *
38  * Obtain the next l, m, and n parameters of a gaussian in the internal MIRP
39  * ordering
40  *
41  * For example, if \p lmn = {2, 1, 0} is input, the result will be {2, 0, 1}.
42  *
43  * If the return value of this function is 0, the contents of \p lmn are not
44  * defined.
45  *
46  * \param [inout] lmn The l, m, and n parameters of a gaussian basis function
47  * \return Nonzero if the new \p lmn is a valid gaussian, 0 if it is not
48  * (i.e., we have iterated past the end of the complete set of
49  * gaussians)
50  */
51 int mirp_iterate_gaussian(int * lmn);
52 
53 
54 /*! \brief Create all lmn combinations for a given angular momentum
55  *
56  * This fills in the \p lmn parameter will all combinations of l,m, and n
57  * that are valid for the given angular momentum. They will be in order.
58  *
59  * \warning The \p lmn parameter must be allocated and large enough
60  * to hold 3*number of cartesian components for the given \p am
61  *
62  * \param [in] am The angular momentum
63  * \param [out] lmn Place to put all the lmn combinations
64  */
65 void mirp_gaussian_fill_lmn(int am, int * lmn);
66 
67 
68 /*! \brief Normalize a shell (double precision)
69  *
70  * This function normalizes the contraction coefficients of the shell.
71  *
72  * \param [in] am The angular momentum of the shell (0 = s, 1 = p, etc)
73  * \param [in] nprim Number of primitives in the shell
74  * \param [in] ngeneral Number of general contractions in the shell
75  * \param [in] alpha The exponents of the shell (length \p nprim)
76  * \param [in] coeff The (unnormalized) contraction coefficients
77  * (length \p nprim * \p ngeneral)
78  * \param [out] coeff_out Normalized contraction coefficients
79  * (length \p nprim * \p ngeneral)
80  * \param [in] working_prec The working precision (binary digits/bits) to use
81  * in the calculation
82  */
83 void mirp_normalize_shell(int am, int nprim, int ngeneral,
84  arb_srcptr alpha,
85  arb_srcptr coeff,
86  arb_ptr coeff_out,
87  slong working_prec);
88 
89 
90 #ifdef __cplusplus
91 }
92 #endif
93 
void mirp_normalize_shell(int am, int nprim, int ngeneral, arb_srcptr alpha, arb_srcptr coeff, arb_ptr coeff_out, slong working_prec)
Normalize a shell (double precision)
Definition: shell.c:47
int mirp_iterate_gaussian(int *lmn)
Find the next gaussian in the ordering.
Definition: shell.c:11
void mirp_gaussian_fill_lmn(int am, int *lmn)
Create all lmn combinations for a given angular momentum.
Definition: shell.c:32