Conversation
This branch has not been deployed
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.
Fix molecular placement on special Wyckoff positions of trigonal/hexagonal groups
Summary
pyxtal_molecule.get_orientations_in_wpreturns no orientation for any special Wyckoff position of a trigonal or hexagonal space group (143–194), whatever the molecule's point group.As a result,
from_randomcannot place a molecule on such a site and raisesSymm_CompatibilityError, e.g. benzene (D6h) on the three-fold axis (6c) or the -3 site (3a) of R-3:and Tris{2-[(2,6-dimethylphenyl)amino]ethyl}amine.
General positions and the inversion sites of the same groups are unaffected, which is why existing tests did not catch this.
Cause
get_orientations_in_wpandis_compatible_symmetrycompare the site symmetry fromWyckoff_position.get_site_symm_wo_translation()against the molecule's Cartesian point-group operations.That method returns the stored operations in fractional coordinates.
For hexagonal axes a 3-fold rotation is (-y, x-y, z), i.e.
[[0,-1,0],[1,-1,0],[0,0,1]], which is not orthogonal.OperationAnalyzerthen cannot identify it as a rotation (type general, no axis), andPointGroupAnalyzer.is_valid_opapplies it to Cartesian coordinates, which distorts the molecule, so every candidate orientation is rejected.Changes
Wyckoff_position.get_site_symm_wo_translationgainsspace: Literal["fractional", "euclidean"] = "fractional"."euclidean"usesget_site_symm_ops(), which differs from the stored operations only whenself.euclideanis set.get_orientations_in_wpandis_compatible_symmetryrequest space="euclidean".is_pure_translationcompares the result with the fractional generators and must keep doing so. Behaviour for groups 1–142 and 195–230 is unchanged.