46 INTEGER,
INTENT(IN) :: lmax, lmin, axis
47 INTEGER,
DIMENSION(:, :),
INTENT(OUT) :: map
48 INTEGER,
INTENT(IN),
OPTIONAL :: source_lmin
50 INTEGER :: i, ico, lowered(3), offset, power(3), &
51 raised(3), source_offset
55 map(:, i + 1) = [i + 1, i + 2, max(1, i), i]
59 source_offset = offset
60 IF (
PRESENT(source_lmin)) source_offset =
ncoset(source_lmin - 1)
61 DO ico = offset + 1,
ncoset(lmax)
65 raised(axis) = raised(axis) + 1
66 lowered(axis) = max(0, lowered(axis) - 1)
67 map(:, ico - offset) = [ico - source_offset, &
68 coset(raised(1), raised(2), raised(3)) - source_offset, &
69 max(1,
coset(lowered(1), lowered(2), lowered(3)) - source_offset), power(axis)]
84 PURE SUBROUTINE cartesian_ladder_real (source, values, map, derivative, exponent, origin, right)
85 REAL (kind=
dp),
DIMENSION(:, :),
INTENT(IN) :: source
86 REAL (kind=
dp),
DIMENSION(:, :),
INTENT(OUT) :: values
87 INTEGER,
DIMENSION(:, :),
INTENT(IN) :: map
88 LOGICAL,
INTENT(IN) :: derivative
89 REAL(kind=
dp),
INTENT(IN) :: exponent, origin
90 LOGICAL,
INTENT(IN) :: right
92 INTEGER :: i, j, second_index
93 REAL(kind=
dp) :: scale, second_scale(
SIZE(map, 2))
96 scale = 2.0_dp*exponent
97 second_scale = -real(map(4, :),
dp)
101 second_scale = origin
107 DO j = 1,
SIZE(map, 2)
108 DO i = 1,
SIZE(values, 1)
109 values(i, j) = scale*source(i, map(2, j)) + &
110 second_scale(j)*source(i, map(second_index, j))
114 DO j = 1,
SIZE(values, 2)
115 DO i = 1,
SIZE(map, 2)
116 values(i, j) = scale*source(map(2, i), j) + &
117 second_scale(i)*source(map(second_index, i), j)
132 PURE SUBROUTINE cartesian_ladder_complex (source, values, map, derivative, exponent, origin, right)
133 COMPLEX (KIND=dp),
DIMENSION(:, :),
INTENT(IN) :: source
134 COMPLEX (KIND=dp),
DIMENSION(:, :),
INTENT(OUT) :: values
135 INTEGER,
DIMENSION(:, :),
INTENT(IN) :: map
136 LOGICAL,
INTENT(IN) :: derivative
137 REAL(kind=
dp),
INTENT(IN) :: exponent, origin
138 LOGICAL,
INTENT(IN) :: right
140 INTEGER :: i, j, second_index
141 REAL(kind=
dp) :: scale, second_scale(
SIZE(map, 2))
144 scale = 2.0_dp*exponent
145 second_scale = -real(map(4, :),
dp)
149 second_scale = origin
155 DO j = 1,
SIZE(map, 2)
156 DO i = 1,
SIZE(values, 1)
157 values(i, j) = scale*source(i, map(2, j)) + &
158 second_scale(j)*source(i, map(second_index, j))
162 DO j = 1,
SIZE(values, 2)
163 DO i = 1,
SIZE(map, 2)
164 values(i, j) = scale*source(map(2, i), j) + &
165 second_scale(i)*source(map(second_index, i), j)
191 ab, values, right, derivative, exponents, origin)
192 INTEGER,
INTENT(IN) :: la_max, la_min, npgfa, lb_max, lb_min, &
194 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(IN) :: ab
195 REAL(kind=
dp),
DIMENSION(:, :, :),
INTENT(OUT) :: values
196 LOGICAL,
INTENT(IN) :: right, derivative
197 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN),
OPTIONAL :: exponents
198 REAL(kind=
dp),
DIMENSION(3),
INTENT(IN),
OPTIONAL :: origin
200 INTEGER :: axis, ia, iap, ib, ibp, ipgf, jpgf, n, &
201 na, nap, nb, nbp, source_min_a, &
203 INTEGER,
ALLOCATABLE :: map(:, :, :)
204 LOGICAL :: valid_shape
205 REAL(kind=
dp) :: center(3), exponent
209 source_min_a = la_min
210 source_min_b = lb_min
213 source_min_b = max(0, lb_min - 1)
215 source_min_a = max(0, la_min - 1)
221 cpassert(
PRESENT(exponents))
223 valid_shape = all(shape(ab) >= [nap*npgfa, nbp*npgfb])
224 cpassert(valid_shape)
225 valid_shape = all(shape(values) >= [na*npgfa, nb*npgfb, 3])
226 cpassert(valid_shape)
228 IF (
PRESENT(origin)) center = origin
229 n = merge(nb, na, right)
230 ALLOCATE (map(4, n, 3))
247 IF (derivative) exponent = exponents(merge(jpgf, ipgf, right))
250 values(ia + 1:ia + na, ib + 1:ib + nb, axis), map(:, :, axis), &
251 derivative, exponent, center(axis), right)
268 SUBROUTINE apply_cartesian_1d_real (source, values, la_max, lb_max, right, derivative, exponent, origin)
269 REAL (KIND=
dp),
DIMENSION(0:, 0:, :),
INTENT(IN) :: source
270 REAL (KIND=
dp),
DIMENSION(0:, 0:, :),
INTENT(INOUT) :: values
271 INTEGER,
INTENT(IN) :: la_max, lb_max
272 LOGICAL,
INTENT(IN) :: right, derivative
273 REAL(KIND=
dp),
INTENT(IN) :: exponent, origin(3)
275 INTEGER :: axis, map(4, MERGE(lb_max, la_max, right) + 1)
279 CALL cartesian_ladder(source(:, :, axis), values(0:la_max, 0:lb_max, axis), map, &
280 derivative, exponent, origin(axis), right)
294 SUBROUTINE apply_cartesian_1d_complex (source, values, la_max, lb_max, right, derivative, exponent, origin)
295 COMPLEX (KIND=dp),
DIMENSION(0:, 0:, :),
INTENT(IN) :: source
296 COMPLEX (KIND=dp),
DIMENSION(0:, 0:, :),
INTENT(INOUT) :: values
297 INTEGER,
INTENT(IN) :: la_max, lb_max
298 LOGICAL,
INTENT(IN) :: right, derivative
299 REAL(KIND=
dp),
INTENT(IN) :: exponent, origin(3)
301 INTEGER :: axis, map(4, MERGE(lb_max, la_max, right) + 1)
305 CALL cartesian_ladder(source(:, :, axis), values(0:la_max, 0:lb_max, axis), map, &
306 derivative, exponent, origin(axis), right)
322 REAL(kind=
dp),
DIMENSION(0:, 0:, :),
INTENT(IN) :: source
323 REAL(kind=
dp),
DIMENSION(0:, 0:, 0:, :), &
324 INTENT(OUT) :: values
325 INTEGER,
INTENT(IN) :: la_max, lb_max, powers(0:)
326 REAL(kind=
dp),
INTENT(IN) :: origin(3)
328 INTEGER :: axis, i, k, p
329 REAL(kind=
dp) :: coefficient
332 DO i = 0,
SIZE(powers) - 1
334 IF (abs(origin(axis)) <= 0.0_dp)
THEN
335 values(:, :, i, axis) = source(p:p + la_max, 0:lb_max, axis)
337 values(:, :, i, axis) = 0.0_dp
340 values(:, :, i, axis) = values(:, :, i, axis) + &
341 coefficient*source(k:k + la_max, 0:lb_max, axis)
subroutine, public cartesian_polynomial_1d(source, values, la_max, lb_max, powers, origin)
Form requested coordinate powers from separable Cartesian integral tables. Only requested powers are ...
subroutine, public cartesian_ladder_map(lmax, lmin, axis, map, source_lmin)
Construct base, raised, lowered and degree indices for a Cartesian ladder.
subroutine, public apply_cartesian_operator(la_max, la_min, npgfa, lb_max, lb_min, npgfb, ab, values, right, derivative, exponents, origin)
Apply a Cartesian operator on either side of a primitive integral block. The input includes one extra...
elemental real(kind=dp) function, public binomial_gen(z, k)
The generalized binomial coefficient z over k for 0 <= k <= n is calculated. (z) z*(z-1)*....