Ticket #11465 (closed: fixed)

Opened 6 years ago

Last modified 5 years ago

Problem with atom positions in trigonal/hexagonal structures

Reported by: Michael Wedel Owned by: Michael Wedel
Priority: major Milestone: Release 3.4
Component: Diffraction Keywords:
Cc: Blocked By:
Blocking: Tester: Roman Tolchenov

Description (last modified by Michael Wedel) (diff)

When using Geometry::CrystalStructure with trigonal or hexagonal space groups, or rhombohedral centering, there can be problems with scattering factor calculation, because of the way Group::operator*(V3D) is implemented. Conversion of rational numbers to floating point results in small variations and coordinates that are actually identical are considered as unequal, because std::set uses operator< for comparison. Switching the implementation to using std::vector and std::unique should fix the problem.

This bug showed up when I was trying to calculate the reflections of Al2O3, which is pretty common as a standard material for powder diffraction (at least for X-ray diffraction).

Change History

comment:1 Changed 6 years ago by Michael Wedel

  • Description modified (diff)

comment:2 Changed 6 years ago by Michael Wedel

  • Status changed from new to inprogress

Refs #11465. Add default for Rhombohedral centering

ReflectionConditions are explicitly Robv/Rrev, so for R, Robv is set.

Changeset: 57ce538f608f910138a2afd3eb2ef140a5877a31

comment:3 Changed 6 years ago by Michael Wedel

Refs #11465. Fixed Group::operator*(V3D), added test

Changeset: 8f383538e7c4bcac3332ce67bf452ec698cba3bd

comment:4 Changed 6 years ago by Michael Wedel

Refs #11465. Add defaults for trigonal groups with hexagonal setting

This is something I had overlooked before, for some trigonal point groups there are two versions of hexagonal axis setting - introduced a default.

Changeset: 92e2a2e2e97c64d095a4f6c584122ae0604a527a

comment:5 Changed 6 years ago by Michael Wedel

Refs #11465. Fixing point group documentation

Changeset: 625b1d0110ce56a59b60dc35f07177f9e3bf0f4d

comment:6 Changed 6 years ago by Michael Wedel

Refs #11465. Harmonizing python crystallography interface.

Moved some methods common to Point/SpaceGroup to Group, so both have those now. Made method naming consistent (for example hmSymbol()/getSymbol() becomes getHMSymbol() in all cases). Updated tests and documentation.

Changeset: 162991f1ea0cfcc48c18148e4154dd615849fb61

comment:7 Changed 6 years ago by Michael Wedel

Refs #11465. Fixing float comparison

Switching to std::sort/std::unique did not ultimately solve the problem, since sort also uses V3D::operator<(). Introduced a functor for use in Group and related classes for this purpose and added tests.

Changeset: bfd97a0b24f416f0e3d09ac38a0ff0cf3e99e745

comment:8 Changed 6 years ago by Michael Wedel

  • Status changed from inprogress to verify
  • Resolution set to fixed

This is being verified as pull request #520.

comment:9 Changed 6 years ago by Michael Wedel

Refs #11465. Forgot SymmetryElementTest and SymmetryOperationTest.

Changeset: 0c9e5601dceae0d5419b827699aee1ef6978c850

comment:10 Changed 6 years ago by Michael Wedel

Refs #11465. Fix system test, address pylint issues.

Changeset: bd15176171471c623aca41d62a1774e6238d3e42

comment:11 Changed 6 years ago by Michael Wedel

Testing information

Since the problems manifested in hexagonal and trigonal space groups, it's best to test with those. The Bilbao Crystallographic Server offers a tool called [WYCKPOS](http://www.cryst.ehu.es/cryst/get_wp.html), which shows the Wyckoff-positions of space groups. You could pick a trigonal or hexagonal one and test some of the special positions (with low multiplicity) as they have 1/3 and 2/3 in them. The following script is similar to the Python unit test:

` # Pairs of atom positions and their multiplicities in space group 167 (R-3c) in hexagonal setting positions = [([0.3, 0.4, 0.45], 36),

([0.3, 0.0, 0.25], 18), ([0.5, 0.0, 0.0], 18), ([0.0, 0.0, 0.45], 12), ([0.0, 0.0, 0.0], 6), ([0.0, 0.0, 0.25], 6)]

# Create space group R-3c sg = SpaceGroupFactory.createSpaceGroup("R -3 c")

for pos in positions:

print "Position:", pos[0] print "Multiplicity:", len(sg.getEquivalentPositions(pos[0]) print "Expected:", pos[1]

`

Before these changes the positions with expected multiplicity 18 will have wrong multiplicities.

comment:12 Changed 6 years ago by Roman Tolchenov

  • Status changed from verify to verifying
  • Tester set to Roman Tolchenov

comment:13 Changed 6 years ago by Roman Tolchenov

  • Status changed from verifying to closed

Merge pull request #520 from mantidproject/11465_fix_hexagonal_atom_positions

Fix problems with equivalent positions in trigonal/hexagonal space groups

Full changeset: 4b377b1ed7e87b9a9b172a432a67deaf9c58b219

comment:14 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 12304

Note: See TracTickets for help on using tickets.