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

Add hermitian() to matrix gallery #1086

Merged
merged 10 commits into from
Aug 19, 2023
Merged

Add hermitian() to matrix gallery #1086

merged 10 commits into from
Aug 19, 2023

Conversation

swaptr
Copy link
Contributor

@swaptr swaptr commented Feb 2, 2023

Description

Added hermitian() to generate random hermitian matrices of size n.

Issue/s resolved: #1073

Changes proposed:

  • Add hermitian() to utils.data.matrixgallery.

Type of change

  • New feature (non-breaking change which adds functionality)

Memory requirements

  • NA

Performance

  • NA

Due Diligence

  • All split configurations tested
  • Multiple dtypes tested in relevant functions
  • Documentation updated (if needed)
  • Title of PR is suitable for corresponding CHANGELOG entry

Does this change modify the behaviour of other functions? If so, which?

no

@swaptr swaptr changed the title Work/hermitian Add hermitian() to matrix gallery Feb 2, 2023
@swaptr
Copy link
Contributor Author

swaptr commented Feb 2, 2023

@ClaudiaComito I couldn't figure out the split logic for this. Can you please review the PR?

@ClaudiaComito ClaudiaComito removed the request for review from bducos August 16, 2023 17:59
@ClaudiaComito ClaudiaComito marked this pull request as ready for review August 16, 2023 18:00
@github-actions
Copy link
Contributor

Thank you for the PR!

Copy link
Contributor

@ClaudiaComito ClaudiaComito left a comment

Choose a reason for hiding this comment

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

Thanks again @swaptr and apologies for the delay. I suggest to use ht.random.randn instead of arange, and that also allows specifying a split axis.

heat/utils/data/matrixgallery.py Outdated Show resolved Hide resolved
heat/utils/data/matrixgallery.py Outdated Show resolved Hide resolved
heat/utils/data/matrixgallery.py Outdated Show resolved Hide resolved
heat/utils/data/matrixgallery.py Outdated Show resolved Hide resolved
heat/utils/data/matrixgallery.py Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

Thank you for the PR!

1 similar comment
@github-actions
Copy link
Contributor

Thank you for the PR!

heat/utils/data/matrixgallery.py Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

Thank you for the PR!

@github-actions
Copy link
Contributor

Thank you for the PR!

@ClaudiaComito ClaudiaComito changed the base branch from main to 1073-Add_Hermitian_to_matrix_gallery August 19, 2023 05:52
@ClaudiaComito ClaudiaComito merged commit 084475c into helmholtz-analytics:1073-Add_Hermitian_to_matrix_gallery Aug 19, 2023
3 checks passed
ClaudiaComito added a commit that referenced this pull request Sep 4, 2023
* add test_hermitian()

* Add `hermitian()` to matrix gallery (#1086)

* hermitian: add function definition

* implement hermitian

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Set default dtype to complex

* Edit docs

* Apply suggestions from code review

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix reference to types

---------

Co-authored-by: Claudia Comito <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* fix operand split for binary operation

* add double precision tests

* faster solution for non-positive definite hermitian

* Update matrixgallery.py 

Updated docs for `hermitian`
Added scaling factor for the positive definite matrices 
Added distinction of real and complex data types

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update test_matrixgallery.py

extended tests: 
* added tests for the positive definite case and real data-types

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* reformatting with precommit

* formatted the docstring as raw (r""" ...) in order to let flake8 be fine with latex formulas...

* corrected a typo in the tests...

---------

Co-authored-by: swaptr <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Fabian Hoppe <[email protected]>
Co-authored-by: Hoppe <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Hermitian to matrix gallery
2 participants