Change deviation to absolute value #15
@ -308,7 +308,7 @@ void WaveSimulation::probability_deviation(std::string outfile,
|
|||||||
if (write_each_step) {
|
if (write_each_step) {
|
||||||
for (size_t i = 0; i < iterations; i++) {
|
for (size_t i = 0; i < iterations; i++) {
|
||||||
sum = arma::accu(this->U % arma::conj(this->U)).real();
|
sum = arma::accu(this->U % arma::conj(this->U)).real();
|
||||||
ofile << i*this->dt << '\t' << 1. - sum << '\n';
|
ofile << i*this->dt << '\t' << std::abs(1. - sum) << '\n';
|
||||||
this->step();
|
this->step();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -318,7 +318,7 @@ void WaveSimulation::probability_deviation(std::string outfile,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
sum = arma::accu(this->U % arma::conj(this->U)).real();
|
sum = arma::accu(this->U % arma::conj(this->U)).real();
|
||||||
ofile << this->T << '\t' << 1. - sum << '\n';
|
ofile << this->T << '\t' << std::abs(1. - sum) << '\n';
|
||||||
ofile.close();
|
ofile.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user