Skip to content

Commit

Permalink
Improve random tangent generation on complex circle and rotation matr… (
Browse files Browse the repository at this point in the history
#689)

* Improve random tangent generation on complex circle and rotation matrices

* shorter vectors for tests
  • Loading branch information
mateuszbaran authored Nov 17, 2023
1 parent 6e0aa84 commit b2d83b3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ 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).

## [0.9.8] - 2023-11-17

### Fixed

- Improved distribution of random vector generation for rotation matrices and complex circle.

## [0.9.7] - 2023-11-14

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Manifolds"
uuid = "1cead3c2-87b3-11e9-0ccd-23c62b72b94e"
authors = ["Seth Axen <[email protected]>", "Mateusz Baran <[email protected]>", "Ronny Bergmann <[email protected]>", "Antoine Levitt <[email protected]>"]
version = "0.9.7"
version = "0.9.8"

[deps]
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Expand Down
2 changes: 1 addition & 1 deletion src/manifolds/Circle.jl
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ function Random.rand(rng::AbstractRNG, M::Circle{ℂ}; vector_at=nothing, σ::Re
return sign(randn(rng, ComplexF64))
else
# written like that to properly handle `vector_at` being a number or a one-element array
return map(p -> project(M, p, σ * rand(rng, typeof(p))), vector_at)
return map(p -> project(M, p, σ * randn(rng, complex(typeof(p)))), vector_at)
end
end

Expand Down
1 change: 0 additions & 1 deletion src/manifolds/Rotations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ function Random.rand!(
(manifold_dimension(M) == 0) && return fill!(pX, 0)
A = σ .* randn(rng, representation_size(M))
pX .= triu(A, 1) .- transpose(triu(A, 1))
normalize!(pX)
end
return pX
end
Expand Down
2 changes: 1 addition & 1 deletion test/groups/power_group.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ include("group_utils.jl")
@test G isa PowerGroup
@test is_point(G, rand(Random.GLOBAL_RNG, G))
pts = [rand(G) for _ in 1:3]
X_pts = [rand(G; vector_at=pts[1]) for _ in 1:3]
X_pts = [0.5 * rand(G; vector_at=pts[1]) for _ in 1:3]

@test compose(G, pts[1], Identity(G)) == pts[1]
@test compose(G, Identity(G), pts[1]) == pts[1]
Expand Down

2 comments on commit b2d83b3

@mateuszbaran
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator register

Release notes:

Fixed

  • Improved distribution of random vector generation for rotation matrices and complex circle.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/95510

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.9.8 -m "<description of version>" b2d83b337e214158f64d22a39776b9a80ffd2981
git push origin v0.9.8

Please sign in to comment.