Hello, As part of a larger project I need to calculate the dipole moment of a unit cell using orbitals and dipole integrals over basis orbitals, (instead of the siesta default of integrating the density matrix multiplied by r). I changed the code so that it computes the dipole integrals (in 'overlap', using the 'matel'-routine) exactly in the same way as the overlap integrals are computed in 'overlap'. At the end of the SCF an additional step is included which calculates
Sum_j Sum_kp C*_jp C_jq M_pq n_j, with C_ij the orbital coefficients, M_pq the dipole integrals and n_j occupation numbers. For a molecule, this should give the electronic dipole moment. However, tests with water give very different values from those computed by the default method of Siesta (after subtraction of the nuclei contribution), e.g with a DZ basis I get -0.517 au versus -1.328 au from Siesta, with DZP it's -0.492 against -1.619 au, TZTP is -0.253 and -1.574. Comparison with other parts of the code which calculate the dipole matrices with matel (e.g. 'phirphi' for the calc. of polarization via Berry phase) show that the dipole integrals are OK, also the orbital coefficients seem to be OK. Does anyone have an idea what could be wrong? I somehow have the feeling that it is an issue with the origin in the dipole integral calculation, but I can't pin it down. Best regards, Heribert
