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

More general columnwise multiplication action #756

Merged
merged 7 commits into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- Union type `MatrixGroup`
- Columnwise group action with arbitrary matrix groups

## [0.10.4] - 2024-10-18

### Added
Expand Down
1 change: 1 addition & 0 deletions src/groups/general_linear.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

@doc raw"""
GeneralLinear{T,𝔽} <: AbstractDecoratorManifold{𝔽}

Expand Down
30 changes: 21 additions & 9 deletions src/groups/rotation_action.jl
Original file line number Diff line number Diff line change
Expand Up @@ -205,45 +205,50 @@ end

###

const MatrixGroup{T,𝔽} = Union{
GeneralUnitaryMultiplicationGroup{T,𝔽},
GeneralLinear{T,𝔽},
SpecialLinear{T,𝔽},
} where {T,𝔽}

@doc raw"""
ColumnwiseMultiplicationAction{
TAD<:ActionDirection,
TM<:AbstractManifold,
TO<:GeneralUnitaryMultiplicationGroup,
TO<:MatrixGroup,
} <: AbstractGroupAction{TAD}

Action of the (special) unitary or orthogonal group [`GeneralUnitaryMultiplicationGroup`](@ref)
or [`GeneralLinear`](@ref) group
of type `On` columns of points on a matrix manifold `M`.

# Constructor

ColumnwiseMultiplicationAction(
M::AbstractManifold,
On::GeneralUnitaryMultiplicationGroup,
On::MatrixGroup,
AD::ActionDirection = LeftAction(),
)
"""
struct ColumnwiseMultiplicationAction{
TAD<:ActionDirection,
TM<:AbstractManifold,
TO<:GeneralUnitaryMultiplicationGroup,
TO<:MatrixGroup,
} <: AbstractGroupAction{TAD}
manifold::TM
On::TO
end

function ColumnwiseMultiplicationAction(
M::AbstractManifold,
On::GeneralUnitaryMultiplicationGroup,
On::MatrixGroup,
::TAD=LeftAction(),
) where {TAD<:ActionDirection}
return ColumnwiseMultiplicationAction{TAD,typeof(M),typeof(On)}(M, On)
end

const LeftColumnwiseMultiplicationAction{
TM<:AbstractManifold,
TO<:GeneralUnitaryMultiplicationGroup,
} = ColumnwiseMultiplicationAction{LeftAction,TM,TO}
const LeftColumnwiseMultiplicationAction{TM<:AbstractManifold,TO<:MatrixGroup} =
ColumnwiseMultiplicationAction{LeftAction,TM,TO}

function apply(::LeftColumnwiseMultiplicationAction, a, p)
return a * p
Expand Down Expand Up @@ -281,7 +286,14 @@ U K V^{\mathrm{T}} & \text{otherwise}
where ``U \Sigma V^{\mathrm{T}}`` is the SVD decomposition of ``p q^{\mathrm{T}}`` and ``K``
is the unit diagonal matrix with the last element on the diagonal replaced with -1.
"""
function optimal_alignment(A::LeftColumnwiseMultiplicationAction, p, q)
function optimal_alignment(
A::LeftColumnwiseMultiplicationAction{
<:AbstractManifold,
<:GeneralUnitaryMultiplicationGroup,
},
p,
q,
)
is_point(A.manifold, p; error=:error)
is_point(A.manifold, q; error=:error)

Expand Down
Loading