v0.5.0
MatrixAlgebraKit v0.5.0
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!andlq_null_pullback!for computing gradients through nullspace decompositions. These functions provide a cleaner and more efficient interface for automatic differentiation throughqr_nullandlq_nulloperations. -
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
publicand are now part of the package's public API. -
Changed Truncation Interface: The internal
truncatefunction replaces the oldtruncate!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!andlq_null!to use the new dedicated pullback functions - Improved type stability in truncation-related rules
- Added
@non_differentiabledeclarations for utility functions (select_algorithm,initialize_output,check_input,isisometry,isunitary) - More generic type signatures (removed
AbstractMatrixconstraints) for better compatibility with custom array types
- Streamlined pullback implementations for
📋 Public API Changes and breaking changes
New Public Functions
qr_null_pullback!- Compute pullback for QR nullspace decompositionlq_null_pullback!- Compute pullback for LQ nullspace decompositiontruncate- Now marked as public (previously unexportedtruncate!)
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: