-
Notifications
You must be signed in to change notification settings - Fork 547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
correct openshell errors in qchem #5655
correct openshell errors in qchem #5655
Conversation
pennylane/qchem/hamiltonian.py
Outdated
@@ -107,6 +107,11 @@ def _electron_integrals(*args): | |||
Returns: | |||
tuple[array[float]]: 1D tuple containing core constant, one- and two-electron integrals | |||
""" | |||
if mol.n_electrons % 2 == 1 or mol.mult != 1: | |||
raise ValueError( | |||
"Openshell systems are not supported. Change the charge or spin multiplicity of the molecule." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Openshell systems are not supported. Change the charge or spin multiplicity of the molecule." | |
"Open shell systems are not supported. Change the charge or spin multiplicity of the molecule." |
Should there be a space?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we add a hyphen instead(open-shell) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The literature contains different formats. Let's use open-shell
everywhere.
Co-authored-by: Thomas R. Bromley <49409390+trbromley@users.noreply.github.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## qchem_feature_branch #5655 +/- ##
========================================================
- Coverage 99.67% 99.67% -0.01%
========================================================
Files 415 416 +1
Lines 38615 38788 +173
========================================================
+ Hits 38490 38662 +172
- Misses 125 126 +1 ☔ View full report in Codecov by Sentry. |
[sc-61760] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @ddhawan11!
To understand things better on my end...
Everything (Hamiltonian, HF, and OpenFermion) other than molecule does not support open-shell systems? Only molecule.py supports open-shell systems?
Co-authored-by: Austin Huang <65315367+austingmhuang@users.noreply.github.com>
Co-authored-by: Austin Huang <65315367+austingmhuang@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @ddhawan11. Looks good to me!
Co-authored-by: Austin Huang <65315367+austingmhuang@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ddhawan11, looks good. Please address my comments and I will approve.
Co-authored-by: soranjh <40344468+soranjh@users.noreply.github.com>
Context:
Changes openshell warnings.
Description of the Change:
Changed openshell warnings to work with new molecular_hamiltonian function
Benefits:
molecular_hamiltonian function works with openshell molecules when method is pyscf
Possible Drawbacks:
Related GitHub Issues: