42 REAL(kind=
dp),
INTENT(IN) :: k(3), center(3)
43 INTEGER,
INTENT(OUT) :: mapping(:)
44 COMPLEX(KIND=dp),
INTENT(OUT) :: phase(:)
45 REAL(kind=
dp),
INTENT(IN) :: tolerance
46 INTEGER,
INTENT(OUT) :: status
48 INTEGER :: a, b, found, i, iset, l, n, shell, total
49 INTEGER,
ALLOCATABLE :: kind(:), offset(:),
TARGET(:)
50 REAL(kind=
dp) :: angle, delta(3), image(3)
51 REAL(kind=
dp),
ALLOCATABLE :: position(:, :)
59 phase = cmplx(0, 0,
dp)
60 IF (tolerance <= 0.0_dp .OR.
SIZE(phase) /=
SIZE(mapping))
RETURN
61 IF (.NOT. ieee_is_finite(tolerance) .OR. .NOT. all(ieee_is_finite(center)))
RETURN
62 IF (.NOT. all(ieee_is_finite(k)))
RETURN
63 IF (maxval(abs(2*k - nint(2*k))) > 1.e-8_dp)
RETURN
64 CALL get_qs_env(qs_env, cell=cell, particle_set=particles, qs_kind_set=kinds_set)
65 IF (any(cell%perd /= 1))
RETURN
67 ALLOCATE (kind(n), offset(n), target(n), position(3, n))
71 CALL get_qs_kind(kinds_set(kind(a)), basis_set=basis)
72 IF (.NOT.
ASSOCIATED(basis))
RETURN
74 total = total + basis%nsgf
75 position(:, a) = matmul(cell%h_inv,
pbc(particles(a)%r, cell))
77 IF (total /=
SIZE(mapping))
RETURN
81 IF (kind(a) /= kind(b)) cycle
82 delta = 2*center - position(:, a) - position(:, b)
83 IF (sqrt(sum(matmul(cell%hmat, delta - nint(delta))**2)) > tolerance) cycle
87 IF (found /= 1)
RETURN
91 IF (target(b) /= a)
RETURN
92 image = real(nint(2*center - position(:, a) - position(:, b)),
dp)
93 angle =
twopi*dot_product(k, image)
94 CALL get_qs_kind(kinds_set(kind(a)), basis_set=basis)
95 DO iset = 1, basis%nset
96 DO shell = 1, basis%nshell(iset)
97 l = basis%l(shell, iset)
98 DO i = basis%first_sgf(shell, iset), basis%last_sgf(shell, iset)
99 mapping(offset(a) + i) = offset(b) + i
100 phase(offset(a) + i) = (-1)**l*cmplx(cos(angle), sin(angle),
dp)
105 IF (any(mapping == 0))
RETURN
subroutine, public get_qs_env(qs_env, atomic_kind_set, qs_kind_set, cell, super_cell, cell_ref, use_ref_cell, kpoints, dft_control, mos, sab_orb, sab_all, qmmm, qmmm_periodic, mimic, sac_ae, sac_ppl, sac_lri, sap_ppnl, sab_vdw, sab_scp, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_pp, sab_xtb_nonbond, sab_almo, sab_kp, sab_kp_nosym, sab_cneo, particle_set, energy, force, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, run_rtp, rtp, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_ks_im_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_ri_aux_kp, matrix_s, matrix_s_ri_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, matrix_vhxc, rho, rho_xc, pw_env, ewald_env, ewald_pw, active_space, mpools, input, para_env, blacs_env, scf_control, rel_control, kinetic, qs_charges, vppl, xcint_weights, rho_core, rho_nlcc, rho_nlcc_g, ks_env, ks_qmmm_env, wf_history, scf_env, local_particles, local_molecules, distribution_2d, dbcsr_dist, molecule_kind_set, molecule_set, subsys, cp_subsys, oce, local_rho_set, rho_atom_set, task_list, task_list_soft, rho0_atom_set, rho0_mpole, rhoz_set, rhoz_cneo_set, ecoul_1c, rho0_s_rs, rho0_s_gs, rhoz_cneo_s_rs, rhoz_cneo_s_gs, do_kpoints, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, nkind, natom, nelectron_total, nelectron_spin, efield, neighbor_list_id, linres_control, xas_env, virial, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, results, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, lri_env, lri_density, exstate_env, ec_env, harris_env, dispersion_env, gcp_env, vee, rho_external, external_vxc, mask, mp2_env, bs_env, kg_env, wanniercentres, atprop, ls_scf_env, do_transport, transport_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, mscfg_env, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, eeq, rhs, do_rixs, tb_tblite)
Get the QUICKSTEP environment.
subroutine, public get_qs_kind(qs_kind, basis_set, basis_type, ncgf, nsgf, all_potential, tnadd_potential, gth_potential, sgp_potential, upf_potential, cneo_potential, se_parameter, dftb_parameter, xtb_parameter, dftb3_param, zatom, zeff, elec_conf, mao, lmax_dftb, alpha_core_charge, ccore_charge, core_charge, core_charge_radius, paw_proj_set, paw_atom, hard_radius, hard0_radius, max_rad_local, covalent_radius, vdw_radius, gpw_type_forced, harmonics, max_iso_not0, max_s_harm, grid_atom, ngrid_ang, ngrid_rad, lmax_rho0, dft_plus_u_atom, l_of_dft_plus_u, n_of_dft_plus_u, u_minus_j, hund_j, u_of_dft_plus_u, j_of_dft_plus_u, alpha_of_dft_plus_u, beta_of_dft_plus_u, j0_of_dft_plus_u, occupation_of_dft_plus_u, dispersion, bs_occupation, magnetization, no_optimize, addel, laddel, naddel, orbitals, max_scf, eps_scf, smear, u_ramping, u_minus_j_target, eps_u_ramping, proj_shell_charge, lr_atom, do_mtlr, u_j_loop, ao_coef, init_u_ramping_each_scf, reltmat, ghost, monovalent, floating, name, element_symbol, pao_basis_size, pao_model_file, pao_potentials, pao_descriptors, nelec)
Get attributes of an atomic kind.