60 int kpoint_state_index,
61 int number_of_plane_waves,
63 const std::vector<int>& g_vector_indices,
64 const Crystal& crystal_structure,
69 int first_band_index = 0)
const {
70 std::vector<std::vector<Complex>> orbitals;
71 trial_orbitals_.
build(kpoint_index,
72 number_of_plane_waves,
79 std::vector<Complex> overlap_in_s_metric =
83 int orbital_count =
static_cast<int>(orbitals.size());
84 std::vector<std::vector<Complex>> s_applied_orbitals =
87 std::vector<std::vector<Complex>> projections(
88 number_of_bands, std::vector<Complex>(orbital_count,
Complex(0.0, 0.0)));
90 for (
int band_index = 0; band_index < number_of_bands; band_index++) {
92 kpoint_state_index, first_band_index + band_index);
93 for (
int orbital_index = 0; orbital_index < orbital_count; orbital_index++) {
95 const std::vector<Complex>& s_applied_orbital = s_applied_orbitals[orbital_index];
96 for (
int g_index = 0; g_index < number_of_plane_waves; g_index++) {
97 overlap += std::conj(band_data[g_index]) * s_applied_orbital[g_index];
99 projections[band_index][orbital_index] = overlap;