run_pyscf does not work on PyscfMolecularData
還沒有人認領這個 Issue。
評估
研究方向
The failure is at molecule.canonical_orbitals = ... in run_pyscf in openfermionpyscf/_run_pyscf.py, where PyscfMolecularData exposes these fields as read-only properties. Decide whether to add setters or compute the fields on the fly, which the issue leaves open and a maintainer must settle first. Done means the reproduction snippet runs and a test covers the chosen design.
由索引模型根據 Issue 內容生成。
描述
Input:
from openfermionpyscf import PyscfMolecularData, run_pyscf
geometry = [('Li', (0., 0., 0.)), ('H', (0., 0., 1.4))]
basis = 'sto-3g'
multiplicity = 1
charge = 0
molecule = run_pyscf(
PyscfMolecularData(geometry, basis, multiplicity, charge)
)
Output:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-1-bf13348427ff> in <module>()
7
8 molecule = run_pyscf(
----> 9 PyscfMolecularData(geometry, basis, multiplicity, charge)
10 )
~/Projects/OpenFermion-PySCF/openfermionpyscf/_run_pyscf.py in run_pyscf(molecule, run_scf, run_mp2, run_cisd, run_ccsd, run_fci, verbose)
143
144 # Populate fields.
--> 145 molecule.canonical_orbitals = pyscf_scf.mo_coeff.astype(float)
146 molecule.orbital_energies = pyscf_scf.mo_energy.astype(float)
147
AttributeError: can't set attribute
The reason is that PyscfMolecularData has canonical_orbitals, etc., as properties rather than attributes. One could fix this by adding setters, but I don't know what the correct design or intended usage is. If we can calculate stuff on the fly, then perhaps we don't even need to perform run_pyscf on a PyscfMolecularData? @sunqm
- 主要語言
- Python
- 星號
- 118
- 分支
- 46
- 平均合併
- 3 分鐘
- 30 天內合併 PR
- 4
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
quantumlib/OpenFermion-PySCF 的其他 Issue
-
難度 4/5 3-5 天 新手友好度 18/100
quantumlib/OpenFermion-PySCF#66 · 2 則留言 ·
-
Return none spin summed rdms可能重新可做 關聯的 PR 已關閉且未合併。 未關閉good first issue
難度 4/5 3-5 天 新手友好度 18/100
quantumlib/OpenFermion-PySCF#52 · 4 則留言 ·
查看 quantumlib/OpenFermion-PySCF 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 62/100
OpenFreeEnergy/openfe#2371 ·
維護者通常 2 天內回覆
-
HMDB's smiles file writes "None" for metabolites with an empty <smiles/> (file not currently used)未關閉
難度 2/5 1-3 小時 新手友好度 80/100
NCATSTranslator/Babel#1269 ·
維護者通常 1 天內回覆
-
難度 2/5 半天 新手友好度 80/100
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 64/100
bcgov/nr-hydrometric-rating-curve#443 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 88/100