Open
Conversation
the original io/vasp/outputs.py line 5873 will lead to repeated computation of cder because the property cder is a method with @Property. So direct computation will make it faster if we should go through many cders matrices with this function, just like my change
shyuep
reviewed
Apr 15, 2026
| a float value | ||
| """ | ||
| return self.cder[band_i, band_j, kpoint, spin, cart_dir] | ||
| return self.cder_real[band_i, band_j, kpoint, spin, cart_dir] + 1j * cder_imag[band_i, band_j, kpoint, spin, cart_dir] |
Member
There was a problem hiding this comment.
I think there is an error? Shouldn't it be self.cder_imag?
Author
|
yes, I made a mistake and you are right. I apologize for this mistake
________________________________
发件人: Shyue Ping Ong ***@***.***>
发送时间: 2026年4月15日 22:49
收件人: materialsproject/pymatgen-core ***@***.***>
抄送: hisvvhtek ***@***.***>; Author ***@***.***>
主题: Re: [materialsproject/pymatgen-core] Update outputs.py (PR #13)
@shyuep commented on this pull request.
________________________________
In src/pymatgen/io/vasp/outputs.py<#13 (comment)>:
@@ -5870,7 +5870,7 @@ def get_orbital_derivative_between_states(
Returns:
a float value
"""
- return self.cder[band_i, band_j, kpoint, spin, cart_dir]
+ return self.cder_real[band_i, band_j, kpoint, spin, cart_dir] + 1j * cder_imag[band_i, band_j, kpoint, spin, cart_dir]
I think there is an error? Shouldn't it be self.cder_imag?
―
Reply to this email directly, view it on GitHub<#13 (review)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/B26UVFSJLRT7AN4TE7KEGXT4WAGXXAVCNFSM6AAAAACXHRY5ESVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHM2DCMJXGM2DOOJTGA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
the original io/vasp/outputs.py line 5873 will lead to repeated computation of cder because the property cder is a method with @Property. So direct computation will make it faster if we should go through many cders matrices with this function, just like my change