I am trying to write a python code that checks the dipole moment and the polarisability of a certain molecule in order to determine if it will be Raman-active or IR-active.
Raman-active molecules are those with a change in the polarisability (so net dipole moment is zero) and IR-active are those with a change in the dipole moment (so net dipole moment is different from zero).
I was trying to use PySCF as it has an attribute for the dipole moment. However, I don't exactly understand the output that PySCF provides. Checking the dipole moment for $\ce{H2O}$ and $\ce{CO2}$ give me the same results.
The idea is that I should get a number (net dipole moment) and I would have to check if it is zero or not. Does someone know how I can do it?
This is the code I have tried:
from pyscf import gto, scf
# Define the H2O molecule
mol = gto.M(atom='O 0 0 0; H 0 1 0; H 0 0 1', basis='sto-3g')
# Perform a RHF calculation for the ground state
mf = scf.RHF(mol)
mf.kernel()
# Extract the dipole moment for the ground state
ground_state_dipole = mf.dip_moment()
# Perform a RHF calculation for the perturbed state
mf = scf.RHF(mol)
mf.charge = -1
mf.kernel()
# Extract the dipole moment for the perturbed state
perturbed_state_dipole = mf.dip_moment()
# Calculate the change in dipole moment
dipole_diff = perturbed_state_dipole - ground_state_dipole
print("Change in dipole moment of H2O:", dipole_diff)