Skip to content
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

Atomic fraction as float #1

Closed
James-Drewitt opened this issue May 27, 2023 · 1 comment
Closed

Atomic fraction as float #1

James-Drewitt opened this issue May 27, 2023 · 1 comment
Assignees

Comments

@James-Drewitt
Copy link

@bjheinen Currently atomic fraction n must be an integer. Can this be made a float? For example, I have GaSn alloy with 8.5 at. % Sn. To get around this, if I multiply atomic fractions by 100 I get the following error:

Traceback (most recent call last):
File "C:\Users\James\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\LiquidDiffract\gui\optim_ui.py", line 197, in on_click_calc_sq
self.data['sq_y'] = core.calc_structure_factor(self.data['cor_x_cut'],
File "C:\Users\James\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\LiquidDiffract\core\core.py", line 562, in calc_structure_factor
avg_scattering_f = calc_average_scattering(composition, Q_cor)
File "C:\Users\James\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\LiquidDiffract\core\core.py", line 224, in calc_average_scattering
np.sum(np.asarray([x*y for x in atomic_ff for y in atomic_ff]), 0)
numpy.core._exceptions._ArrayMemoryError: Unable to allocate 11.7 GiB for an array with shape (1000000, 1570) and data type float64

bjheinen added a commit that referenced this issue Jul 13, 2023
…errors with large numbers of atoms - resolves #1
@bjheinen bjheinen self-assigned this May 21, 2024
bjheinen added a commit that referenced this issue May 21, 2024
…ctive electronic ff, etc.) for memory efficiency/speed. Avoid doing calculations for every atom and use counts for each species instead. Addresses issue #1
bjheinen added a commit that referenced this issue Jun 3, 2024
…lism. Added composition validation and error messages etc. Fixes #1
@bjheinen
Copy link
Owner

bjheinen commented Jun 4, 2024

This has now been added as of v1.2.4 and will be included in the next release version. For Faber-Ziman S(Q) this is fine as the normalisation to total number of atoms makes e.g. Ga0.915,Sn0.085 identical to Ga915,Sn85. I have simply allowed float input in the composition input table. Ashcroft-Langreth structure factors are normalised in a different way, and really only work for molecular materials, so if using this mode the input is restricted to integers.

@bjheinen bjheinen closed this as completed Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants