vprusso / toqito

|toqito> (Theory of Quantum Information Toolkit) in Python :snake:
https://toqito.readthedocs.io/en/latest/
MIT License
141 stars 56 forks source link

Add a check for an anti-hermitian in `matrix_props` #766

Closed purva-thakre closed 1 week ago

purva-thakre commented 1 month ago

A square matrix $A$ is said to be anti-hermitian when $A^* = -A$.

We could add a new is_anti_hermitian function in matrix_props or make changes to is_hermitian to allow for a new check_type = None or "Anti" parameter. The latter helps us avoid code duplication.

https://github.com/vprusso/toqito/blob/15ac78ac29efe737b8cb1d85216de25cba227c76/toqito/matrix_props/is_hermitian.py#L68

@vprusso Do you have a preference?

vprusso commented 1 month ago

Hmm, I could see arguments for both based on the way that we do things now. I suppose the string arguments do make sense when the requested object of computation is in some sense "bucketed" in the same category. Here it's a bit different as "Hermitian" and "anti-Hermitian" strike me as related but different.

I'm also wondering whether it makes sense to include these functions at all. While I think having them in the arsenal is cool, I wonder if they are useful for anything specifically quantum-themed. I know you found these from Nic Higham's work (who I'm a big fan of), but I wonder if including these would have quantum application. Any thoughts on that?

purva-thakre commented 1 month ago

I know you found these from Nic Higham's work

Not really. These matrices usually appear in lie theory which is something I am utilizing for an ongoing project.

image http://scipp.ucsc.edu/~haber/ph251/gellmann23.pdf

vprusso commented 1 month ago

Ah, I see. I think in terms of preference of implementation I would take is_anti_hermitian.py over arguments for is_hermitian.py. Any preferences/thoughts on your side?

tnemoz commented 1 week ago

Potato! :D