|
|
@ -147,16 +147,7 @@ public:
|
|
|
|
const bool is_hermitian() const {
|
|
|
|
const bool is_hermitian() const {
|
|
|
|
if (this->entry_dimension != this->num_entries)
|
|
|
|
if (this->entry_dimension != this->num_entries)
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
matrix m = this->hermitian_conjugate();
|
|
|
|
return *this == 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;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
friend ostream &operator<<(ostream &os, const matrix &m) {
|
|
|
|
friend ostream &operator<<(ostream &os, const matrix &m) {
|
|
|
|
char last = '\0';
|
|
|
|
char last = '\0';
|
|
|
|