Commit 01bf0964 authored by Nguyen, Thien Minh's avatar Nguyen, Thien Minh
Browse files

Merge remote-tracking branch 'upstream/master' into tnguyen/py-qcor-observe-retrieve-term-data

parents 927ecdb0 49a05cc5
// Compile to run with validation mode:
// Qpp (noiseless)
// qcor -validate deuteron_validation.cpp -shots 1024
// Aer (noisy)
// qcor -validate deuteron_validation.cpp -shots 1024 -qpu aer[noise-model:noise_model.json]
__qpu__ void deuteron(qreg q, double theta) {
X(q[0]);
Ry(q[1], theta);
CNOT(q[1], q[0]);
// for (int i = 0; i < 20; i++) {
// CNOT(q[1], q[0]);
// }
H(q[0]);
H(q[1]);
Measure(q[0]);
Measure(q[1]);
}
int main() {
qcor::set_verbose(true);
const double angle = 0.297113;
auto q = qalloc(2);
deuteron(q, angle);
q.print();
std::cout << "<XX> = " << q.exp_val_z() << "\n";
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment