Inconsistency in get_molecular_hamiltonian()
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 18/100
Rechercherichtung
Start from the reproducer in the issue: run_pyscf(...) with run_fci and run_ccsd on the H4 geometry, then call get_molecular_hamiltonian() from MolecularData. Run it several times and diff the output, since the sign and term values change between runs. The likely cause is in how the orbitals from the PySCF calculation are passed into the Hamiltonian, which the payload does not show, so check that path first. Done means the Hamiltonian is identical across runs, or the source of the variation is documented.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Hello,
I'm using the get_molecular_hamiltonian() method for H4, but the behavior is not being consistent from one execution to the next.
My application is VQE. The problem is that I want to store the optimized parameters, but not the Hamiltonian. However, when I evaluate the energy with the supposedly optimized parameters (obtained in a previous execution), the value is often suboptimal. I can't reproduce the ground state, because the parameters that should define it do not minimize the energy calculated with the Hamiltonian I obtain after I recreate the molecule.
Versions: pyscf 2.2.0, openfermion 1.5.1, openfermionpyscf 0.5
A very simple example of the variations in the Hamiltonian:
from openfermion import MolecularData
from openfermionpyscf import run_pyscf
r = 1.5
geometry = [('H', (0,0,0)), ('H', (0,0,r)), ('H', (0,0,2*r)), ('H', (0,0,3*r))]
basis = 'sto-3g'
multiplicity = 1
charge = 0
h4 = MolecularData(geometry,basis,multiplicity,charge,description='H4')
h4 = run_pyscf(h4,run_fci = True,run_ccsd = True)
print(h4.get_molecular_hamiltonian())
I won't post the full output as it's unnecessary, but I leave the last 10 lines for two different executions of the code above:
((7, 1), (6, 1), (6, 0), (3, 0)) 0.03730971574012655
((7, 1), (6, 1), (6, 0), (7, 0)) 0.22562069773706908
((7, 1), (7, 1), (1, 0), (1, 0)) 0.05498004656600459
((7, 1), (7, 1), (1, 0), (5, 0)) -0.0177711366810768
((7, 1), (7, 1), (3, 0), (3, 0)) 0.0588973786630837
((7, 1), (7, 1), (3, 0), (7, 0)) 0.03730971574012656
((7, 1), (7, 1), (5, 0), (1, 0)) -0.017771136681076806
((7, 1), (7, 1), (5, 0), (5, 0)) 0.08469509925466397
((7, 1), (7, 1), (7, 0), (3, 0)) 0.03730971574012655
((7, 1), (7, 1), (7, 0), (7, 0)) 0.22562069773706908
((7, 1), (6, 1), (6, 0), (3, 0)) -0.03730971574012662
((7, 1), (6, 1), (6, 0), (7, 0)) 0.22562069773706936
((7, 1), (7, 1), (1, 0), (1, 0)) 0.0549800465660047
((7, 1), (7, 1), (1, 0), (5, 0)) -0.017771136681076806
((7, 1), (7, 1), (3, 0), (3, 0)) 0.05889737866308378
((7, 1), (7, 1), (3, 0), (7, 0)) -0.037309715740126585
((7, 1), (7, 1), (5, 0), (1, 0)) -0.017771136681076813
((7, 1), (7, 1), (5, 0), (5, 0)) 0.08469509925466404
((7, 1), (7, 1), (7, 0), (3, 0)) -0.03730971574012662
((7, 1), (7, 1), (7, 0), (7, 0)) 0.22562069773706936
- Vorherrschende Sprache
- Python
- Sterne
- 118
- Forks
- 46
- Ø Merge
- 3 Min.
- Gemergte PRs (30 T.)
- 4
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus quantumlib/OpenFermion-PySCF
-
Return none spin summed rdmsEvtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. Offengood first issue
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 18/100
quantumlib/OpenFermion-PySCF#52 · 4 Kommentare ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 22/100
quantumlib/OpenFermion-PySCF#38 · 2 Kommentare ·
Alle Issues in quantumlib/OpenFermion-PySCF
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
OpenFreeEnergy/openfe#2371 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
HMDB's smiles file writes "None" for metabolites with an empty <smiles/> (file not currently used)Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 80/100
NCATSTranslator/Babel#1269 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 Ein halber Tag Anfängerfreundlichkeit 80/100
Maintainer antworten meist innerhalb von 1 Tag
-
404 on sample dataOffenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
bcgov/nr-hydrometric-rating-curve#443 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100