ir_spectrum

dqc.ir_spectrum(qc: dqc.qccalc.base_qccalc.BaseQCCalc, freq_unit: Optional[str] = 'cm^-1', ints_unit: Optional[str] = '(debye/angst)^2/amu') → Tuple[torch.Tensor, torch.Tensor][source]

Calculate the frequency and intensity of the IR vibrational spectra. Unlike vibration, this method only returns parts where the frequency is positive.

Parameters
  • qc (BaseQCCalc) – The qc calc object that has been executed.

  • freq_unit (str or None) – The returned unit for the frequency. If None, returns in atomic unit.

  • ints_unit (str or None) – The returned unit for the intensity. If None, returns in atomic unit.

Returns

Tuple of tensors where the first tensor is the frequency in the given unit with shape (nfreqs,) sorted from the largest to smallest, and the second tensor is the IR intensity with the same order as the frequency.

Return type

Tuple[torch.Tensor, torch.Tensor]

Example

import torch
import dqc

dtype = torch.float64
moldesc = "O 0 0 0.2156; H 0 1.4749 -0.8625; H 0 -1.4749 -0.8625"  # in Bohr
efield = torch.zeros(3, dtype=dtype).requires_grad_()  # efield must be specified
mol = dqc.Mol(moldesc=moldesc, basis="3-21G", dtype=dtype, efield=(efield,))
qc = dqc.HF(mol).run()
ir_freq, ir_ints = dqc.ir_spectrum(qc, freq_unit="cm^-1")