quantumlib / OpenFermion

The electronic structure package for quantum computers.
Apache License 2.0
1.51k stars 372 forks source link

multiplicity limitation in molecular data #809

Open mstechly opened 1 year ago

mstechly commented 1 year ago

I wanted to use big hydrogen chains for benchmarking of my code. However, as it turns out, the biggest Hchain I can created using the following piece of code is of length 11:

from openfermion import MolecularData
number_of_hydrogens=11
basis="6-31g"
bond_distance = 1.3
charge = 0
multiplicity = number_of_hydrogens + 1 
geometry = [("H", (0, 0, i * bond_distance)) for i in range(number_of_hydrogens)]
MolecularData(geometry, basis, multiplicity, charge)

For higher values of number_of_hydrogens I get an error. After some investigation I have realized that it's because of name_molecule function, which has a multiplicity_dict with keys up to 12. I don't even need to get the name of the molecule anywhere, so it's unfortunate that this exception is being raised – I need to either use my own custom version Openfermion or switch to using pySCF.

CC: @sunchong137