# How to calculate energy of a molecule in an aligned electric field?

So I am aware that many quantum chemical codes are able to add external fields to molecular calculations (for example to calculate polarizabilities). I also know that in some (eg. Orca) you have some control over the applied field, for example the strength. I am also aware that for example in Molpro, you can apply multiple fields at once, and set the direction of these fields with respect to another. However what I really want to do is apply electric field along a specific chemical bond, and I have not been able to do this yet, since most, if not all codes first align the molecule along the axes of inertia and apply the field after that. Is there an ab initio, or maybe a DFT code that is able to add an electric field along a molecule?

Aligning a molecule to a particular frame of reference (e.g., with the z-axis along a particular bond) is part of Avogadro for this reason:

In Avogadro 1.x, there's an align tool

• You click one atom that will be set to the origin
• You click another atom that will be projected along the x, y, or z-axis
• You click 'align' and the molecular coordinates will be translated and rotated accordingly.

You will then need to set the program to avoid changing the molecular frame of reference:

• In Gaussian, the keyword is NoSymm
• In Q-Chem, the keyword is SYM_IGNORE
• I don't believe Orca performs this reorientation in single-point jobs, although it seems impossible to preserve orientation during geometry optimization in Orca 4. – Geoff Hutchison May 25 at 14:51
• Is one also able to define a finite electric field along specified direction in any of these codes somehow? All I can find is automated polarizability calculations with a finite numerical step, not a way to manually align the direction of the field itself – Ezze May 25 at 19:07
• I don't have a full survey of codes. Q-Chem applies finite fields with the \$multipole_field section, and Gaussian uses the Field keyword. Be careful with both programs to convert units. – Geoff Hutchison May 25 at 19:10

I would agree that the best approach is to align your molecule in a way where your desired field is along one of the Cartesian axes. However, you can specify the direction/magnitude of the applied field using Gaussian.

While the typical way of specifying a field Field=M+/-N only allows you to specify a multipole M and a magnitude N*.0001 a.u., you can give specify a particular direction of the field, along with higher multipole fields, at the end of the input file using iop(3/14=-6). Keep in mind that the magnitude of the components you enter is not scaled, unlike the Field keyword.

Example input file, specifying a dipole field along (1,0,1):

#p hf/sto-3g iop(3/14=-6) nosymm

Dipole field in x and z directions

0 1
N 0.0 0.0 -0.549
N 0.0 0.0 0.549

!Specify coordinates of field
!Can give up to 34 values (3 dipole/field,