Skip to content

fix :unitary? and add :adjoint#14

Closed
AlessandroMinali wants to merge 1 commit intoruby:masterfrom
AlessandroMinali:unitary_matrix
Closed

fix :unitary? and add :adjoint#14
AlessandroMinali wants to merge 1 commit intoruby:masterfrom
AlessandroMinali:unitary_matrix

Conversation

@AlessandroMinali
Copy link
Copy Markdown

:unitary? is currently not working(since 2011?). Also added tests.

Example:

require 'matrix'
Matrix[[0, Complex(0,-1)], [Complex(0,1),0]].unitary? # false, should be true

Verification of unitary matrix

@marcandre
Copy link
Copy Markdown
Member

  1. Oh, that's embarassing...

  2. Thanks for the patch.

  3. I'm 👍 with adding adjoint

  4. Your patch for unitary? should be optimized; I can look into a fix if you prefer.

@AlessandroMinali
Copy link
Copy Markdown
Author

Sure, feel free to take this over.

marcandre added a commit that referenced this pull request Apr 30, 2020
marcandre added a commit that referenced this pull request Apr 30, 2020
Patch adapted from Alessandro Minali; #14
marcandre added a commit that referenced this pull request Apr 30, 2020
marcandre added a commit that referenced this pull request Apr 30, 2020
Patch adapted from Alessandro Minali; #14
marcandre added a commit that referenced this pull request Apr 30, 2020
marcandre added a commit that referenced this pull request Apr 30, 2020
Patch adapted from Alessandro Minali
@marcandre
Copy link
Copy Markdown
Member

Turns out indices j and k were reversed.

Same issue with orthogonal?.

I'll try to see how to make a release tomorrow...

Thanks again for raising the issue!

@marcandre marcandre closed this Apr 30, 2020
marcandre added a commit that referenced this pull request May 1, 2020
marcandre added a commit that referenced this pull request May 1, 2020
Patch adapted from Alessandro Minali
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.

2 participants