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

Definition of ImaginaryPart for quaternion algebras unclear #2801

Closed
fingolfin opened this issue Sep 11, 2018 · 2 comments · Fixed by #2938
Closed

Definition of ImaginaryPart for quaternion algebras unclear #2801

fingolfin opened this issue Sep 11, 2018 · 2 comments · Fixed by #2938
Labels
kind: bug Issues describing general bugs, and PRs fixing them kind: discussion discussions, questions, requests for comments, and so on topic: documentation Issues and PRs related to documentation

Comments

@fingolfin
Copy link
Member

From the manual:

For a quaternion z = c_1 e + c_2 i + c_3 j + c_4 k, ComplexConjugate returns c_1 e - c_2 i - c_3 j - c_4 k, [...]
When ComplexConjugate is defined for an object z then RealPart and ImaginaryPart return (z + ComplexConjugate( z )) / 2 and (z - ComplexConjugate( z )) / 2 i, respectively, where i denotes the corresponding imaginary unit.

But what is the "corresponding imaginary unit" ?

The code in lib/algsc.gi does not clarify, to the contrary, I don't understand how it is supposed to be correct. It says this:

InstallMethod( ImaginaryPart,
    "for a quaternion",
    [ IsQuaternion and IsSCAlgebraObj ],
    function( quat )
    local v, z;

    v:= ExtRepOfObj( quat );
    z:= Zero( v[1] );
    return ObjByExtRep( FamilyObj( quat ), [ v[2], z, v[4], -v[3] ] );
    end );

That looks to me as if it can only be valid for a single specific set of parameters a,b, not in general. But note this:

gap> A:= QuaternionAlgebra( Rationals );
<algebra-with-one of dimension 4 over Rationals>
gap> AssignGeneratorVariables(A);
#I  Assigned the global variables [ e, i, j, k ]
gap> v:=e+i+j+k;
e+i+j+k
gap> (v - ComplexConjugate( v )) / (2*i);
e+(-1)*j+k
gap> ImaginaryPart(v);
e+j+(-1)*k

Perhaps @ThomasBreuer has some insights on this?

@fingolfin fingolfin added kind: bug Issues describing general bugs, and PRs fixing them kind: question topic: documentation Issues and PRs related to documentation labels Sep 11, 2018
@fingolfin fingolfin changed the title Definition of `ImaginaryPart for quaternion algebras unclear Definition of ImaginaryPart for quaternion algebras unclear Oct 13, 2018
@fingolfin
Copy link
Member Author

@ThomasBreuer I think you wrote some of that code, do you have any insights on it?

@ThomasBreuer
Copy link
Contributor

  • Yes, there is an error.
  • I will prepare a pull request proposing a fix.
  • (I think that RealPart and ImaginaryPart are not really useful functions.)

@fingolfin fingolfin added kind: discussion discussions, questions, requests for comments, and so on and removed kind: discussion discussions, questions, requests for comments, and so on kind: question labels Mar 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Issues describing general bugs, and PRs fixing them kind: discussion discussions, questions, requests for comments, and so on topic: documentation Issues and PRs related to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants