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

transpose and adjoint #104

Open
stevengj opened this issue Aug 31, 2022 · 3 comments
Open

transpose and adjoint #104

stevengj opened this issue Aug 31, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@stevengj
Copy link
Member

Currently we override transpose and adjoint to make copies here: https://github.com/JuliaLinearAlgebra/SkewLinearAlgebra.jl/blob/main/src/skewhermitian.jl#L115-L116

Instead, the right thing to do is to use the default definitions of these functions, which create Transpose and Adjoint wrappers around the matrix without making a copy.

Ideally, one then defines specialized methods for Adjoint{<:SkewHermitian} which exploit the fact that it is merely a sign flip.

@smataigne
Copy link
Collaborator

I will transform these functions now.

@smataigne
Copy link
Collaborator

smataigne commented Sep 17, 2022

@stevengj , if I am correct, this will ask to create a new file trying to mimic the following file:
https://github.com/JuliaLang/julia/blob/master/stdlib/LinearAlgebra/src/adjtrans.jl

@stevengj
Copy link
Member Author

No, you shouldn't need to mimic that whole file — that defines lots of methods for Adjoint{<:AbstractMatrix} that should automatically apply to Adjoint{<:SkewHermitian}.

What is needed is that whenever you have a specialized matrix method for SkewHermitian, you might need to also define one for Adjoint{<:SkewHermitian} that just flips the sign of the result (e.g. for multiplying two matrices).

Still requires a fair amount of code, so I'm not 100% sure if it's worth it. On the other hand, the usual expectation in Julia is that A' doesn't make a copy.

@stevengj stevengj added the enhancement New feature or request label Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants