Unitarity check

main
Micke Nordin 2 years ago
parent cdbaae1821
commit b40998f356
Signed by: micke
GPG Key ID: 014B273D614BE877

@ -123,7 +123,7 @@ public:
}
return m;
}
const bool is_diagonal() {
const bool is_diagonal() const {
bool result = true;
if (this->num_entries != this->entry_dimension)
return !result;
@ -135,8 +135,12 @@ public:
}
return result;
}
// Fixme: This is very dumb
const vector get_eigenvalues() {
const bool is_unitary() const{
matrix m = this->hermitian_conjugate();
return (*this * m == this->I());
}
// FIXME: This is very dumb
const vector get_eigenvalues() const {
if (this->is_diagonal())
return this->get_diagonal();
return vector(0);

Loading…
Cancel
Save