17 USE ieee_arithmetic,
ONLY: ieee_is_finite
26#include "../base/base_uses.f90"
33 LOGICAL :: ready = .false.
34 REAL(kind=
dp) :: rcond = 0.0_dp
35 COMPLEX(KIND=dp),
ALLOCATABLE :: lu(:, :)
36 INTEGER,
ALLOCATABLE :: pivots(:)
47 REAL(
dp),
ALLOCATABLE :: kinetic(:, :), metric(:, :), wave_overlap(:, :), difference_kinetic(:, :), difference_overlap(:, :)
74 INTEGER,
INTENT(IN) ::
degree
76 INTEGER,
INTENT(OUT) :: info
77 LOGICAL,
INTENT(IN),
OPTIONAL :: direct
79 CALL prepare_atomic(pot,
degree, atomic, info, radial_only=.false., direct=direct)
90 INTEGER,
INTENT(IN) ::
degree
95 CALL prepare_atomic(pot,
degree, atomic, info, radial_only=.true.)
108 SUBROUTINE prepare_atomic(pot, degree, atomic, info, radial_only, direct)
110 INTEGER,
INTENT(IN) ::
degree
112 INTEGER,
INTENT(OUT) :: info
113 LOGICAL,
INTENT(IN) :: radial_only
114 LOGICAL,
INTENT(IN),
OPTIONAL :: direct
116 COMPLEX(dp),
ALLOCATABLE :: coupling(:, :), identity(:, :), &
118 INTEGER :: i, j, nb, np, p, q
119 REAL(
dp) :: norm_difference
120 REAL(
dp),
ALLOCATABLE :: delta_kinetic(:, :), &
121 delta_overlap(:, :), &
122 radial_kinetic(:, :), radial_weights(:)
126 nb = pot%number_of_proj
129 IF (pot%is_paw .OR. trim(pot%pseudo_type) ==
"PAW")
THEN
130 cpabort(
"Atom-local inverse PAW fixed-term accounting is not implemented")
132 cpassert(pot%is_ultrasoft)
133 IF (
PRESENT(direct))
THEN
136 CALL compact_projector(atomic%hard)
140 CALL inverse_radial_data(pot, radial)
142 CALL compact_projector(atomic%difference)
146 IF (.NOT. radial_only)
THEN
147 ALLOCATE (coupling(nb, nb), identity(nb, nb), rotation(nb, nb))
148 coupling(:, :) = inverse_radial_coupling(pot, radial, radial_weights)
149 identity = cmplx(0.0_dp, 0.0_dp,
dp)
151 identity(j, j) = cmplx(1.0_dp, 0.0_dp,
dp)
154 IF (info /= 0)
RETURN
157 hard%number_of_proj = nb
158 hard%has_so = pot%has_so
159 ALLOCATE (hard%r, source=pot%r)
160 ALLOCATE (hard%rab, source=pot%rab)
161 ALLOCATE (hard%lbeta, source=pot%lbeta)
162 ALLOCATE (hard%beta, source=matmul(pot%beta, real(transpose(rotation),
dp)))
163 ALLOCATE (hard%dion, source=pot%dion - radial_kinetic)
165 CALL compact_projector(atomic%hard)
167 np = atomic%difference%nproj
168 ALLOCATE (atomic%kinetic(np, np), atomic%metric(np, np), atomic%wave_overlap(np, np), &
169 atomic%difference_kinetic(np, np), atomic%difference_overlap(np, np), source=0.0_dp)
170 cpassert(
ALLOCATED(pot%qij))
171 cpassert(all(shape(pot%qij) == [nb, nb]))
173 j = atomic%difference%radial_index(q)
175 IF (atomic%difference%angular_index(p) /= atomic%difference%angular_index(q)) cycle
176 i = atomic%difference%radial_index(p)
177 atomic%kinetic(p, q) = radial_kinetic(i, j)
178 atomic%difference_kinetic(p, q) = delta_kinetic(i, j)
179 atomic%difference_overlap(p, q) = delta_overlap(i, j)
181 norm_difference = sum(radial_weights*( &
182 pot%partial_waves%ae_wfc(:, i)*pot%partial_waves%ae_wfc(:, j) - &
183 pot%partial_waves%ps_wfc(:, i)*pot%partial_waves%ps_wfc(:, j)))
184 atomic%metric(p, q) = pot%qij(i, j) - norm_difference
185 atomic%wave_overlap(p, q) = norm_difference
188 END SUBROUTINE prepare_atomic
194 SUBROUTINE compact_projector(projector)
198 REAL(
dp),
ALLOCATABLE :: radial(:), weighted(:, :)
200 last =
SIZE(projector%r)
202 IF (any(projector%weighted_beta(last, :) /= 0.0_dp))
EXIT
205 IF (last ==
SIZE(projector%r))
RETURN
206 ALLOCATE (radial, source=projector%r(:last))
207 ALLOCATE (weighted, source=projector%weighted_beta(:last, :))
208 CALL move_alloc(radial, projector%r)
209 CALL move_alloc(weighted, projector%weighted_beta)
210 END SUBROUTINE compact_projector
226 REAL(
dp),
ALLOCATABLE,
INTENT(OUT) :: matrix(:, :)
227 REAL(
dp),
ALLOCATABLE,
INTENT(OUT),
OPTIONAL :: difference_kinetic(:, :), &
228 difference_overlap(:, :)
230 INTEGER :: i, ir, j, l, m, nb, p, q
231 INTEGER,
ALLOCATABLE :: first(:)
233 REAL(
dp),
ALLOCATABLE :: gradient(:, :), kernel(:, :),
value(:), &
237 cpassert(kinetic%delta%nproj == sum(2*pot%lbeta + 1))
238 cpassert(all(kinetic%delta%lbeta == pot%lbeta))
239 ALLOCATE (matrix(nb, nb), source=0.0_dp)
240 ALLOCATE (kernel(kinetic%delta%nproj, kinetic%delta%nproj), first(nb))
242 cpassert(
PRESENT(difference_kinetic) .EQV.
PRESENT(difference_overlap))
243 IF (
PRESENT(difference_kinetic))
THEN
244 ALLOCATE (difference_kinetic(nb, nb), difference_overlap(nb, nb), &
245 value(kinetic%delta%nproj), gradient(3, kinetic%delta%nproj))
246 difference_kinetic = 0.0_dp
247 difference_overlap = 0.0_dp
252 p = p + 2*pot%lbeta(i) + 1
254 DO ir = 1,
SIZE(pot%r)
255 IF (weights(ir) == 0.0_dp) cycle
256 IF (pot%r(ir) >= kinetic%delta%radius)
EXIT
258 IF (
PRESENT(difference_kinetic))
THEN
263 factor =
fourpi*weights(ir)/real(2*l + 1,
dp)
265 IF (pot%lbeta(i) /= l) cycle
269 matrix(i, j) = matrix(i, j) + factor*kernel(p, q)
270 IF (
PRESENT(difference_kinetic))
THEN
271 difference_kinetic(i, j) = difference_kinetic(i, j) + 0.5_dp*factor*dot_product(gradient(:, p), gradient(:, q))
272 difference_overlap(i, j) = difference_overlap(i, j) + factor*value(p)*value(q)
280 matrix(j, i) = matrix(i, j)
281 IF (
PRESENT(difference_kinetic))
THEN
282 difference_kinetic(j, i) = difference_kinetic(i, j)
283 difference_overlap(j, i) = difference_overlap(i, j)
301 kinetic_residual, metric_residual)
303 COMPLEX(dp),
INTENT(IN) :: coefficients(:, :), delta_overlap(:, :), &
305 COMPLEX(dp),
ALLOCATABLE,
INTENT(OUT) :: kinetic_residual(:, :), &
306 metric_residual(:, :)
308 COMPLEX(dp),
ALLOCATABLE :: mixed(:, :)
311 np =
SIZE(atomic%difference_kinetic, 1)
312 n =
SIZE(coefficients, 2)
313 cpassert(
SIZE(coefficients, 1) == np)
314 cpassert(all(shape(delta_overlap) == [np, n]))
315 cpassert(all(shape(delta_kinetic) == [np, n]))
316 ALLOCATE (mixed, source=matmul(conjg(transpose(delta_kinetic)), coefficients))
317 ALLOCATE (kinetic_residual, source=-mixed - conjg(transpose(mixed)) + &
318 matmul(conjg(transpose(coefficients)), matmul(atomic%difference_kinetic + atomic%kinetic, coefficients)))
319 mixed(:, :) = matmul(conjg(transpose(delta_overlap)), coefficients)
320 ALLOCATE (metric_residual, source=-mixed - conjg(transpose(mixed)) + &
321 matmul(conjg(transpose(coefficients)), matmul(atomic%difference_overlap + atomic%wave_overlap, coefficients)))
339 CALL inverse_radial_data(pot, radial)
341 DO i = 1, pot%number_of_proj
342 IF (pot%r(1) == 0.0_dp)
THEN
343 radial%beta(2:, i) = pot%partial_waves%ps_wfc(2:, i)/pot%r(2:)
344 radial%beta(1, i) = 0.0_dp
346 radial%beta(:, i) = pot%partial_waves%ps_wfc(:, i)/pot%r
363 REAL(
dp),
INTENT(IN) :: displacement(3)
364 REAL(
dp),
INTENT(OUT) :: matrix(:, :)
365 REAL(
dp),
INTENT(OUT),
OPTIONAL :: gradient(:, :, :)
367 INTEGER :: axis, i, j, n
368 REAL(
dp),
ALLOCATABLE :: d(:, :), dd(:, :, :), p(:, :), &
369 pd(:, :, :),
value(:)
371 n = kinetic%delta%nproj
372 cpassert(kinetic%pseudo%nproj == n .AND. all(shape(matrix) == [n, n]))
374 IF (
PRESENT(gradient))
THEN
375 cpassert(all(shape(gradient) == [n, n, 3]))
378 IF (sum(displacement**2) >= kinetic%delta%radius**2)
RETURN
379 ALLOCATE (value(n), d(3, n), p(3, n))
380 IF (
PRESENT(gradient))
THEN
381 ALLOCATE (dd(3, 3, n), pd(3, 3, n))
390 matrix(i, j) = 0.5_dp*(dot_product(d(:, i), d(:, j)) + &
391 dot_product(d(:, i), p(:, j)) + dot_product(p(:, i), d(:, j)))
392 matrix(j, i) = matrix(i, j)
393 IF (
PRESENT(gradient))
THEN
395 gradient(i, j, axis) = 0.5_dp*(dot_product(dd(:, axis, i), d(:, j) + p(:, j)) + &
396 dot_product(d(:, i) + p(:, i), dd(:, axis, j)) + &
397 dot_product(pd(:, axis, i), d(:, j)) + &
398 dot_product(d(:, i), pd(:, axis, j)))
399 gradient(j, i, axis) = gradient(i, j, axis)
416 INTEGER,
INTENT(IN) ::
degree
421 CALL inverse_radial_data(pot, radial)
438 LOGICAL,
INTENT(IN),
OPTIONAL :: direct
439 REAL(
dp),
ALLOCATABLE,
INTENT(OUT),
OPTIONAL :: home_coupling(:, :)
442 REAL(
dp),
ALLOCATABLE :: radial_coupling(:, :)
446 IF (
PRESENT(home_coupling))
ALLOCATE (home_coupling(beta%nproj, beta%nproj), source=0.0_dp)
447 IF (
PRESENT(direct))
THEN
449 ALLOCATE (radial%beta(
SIZE(pot%r),
SIZE(pot%lbeta)), source=0.0_dp)
454 IF (trim(pot%pseudo_type) ==
"NC" .AND. .NOT. pot%is_ultrasoft .AND. .NOT. pot%is_paw)
THEN
455 IF (pot%has_so) cpabort(
"Spin-orbit UPF inverse fields are not supported")
456 ALLOCATE (radial%beta(
SIZE(pot%r),
SIZE(pot%lbeta)))
460 CALL inverse_radial_data(pot, radial)
462 IF (
PRESENT(home_coupling))
THEN
463 ALLOCATE (radial_coupling(pot%number_of_proj, pot%number_of_proj))
465 DO q = 1, delta%nproj
467 IF (beta%angular_index(p) /= delta%angular_index(q)) cycle
468 home_coupling(p, q) = radial_coupling(beta%radial_index(p), delta%radial_index(q))
482 FUNCTION inverse_radial_coupling(pot, radial, radial_weights)
RESULT(coupling)
484 REAL(
dp),
INTENT(IN) :: radial_weights(:)
485 REAL(
dp) :: coupling(pot%number_of_proj, pot%number_of_proj)
488 REAL(
dp) :: weights(size(radial_weights))
490 weights = radial_weights*pot%r**2
492 DO j = 1, pot%number_of_proj
493 DO i = 1, pot%number_of_proj
494 IF (pot%lbeta(i) /= pot%lbeta(j)) cycle
495 coupling(i, j) = sum(weights*pot%beta(:, i)*radial%beta(:, j))
498 END FUNCTION inverse_radial_coupling
505 SUBROUTINE inverse_radial_data(pot, radial)
512 cpabort(
"Spin-orbit UPF inverse fields are not supported")
514 IF (.NOT.
ALLOCATED(pot%partial_waves))
THEN
515 cpabort(
"Inverse UPF requires original AE/PS full waves for every projector")
517 cpassert(
ALLOCATED(pot%r) .AND.
ALLOCATED(pot%rab))
518 cpassert(
ALLOCATED(pot%lbeta))
519 IF (.NOT. (
ALLOCATED(pot%partial_waves%ae_wfc) .AND.
ALLOCATED(pot%partial_waves%ps_wfc)))
THEN
520 cpabort(
"Incomplete original AE/PS full waves")
522 cpassert(
ALLOCATED(pot%partial_waves%angular_momenta))
524 nb = pot%number_of_proj
525 cpassert(n >= 3 .AND. nb > 0 .AND. all(pot%r >= 0.0_dp))
526 cpassert(
SIZE(pot%rab) == n .AND.
SIZE(pot%lbeta) == nb)
527 cpassert(all(shape(pot%partial_waves%ae_wfc) == [n, nb]))
528 cpassert(all(shape(pot%partial_waves%ps_wfc) == [n, nb]))
529 cpassert(all(pot%partial_waves%angular_momenta == pot%lbeta))
530 cpassert(all(ieee_is_finite(pot%partial_waves%ae_wfc)))
531 cpassert(all(ieee_is_finite(pot%partial_waves%ps_wfc)))
532 radial%number_of_proj = nb
533 radial%has_so = pot%has_so
534 ALLOCATE (radial%r, source=pot%r)
535 ALLOCATE (radial%rab, source=pot%rab)
536 ALLOCATE (radial%lbeta, source=pot%lbeta)
537 ALLOCATE (radial%beta(n, nb), radial%dion(nb, nb))
538 radial%dion(:, :) = 0.0_dp
540 radial%beta(:, i) = pot%partial_waves%ae_wfc(:, i) - pot%partial_waves%ps_wfc(:, i)
541 IF (pot%r(1) == 0.0_dp)
THEN
542 radial%beta(2:, i) = radial%beta(2:, i)/pot%r(2:)
544 radial%beta(1, i) = 0.0_dp
546 radial%beta(:, i) = radial%beta(:, i)/pot%r
549 END SUBROUTINE inverse_radial_data
560 COMPLEX(KIND=dp),
INTENT(IN) :: beta_delta(:, :)
562 INTEGER,
INTENT(OUT) :: info
563 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: minimum_rcond
565 COMPLEX(KIND=dp),
ALLOCATABLE :: work(:)
567 REAL(kind=
dp) :: anorm, limit
568 REAL(kind=
dp),
ALLOCATABLE :: rwork(:)
569 REAL(kind=
dp),
EXTERNAL :: zlange
571 EXTERNAL zgecon, zgetrf
573 n =
SIZE(beta_delta, 1)
574 cpassert(
SIZE(beta_delta, 2) == n)
575 limit = 64.0_dp*epsilon(0.0_dp)
576 IF (
PRESENT(minimum_rcond)) limit = minimum_rcond
577 cpassert(ieee_is_finite(limit) .AND. limit >= 0.0_dp .AND. limit <= 1.0_dp)
580 IF (.NOT. all(ieee_is_finite(real(beta_delta,
dp))) .OR. &
581 .NOT. all(ieee_is_finite(aimag(beta_delta))))
THEN
585 ALLOCATE (inverse%lu(n, n), inverse%pivots(n))
586 inverse%lu(:, :) = beta_delta
588 inverse%lu(i, i) = inverse%lu(i, i) + 1.0_dp
591 inverse%rcond = 1.0_dp
592 inverse%ready = .true.
595 ALLOCATE (work(2*n), rwork(2*n))
596 anorm = zlange(
'1', n, n, inverse%lu, n, rwork)
597 CALL zgetrf(n, n, inverse%lu, n, inverse%pivots, info)
598 IF (info /= 0)
RETURN
599 CALL zgecon(
'1', n, inverse%lu, n, anorm, inverse%rcond, work, rwork, info)
600 IF (info /= 0)
RETURN
601 IF (.NOT. ieee_is_finite(inverse%rcond))
THEN
605 IF (inverse%rcond < limit)
THEN
609 inverse%ready = .true.
620 COMPLEX(KIND=dp),
INTENT(IN) :: beta_gaussian(:, :)
621 COMPLEX(KIND=dp),
INTENT(OUT) :: coefficients(:, :)
623 INTEGER :: info, n, nrhs
627 cpassert(inverse%ready)
629 nrhs =
SIZE(beta_gaussian, 2)
630 cpassert(
SIZE(beta_gaussian, 1) == n)
631 cpassert(all(shape(coefficients) == shape(beta_gaussian)))
632 coefficients = beta_gaussian
633 IF (n == 0 .OR. nrhs == 0)
RETURN
634 CALL zgetrs(
'N', n, nrhs, inverse%lu, n, inverse%pivots, coefficients, n, info)
649 beta_delta_response, response)
651 COMPLEX(KIND=dp),
INTENT(IN) :: coefficients(:, :), &
652 beta_gaussian_response(:, :), &
653 beta_delta_response(:, :)
654 COMPLEX(KIND=dp),
INTENT(OUT) :: response(:, :)
656 COMPLEX(KIND=dp),
ALLOCATABLE :: rhs(:, :)
660 cpassert(
SIZE(coefficients, 1) == n)
661 cpassert(all(shape(beta_delta_response) == [n, n]))
662 cpassert(all(shape(beta_gaussian_response) == shape(coefficients)))
663 ALLOCATE (rhs(n,
SIZE(coefficients, 2)))
664 rhs(:, :) = beta_gaussian_response - matmul(beta_delta_response, coefficients)
677 COMPLEX(KIND=dp),
INTENT(IN) :: gaussian(:, :), delta(:, :), &
679 COMPLEX(KIND=dp),
INTENT(OUT) :: soft(:, :)
681 cpassert(
SIZE(delta, 1) ==
SIZE(gaussian, 1))
682 cpassert(
SIZE(delta, 2) ==
SIZE(coefficients, 1))
683 cpassert(
SIZE(coefficients, 2) ==
SIZE(gaussian, 2))
684 cpassert(all(shape(soft) == shape(gaussian)))
685 soft = gaussian - matmul(delta, coefficients)
698 coefficients, coefficients_response, response)
699 COMPLEX(KIND=dp),
INTENT(IN) :: gaussian_response(:, :), delta(:, :), delta_response(:, :), &
700 coefficients(:, :), coefficients_response(:, :)
701 COMPLEX(KIND=dp),
INTENT(OUT) :: response(:, :)
703 cpassert(all(shape(delta_response) == shape(delta)))
704 cpassert(all(shape(coefficients_response) == shape(coefficients)))
705 CALL upf_inverse_basis(gaussian_response, delta_response, coefficients, response)
706 response = response - matmul(delta, coefficients_response)
721 augmentation, coefficients, transformed)
722 COMPLEX(KIND=dp),
INTENT(IN) :: gaussian_operator(:, :), gaussian_delta(:, :), &
723 delta_gaussian(:, :), delta_operator(:, :), augmentation(:, :), coefficients(:, :)
724 COMPLEX(KIND=dp),
INTENT(OUT) :: transformed(:, :)
726 CALL check_operator_shapes(gaussian_operator, gaussian_delta, delta_gaussian, delta_operator, &
727 augmentation, coefficients, shape(transformed))
728 transformed = gaussian_operator - matmul(gaussian_delta, coefficients) - &
729 matmul(conjg(transpose(coefficients)), delta_gaussian) + &
730 matmul(conjg(transpose(coefficients)), matmul(delta_operator + augmentation, coefficients))
751 delta_operator, augmentation, coefficients, &
752 gaussian_delta_response, delta_gaussian_response, &
753 delta_operator_response, augmentation_response, &
754 coefficients_response, response)
755 COMPLEX(KIND=dp),
INTENT(IN) :: gaussian_response(:, :), gaussian_delta(:, :), &
756 delta_gaussian(:, :), delta_operator(:, :), augmentation(:, :), coefficients(:, :), &
757 gaussian_delta_response(:, :), delta_gaussian_response(:, :), &
758 delta_operator_response(:, :), augmentation_response(:, :), coefficients_response(:, :)
759 COMPLEX(KIND=dp),
INTENT(OUT) :: response(:, :)
761 CALL check_operator_shapes(gaussian_response, gaussian_delta, delta_gaussian, delta_operator, &
762 augmentation, coefficients, shape(response))
763 cpassert(all(shape(coefficients_response) == shape(coefficients)))
764 CALL upf_inverse_operator(gaussian_response, gaussian_delta_response, delta_gaussian_response, &
765 delta_operator_response, augmentation_response, coefficients, response)
766 response = response - matmul(gaussian_delta, coefficients_response) - &
767 matmul(conjg(transpose(coefficients_response)), delta_gaussian) + &
768 matmul(conjg(transpose(coefficients_response)), matmul(delta_operator + augmentation, coefficients)) + &
769 matmul(conjg(transpose(coefficients)), matmul(delta_operator + augmentation, coefficients_response))
782 SUBROUTINE check_operator_shapes(gg, gd, dg, dd, augmentation, coefficients, output_shape)
783 COMPLEX(KIND=dp),
INTENT(IN) :: gg(:, :), gd(:, :), dg(:, :), dd(:, :), &
784 augmentation(:, :), coefficients(:, :)
785 INTEGER,
INTENT(IN) :: output_shape(2)
789 m =
SIZE(coefficients, 1)
790 n =
SIZE(coefficients, 2)
791 cpassert(all(shape(gg) == [n, n]))
792 cpassert(all(shape(gd) == [n, m]))
793 cpassert(all(shape(dg) == [m, n]))
794 cpassert(all(shape(dd) == [m, m]))
795 cpassert(all(shape(augmentation) == [m, m]))
796 cpassert(all(output_shape == [n, n]))
797 END SUBROUTINE check_operator_shapes
Routines that process Quantum Espresso UPF files.
Defines the basic variable types.
integer, parameter, public dp
Definition of mathematical constants and functions.
real(kind=dp), parameter, public degree
real(kind=dp), parameter, public fourpi
Inverse of a specified finite-rank UPF reconstruction, including intercenter coupling....
subroutine, public upf_inverse_kinetic_evaluate(kinetic, displacement, matrix, gradient)
One-half grad(AE_i).grad(AE_j) minus one-half grad(PS_i).grad(PS_j). Factoring through Delta preserve...
subroutine, public upf_inverse_project(inverse, beta_gaussian, coefficients)
Solve for W=P*U*chi; do not replace original q by an orthogonalized metric.
subroutine, public upf_inverse_init(beta_delta, inverse, info, minimum_rcond)
Factor K with original projector normalization and all supplied intercenter blocks.
subroutine, public upf_inverse_basis_response(gaussian_response, delta, delta_response, coefficients, coefficients_response, response)
Joint field response d(U*chi)=dchi-dDelta*W-Delta*dW.
subroutine, public upf_inverse_basis(gaussian, delta, coefficients, soft)
Evaluate inverse images on a field batch: U*chi=chi-Delta*W. Spatial derivatives use the correspondin...
subroutine, public upf_inverse_fields_init(pot, beta, delta, direct, home_coupling)
Prepare original beta and reconstruction fields for common intercenter quadratures....
subroutine, public upf_inverse_kinetic_init(pot, kinetic)
Independent valence kinetic augmentation from original projector-indexed AE/PS pairs....
subroutine, public upf_inverse_atomic_residual(atomic, coefficients, delta_overlap, delta_kinetic, kinetic_residual, metric_residual)
Finite partial-wave closure residuals added to Gaussian T plus hard D-T and Gaussian S....
subroutine, public upf_inverse_atomic_difference_init(pot, degree, atomic)
Prepare the local difference integrals without factorizing a local inverse.
subroutine, public upf_inverse_project_response(inverse, coefficients, beta_gaussian_response, beta_delta_response, response)
Differentiate the same reconstruction: K*dW=dB-dK*W. Displacement/strain responses must include the o...
subroutine, public upf_inverse_operator(gaussian_operator, gaussian_delta, delta_gaussian, delta_operator, augmentation, coefficients, transformed)
Pull back A+P^dagger*augmentation*P into reconstructed Gaussian variables.
subroutine, public upf_inverse_delta_init(pot, degree, delta)
Prepare original AE-minus-PS radial overlaps in the native projector/harmonic order....
subroutine, public upf_inverse_atomic_init(pot, degree, atomic, info, direct)
Local hard projectors and D-T for the nonoverlapping partial-wave construction. Both factors of a non...
subroutine, public upf_inverse_operator_response(gaussian_response, gaussian_delta, delta_gaussian, delta_operator, augmentation, coefficients, gaussian_delta_response, delta_gaussian_response, delta_operator_response, augmentation_response, coefficients_response, response)
Differentiate the full operator pullback, including both inverse-basis legs. Matrix responses already...
subroutine, public upf_inverse_kinetic_matrix(pot, kinetic, matrix, difference_kinetic, difference_overlap)
Full radial-channel kinetic matrix from the same interpolated hard/soft reference waves....
Half-numerical overlaps with the original scalar UPF radial projectors. Cartesian polynomials and ang...
subroutine, public upf_projector_init(pot, degree, projectors)
Prepare immutable radial and angular data outside parallel regions.
Original scalar radial fields in the native real-harmonic projector order. Regular radial factors are...
subroutine, public upf_radial_fields_evaluate(fields, displacement, value, gradient, hessian)
Evaluate values and Cartesian derivatives from the same radial/harmonic polynomial.
subroutine, public upf_radial_fields_init(r, radial, lbeta, fields, finite_table)
Cache original f_l(r)Y_lm, without weights, normalization changes or channel rotations....
Owned UPF dataset and radial conventions shared by ATOM and Quickstep. Dataset availability does not ...
real(dp) function, dimension(size(pot%r)), public upf_radial_weights(pot)
Composite Simpson weights for dr on the supplied UPF mesh index.