Input coordinate units problem

Dear program developers,
Recently, I write some codes based on Psi4 API module. I met some questions, and I hope you can help me.
I created a molecule like this,

mole = “”"
C -1.86708863 0.79113923 0.00000000
H -1.51043420 -0.21767077 0.00000000
H -1.51041579 1.29553742 0.87365150
H -1.51041579 1.29553742 -0.87365150
H -2.93708863 0.79115241 0.00000000
units bohr
mol = psi4.geometry(mole)
xyzGeom = np.array(mol.geometry())
NAtom = mol.natom()
R = np.zeros((NAtom, NAtom), np.double)
for i, j in combinations(range(NAtom), 2):
R[i,j] = R[j,i] = v3d.dist(xyzGeom[i], xyzGeom[j])

Next, I print the distance matrix using the codes written by me:

***** Distance Matrix *****
0 1 2 3 4
0 0.000000E+00
1 1.070000E+00 0.000000E+00
2 1.070000E+00 1.747302E+00 0.000000E+00
3 1.070000E+00 1.747302E+00 1.747303E+00 0.000000E+00
4 1.070000E+00 1.747303E+00 1.747303E+00 1.747303E+00 0.000000E+00

I noticed that the units of the distance matrix is angstrom and the matrix elements are same as output of Gaussian program. In fact, if I don’t use keywords “units bohr” in my mole input, the output is wrong. However, the default unit of the distance is angstrom in Psi4.

I am very confused about this and hope that you can answer it.

Thanks a lot,
Best regards,


mol.geometry() always returns the geometry in Bohr, regardless of the input units. I don’t know why that is.

Concur. While the input default in Psi is Ångstroms, internally everything is in atomic units for equation simplicity and to avoid dependence on physical constants. So, many API commands return in au.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.