[math] Add new module linalg and more numpy methods (diag_indices_from & det & norm)#64
Merged
chaoming0625 merged 6 commits intomainfrom Nov 21, 2024
Merged
[math] Add new module linalg and more numpy methods (diag_indices_from & det & norm)#64chaoming0625 merged 6 commits intomainfrom
linalg and more numpy methods (diag_indices_from & det & norm)#64chaoming0625 merged 6 commits intomainfrom
Conversation
diag_indices_from & det)diag_indices_from & det & norm)
diag_indices_from & det & norm)linalg and more numpy methods (diag_indices_from & det & norm)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces new functions and updates to existing ones in the
brainunitlibrary, specifically focusing on linear algebra and mathematical operations. The changes include adding new functions for computing determinants, norms, and diagonal indices, along with corresponding unit tests to ensure correctness.New Functions:
detfunction to compute the determinant of an array inbrainunit.math(brainunit/math/_fun_change_unit.py).normfunction to compute the norm of a matrix or vector inbrainunit.math(brainunit/math/_fun_keep_unit.py).diag_indices_fromfunction to return indices for accessing the main diagonal of a given array inbrainunit.math(brainunit/math/_fun_remove_unit.py).Updates to Existing Functions:
detin the list of linear algebra functions inbrainunit.math(brainunit/math/_fun_change_unit.py).normin the list of mathematical functions that keep units inbrainunit.math(brainunit/math/_fun_keep_unit.py).diag_indices_fromin the list of indexing functions inbrainunit.math(brainunit/math/_fun_remove_unit.py).Unit Tests:
detfunction inbrainunit/math/_fun_change_unit_test.pyto verify the correctness of determinant calculations with and without units.normfunction inbrainunit/math/_fun_keep_unit_test.pyto ensure the norm calculations are accurate and maintain units when necessary.diag_indices_fromfunction inbrainunit/math/_fun_remove_unit_test.pyto validate the correct indices are returned for accessing the main diagonal of arrays.