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