-
Notifications
You must be signed in to change notification settings - Fork 631
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
Add kz_2d option #1035
Add kz_2d option #1035
Conversation
Using "complex" as the new default (as described in #1026) causes about half of the tests to fail (assuming it's correct to set the default |
|
||
if self.special_kz and self.k_point is False: | ||
self.k_point = Vector3() | ||
|
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.
Lines 641-653 should be replaced with:
self.special_kz = False
if self.cell_size.z == 0 and self.k_point and self.k_point.z != 0:
if kz_2d == "complex":
self.special_kz = True
self.force_complex_fields = True
elif kz_2d == "real/imag":
self.special_kz = True
self.force_complex_fields = False
elif kz_2d == "3d":
self.special_kz = False
else:
raise ValueError("Invalid kz_2d option: {} not in [complex, real/imag, 3d]".format(kz_2d))
Setting kpoint=0
when special_kz=True
is incorrect since its non-zero z component is what is used in the calculations.
python/tests/special_kz.py
Outdated
t_real_imag = time() - start | ||
|
||
start = time() | ||
Rmeep_3d = self.refl_planar(theta, '3d') |
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 3d simulation can probably be removed (in order to save time) since this particular test is only for the special_kz=True
feature.
* Add kz_2d option * Set default k_point when special_kz is True * Only use kz_2d when k_point is set
Fixes #1026.