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

Loading…
Cancel
Save