-
-
Notifications
You must be signed in to change notification settings - Fork 485
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
Proposal: Add helper methods is_hermitian
and is_unitary
for the Matrix
struct
#1406
Comments
I agree these methods could be useful. They're, however, quite difficult to get "right". In your code, you check for exact inequality. However, after one or more arithmetic operations, you'll almost certainly have some ever-so-slight errors. In this case, a matrix may not be technically Hermitian or unitary, but for all intents and purposes it should be considered so. This implies that we should consider approximate comparison. That, however, opens up a number of design questions: What kind of approximate comparison is likely to match what a user expects? Should they provide a tolerance themselves? This seemingly trivial feature quickly gets a lot more complex once you start to think about everything that can go wrong once inexact floating-point computations enter the scene. I think for us to move forward with this, we should:
|
Agreed totally. However, the two methods are simple wrappers of the existing methods so that these methods don't introduce more uncertainty.
We already have the
You are right, there is no strong motivation but some convenience. |
You're right, there's already
|
Hi,
I already have these extent methods in my own workspace,
so I wonder is it accepted to be added into the Nalgebra.
pub fn is_hermitian(&self) -> bool
pub fn is_unitary(&self) -> bool
The text was updated successfully, but these errors were encountered: