Use better machinery for is_hermitian
This commit is contained in:
parent
eeee3590c7
commit
cdbaae1821
1 changed files with 1 additions and 10 deletions
11
matrix.hpp
11
matrix.hpp
|
@ -147,16 +147,7 @@ public:
|
|||
const bool is_hermitian() const {
|
||||
if (this->entry_dimension != this->num_entries)
|
||||
return false;
|
||||
matrix m = this->hermitian_conjugate();
|
||||
bool equal = true;
|
||||
for (long long i = 0; i < m.num_entries; i++) {
|
||||
for (long long j = 0; j < m.entry_dimension; j++) {
|
||||
if (m[i][j] != this->entries[i][j]) {
|
||||
equal = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return equal;
|
||||
return *this == this->hermitian_conjugate();
|
||||
}
|
||||
friend ostream &operator<<(ostream &os, const matrix &m) {
|
||||
char last = '\0';
|
||||
|
|
Loading…
Add table
Reference in a new issue