Skip to content

v0.5.0

Choose a tag to compare

@github-actions github-actions released this 01 Oct 20:49
· 105 commits to main since this release
4ab245c

MatrixAlgebraKit v0.5.0

Diff since v0.4.1

This release introduces pullback functions for nullspace decompositions, refactors the truncation interface to return indices, and includes several code quality improvements and internal consistency enhancements.


🚀 New Features & Enhancements

  • Nullspace Pullback Functions: Added dedicated pullback functions qr_null_pullback! and lq_null_pullback! for computing gradients through nullspace decompositions. These functions provide a cleaner and more efficient interface for automatic differentiation through qr_null and lq_null operations.

  • Renamed Pullback Functions: The pullback functions have been renamed for consistency:

    • qr_compact_pullback!qr_pullback!
    • lq_compact_pullback!lq_pullback!

    The new names are marked as public and are now part of the package's public API.

  • Changed Truncation Interface: The internal truncate function replaces the old truncate! and returns both the truncated result and the indices that were kept, enabling more efficient implementations in ChainRules extensions and other downstream code.

  • Enhanced ChainRules Integration:

    • Streamlined pullback implementations for qr_null! and lq_null! to use the new dedicated pullback functions
    • Improved type stability in truncation-related rules
    • Added @non_differentiable declarations for utility functions (select_algorithm, initialize_output, check_input, isisometry, isunitary)
    • More generic type signatures (removed AbstractMatrix constraints) for better compatibility with custom array types

📋 Public API Changes and breaking changes

New Public Functions

  • qr_null_pullback! - Compute pullback for QR nullspace decomposition
  • lq_null_pullback! - Compute pullback for LQ nullspace decomposition
  • truncate - Now marked as public (previously unexported truncate!)

Renamed Functions

  • qr_compact_pullback!qr_pullback! (old name removed)
  • lq_compact_pullback!lq_pullback! (old name removed)

Note: The previous pullback function names are no longer available. If you were using these internal functions (they were not exported but marked as public in v0.4.1), you will need to update your code to use the new names.


🔧 Migration Guide

If you were using the pullback functions directly:

# Old code (v0.4.1)
qr_compact_pullback!(ΔA, A, QR, ΔQR)
lq_compact_pullback!(ΔA, A, LQ, ΔLQ)

# New code (v0.5.0)
qr_pullback!(ΔA, A, QR, ΔQR)
lq_pullback!(ΔA, A, LQ, ΔLQ)

For nullspace pullbacks, use the new dedicated functions:

# v0.5.0
qr_null_pullback!(ΔA, A, N, ΔN)
lq_null_pullback!(ΔA, A, Nᴴ, ΔNᴴ)

Replace truncate!(args...) calls with truncate, ensure they don't mutate the input arguments and also return the truncated inds.


For further details, see the updated docs and the diff for this release: v0.4.1...v0.5.0

Merged pull requests:

  • Replace truncate! with truncate (#60) (@lkdvos)
  • More consistent API for when to have _full, _compact, ... (#61) (@lkdvos)
  • Add qr_null_pullback! and lq_null_pullback! (#62) (@lkdvos)
  • Loosen AbstractArray restrictions where these are not necessary (#63) (@lkdvos)