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

fixed ImaginaryPart for quaternion algebras #2938

Merged
merged 1 commit into from
Oct 24, 2018

Conversation

ThomasBreuer
Copy link
Contributor

@ThomasBreuer ThomasBreuer commented Oct 23, 2018

Fixes #2801.

Copy link
Contributor

@stevelinton stevelinton left a comment

Choose a reason for hiding this comment

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

Looks correct.

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.

Seems to fix the issue, thanks!

gap> List( gens, RealPart );
[ e, 0*e, 0*e, 0*e ]
gap> List( gens, ImaginaryPart ) * gens[2];
[ 0*e, i, j, k ]
Copy link
Member

Choose a reason for hiding this comment

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

A slightly more extensive test could test the identity claimed by the manual; based on #2801:

...
gap> vecs := Concatenation( gens, [ Sum( gens ) ] );
[ e, i, j, k, e+i+j+k ]
gap> ForAll( vecs, v -> (v + ComplexConjugate( v )) / 2 = RealPart(v) );
true
gap> ForAll( vecs, v -> (v - ComplexConjugate( v )) / (2*gens[2]) = ImaginaryPart(v) );
true

Copy link
Contributor Author

Choose a reason for hiding this comment

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

O.k., I have extended the test.

@codecov
Copy link

codecov bot commented Oct 24, 2018

Codecov Report

Merging #2938 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #2938      +/-   ##
==========================================
+ Coverage    83.8%    83.8%   +<.01%     
==========================================
  Files         681      681              
  Lines      346794   346748      -46     
==========================================
- Hits       290627   290595      -32     
+ Misses      56167    56153      -14
Impacted Files Coverage Δ
lib/algsc.gi 91.47% <100%> (+0.46%) ⬆️
src/calls.h 95.74% <0%> (-2.2%) ⬇️
hpcgap/lib/hpc/stdtasks.g 71.77% <0%> (-0.41%) ⬇️
lib/read5.g 100% <0%> (ø) ⬆️
src/intrprtr.c 98.83% <0%> (ø) ⬆️
src/c_oper1.c 93.55% <0%> (ø) ⬆️
src/funcs.c 97.74% <0%> (ø) ⬆️
src/listfunc.c 94.3% <0%> (+0.01%) ⬆️
src/listoper.c 80.12% <0%> (+0.02%) ⬆️
src/gvars.c 82.6% <0%> (+0.03%) ⬆️
... and 6 more

@ThomasBreuer ThomasBreuer merged commit 26b88ca into gap-system:master Oct 24, 2018
@ThomasBreuer ThomasBreuer deleted the TB_RealPart branch October 24, 2018 14:51
@PaulaHaehndel PaulaHaehndel added kind: bug Issues describing general bugs, and PRs fixing them release notes: to be added PRs introducing changes that should be (but have not yet been) mentioned in the release notes labels Apr 15, 2019
@wucas wucas added kind: bug: wrong result Issues describing bugs that result in mathematically or otherwise wrong results, and PRs fixing them release notes: added PRs introducing changes that have since been mentioned in the release notes and removed release notes: to be added PRs introducing changes that should be (but have not yet been) mentioned in the release notes labels Aug 20, 2019
@olexandr-konovalov olexandr-konovalov added this to the GAP 4.11.0 milestone Feb 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug: wrong result Issues describing bugs that result in mathematically or otherwise wrong results, and PRs fixing them kind: bug Issues describing general bugs, and PRs fixing them release notes: added PRs introducing changes that have since been mentioned in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Definition of ImaginaryPart for quaternion algebras unclear
6 participants