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

Polarised neutrons #29

Merged
merged 3 commits into from
Feb 6, 2025
Merged

Polarised neutrons #29

merged 3 commits into from
Feb 6, 2025

Conversation

DanPorter
Copy link
Owner

Version 3.3.3

Simplified input options for polarised neutron scattering for issue #27.

Previously unpolarised magnetic calculations used an average of the structure factor calculated for incident polarisations in the x,y,z crystal frame. This is not correct but I'm not sure what the correct averaging is, therefore unpolarised magnetic calculations now point to the polarised option, using the default polarisation vector.

Additionally, some other corrections and improvements based on feedback.

functions_scattering.py

  • added options 'neutron polarised' and 'xray polarised' to scattering types
  • Corrected error in sf_magnetic_neutron_polarised
  • Added function scattering_factors
  • changed 'neutron magnetic' to point to 'neutron polarised', same for 'x-ray magnetic'

classes_scattering.py

  • improved docs and setup_scatter
  • added option for _integer_hkl, used in all scattering code.

tkgui/scattering.py

  • added polarisation options

classes_crystal.py

  • Symmetry now loads space group operations from tables if not in CIF

functions_general.py

  • change to norm, use np.squeeze on output

Tests

  • added tests for CIF output
  • all tests pass

Examples

Added example_polarised_neutrons.py, MnO.mcif to example structures and additional tests

Simplified input options for polarised neutron scattering for issue #27.

functions_scattering.py
 - added options 'neutron polarised' and 'xray polarised' to scattering types
 - Corrected error in sf_magnetic_neutron_polarised

classes_scattering.py
 - improved docs and setup_scatter

tkgui/scattering.py
 - added polarisation options

Added example_polarised_neutrons.py, MnO.mcif to example structures and additional tests
functions_scattering.py
 - Added function scattering_factors
 - changed 'neutron magnetic' to point to 'neutron polarised', same for 'x-ray magnetic'
classes_scattering.py
 - added option for _integer_hkl, used in all scattering code.

classes_crystal.py
 - Symmetry now loads space group operations from tables if not in CIF

functions_general.py
 - change to norm, use np.squeeze on output

Tests
 - added tests for CIF output
 - all tests pass
@DanPorter DanPorter merged commit f9c1a22 into master Feb 6, 2025
6 checks passed
@DanPorter DanPorter deleted the polarised_neutrons branch February 6, 2025 11:35
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

Successfully merging this pull request may close these issues.

1 participant