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

Bug fixes in caching and comparison of Wyckoff positions #45

Merged
merged 8 commits into from
Dec 18, 2023

Conversation

bfield1
Copy link
Contributor

@bfield1 bfield1 commented Aug 14, 2023

Fixes for issues #42 and #44 .
Tests for the fixes.

In testing, I came across another bug, where comparison of certain LeftAction WyckoffPositions (with complicated conjugations) would raise errors about rationals being where integers were expected. I traced this down to ImageAffineSubspaceLattice not handling the case of left-acting affine matrices (instead treating them as if they were right-acting).

The existing test of conjugation of a group's cached Wyckoff positions is expanded to include a translation component (one I checked was non-trivial).
I test another group which has point-like Wyckoff positions.
And I expand the test of Wyckoff positions to actually test that the cached positions were conjugated correctly (up to mathematical equality, at least).
Comparison of LeftAction Wyckoff Positions could fail. This was because ImageAffineSubspaceLattice failed to account for the matrix being LeftAction. A check has been added, as has a test.
Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for your contribution!

I left some minor remarks. Overall this looks good to me, but I am not maintainer of this package, @beick and @gaehler are; hopefully they can have a look and perhaps merged your changes. (And perhaps then also make a new release with them).

gap/cryst.gi Outdated Show resolved Hide resolved
tst/cryst.tst Outdated Show resolved Hide resolved
tst/cryst.tst Outdated Show resolved Hide resolved
tst/cryst.tst Outdated Show resolved Hide resolved
bfield1 and others added 3 commits October 6, 2023 11:01
Contributions are recorded by the commit metadata.

Co-authored-by: Max Horn <[email protected]>
Change grammar of comments. Reference issue gap-packages#42 in comments. Change the test from issue gap-packages#44 to be separate to the existing tests rather than modifying it.

Co-authored-by: Max Horn <[email protected]>
gap/cryst.gi Outdated Show resolved Hide resolved
Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, looks really good to me.

Now, instead of duplicating the code, we test for a non-empty basis then apply the linear transformation separately.
The prior fix, checking if a single matrix was left-acting within ImageAffineSubspaceLattice, led to spurious results because that isn't a reliable check. Instead, we now ensure that the group U given to ImageAffineSubspaceLattice is right acting. This was done in other places it had been called, but not in the comparisons.
Copy link

codecov bot commented Dec 14, 2023

Codecov Report

Merging #45 (f7f55bf) into master (fbf54fb) will increase coverage by 0.00%.
Report is 2 commits behind head on master.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #45   +/-   ##
=======================================
  Coverage   94.32%   94.32%           
=======================================
  Files          24       24           
  Lines        7572     7582   +10     
=======================================
+ Hits         7142     7152   +10     
  Misses        430      430           
Files Coverage Δ
gap/cryst.gi 85.77% <100.00%> (+0.12%) ⬆️
gap/wyckoff.gi 87.78% <100.00%> (+0.17%) ⬆️

... and 1 file with indirect coverage changes

@gaehler gaehler merged commit 9ce7adf into gap-packages:master Dec 18, 2023
4 of 5 checks passed
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.

3 participants