-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plot expectation value benchmarks #168
Changes from 29 commits
9f62ec5
47632ad
c7dcd18
1ed386c
fc9a3e5
019a232
c32ee7c
dcb4322
1c28fd3
22a35a7
5353c4b
683310f
1fb692f
39f4ed2
8471ab3
782c920
011b185
e334d0c
f6b6417
496731a
d4b4eed
176e8b7
4869cda
12e40d6
6afbc51
c4f5134
2b6542b
ee4cc04
914ea08
f6d634e
8cb27ea
b9cbea5
3bb18dd
a334c7a
cbeaa5b
22945b6
6ec0268
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
*.ipynb_checkpoints | ||
*.jupyter_cache | ||
_build | ||
*__pycache__/ | ||
__pycache__/ | ||
docs/build/ | ||
*.egg-info/ | ||
dist/ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a little suspicious how the QAOA, QV, and QCNN circuit results are all basically identical. We should make sure this is real and not an artifact of how we perform simulation (or something else)! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you plot the expectation values themselves and standard deviations as suggested above? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's compare the compiled gate counts between the different compilers in case they are returning approximately the same circuits. |
natestemen marked this conversation as resolved.
Show resolved
Hide resolved
natestemen marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,197 @@ | ||
OPENQASM 2.0; | ||
include "qelib1.inc"; | ||
qreg q[10]; | ||
ry(pi/2) q[0]; | ||
rx(pi) q[0]; | ||
ry(pi/2) q[1]; | ||
rx(pi) q[1]; | ||
cx q[0],q[1]; | ||
rz(1.5846238651156088) q[1]; | ||
cx q[0],q[1]; | ||
ry(pi/2) q[2]; | ||
rx(pi) q[2]; | ||
cx q[0],q[2]; | ||
rz(1.5846238651156088) q[2]; | ||
cx q[0],q[2]; | ||
rx(1.9993980494552113) q[2]; | ||
ry(pi/2) q[3]; | ||
rx(pi) q[3]; | ||
cx q[0],q[3]; | ||
rz(1.5846238651156088) q[3]; | ||
cx q[0],q[3]; | ||
rx(1.9993980494552113) q[0]; | ||
cx q[1],q[3]; | ||
rz(1.5846238651156088) q[3]; | ||
cx q[1],q[3]; | ||
ry(pi/2) q[4]; | ||
rx(pi) q[4]; | ||
cx q[1],q[4]; | ||
rz(1.5846238651156088) q[4]; | ||
cx q[1],q[4]; | ||
cx q[3],q[4]; | ||
rz(1.5846238651156088) q[4]; | ||
cx q[3],q[4]; | ||
ry(pi/2) q[5]; | ||
rx(pi) q[5]; | ||
cx q[1],q[5]; | ||
rz(1.5846238651156088) q[5]; | ||
cx q[1],q[5]; | ||
cx q[3],q[5]; | ||
rz(1.5846238651156088) q[5]; | ||
cx q[3],q[5]; | ||
ry(pi/2) q[6]; | ||
rx(pi) q[6]; | ||
cx q[4],q[6]; | ||
rz(1.5846238651156088) q[6]; | ||
cx q[4],q[6]; | ||
cx q[5],q[6]; | ||
rz(1.5846238651156088) q[6]; | ||
cx q[5],q[6]; | ||
rx(1.9993980494552113) q[6]; | ||
ry(pi/2) q[7]; | ||
rx(pi) q[7]; | ||
cx q[3],q[7]; | ||
rz(1.5846238651156088) q[7]; | ||
cx q[3],q[7]; | ||
cx q[4],q[7]; | ||
rz(1.5846238651156088) q[7]; | ||
cx q[4],q[7]; | ||
rx(1.9993980494552113) q[4]; | ||
rx(1.9993980494552113) q[7]; | ||
ry(pi/2) q[8]; | ||
rx(pi) q[8]; | ||
cx q[3],q[8]; | ||
rz(1.5846238651156088) q[8]; | ||
cx q[3],q[8]; | ||
cx q[5],q[8]; | ||
rz(1.5846238651156088) q[8]; | ||
cx q[5],q[8]; | ||
rx(1.9993980494552113) q[5]; | ||
rx(1.9993980494552113) q[8]; | ||
ry(pi/2) q[9]; | ||
rx(pi) q[9]; | ||
cx q[1],q[9]; | ||
rz(1.5846238651156088) q[9]; | ||
cx q[1],q[9]; | ||
rx(1.9993980494552113) q[1]; | ||
cx q[0],q[1]; | ||
rz(0.8199726992929931) q[1]; | ||
cx q[0],q[1]; | ||
cx q[0],q[2]; | ||
rz(0.8199726992929931) q[2]; | ||
cx q[0],q[2]; | ||
rx(9.808607416083087) q[2]; | ||
cx q[3],q[9]; | ||
rz(1.5846238651156088) q[9]; | ||
cx q[3],q[9]; | ||
rx(1.9993980494552113) q[3]; | ||
cx q[0],q[3]; | ||
rz(0.8199726992929931) q[3]; | ||
cx q[0],q[3]; | ||
rx(9.808607416083087) q[0]; | ||
cx q[1],q[3]; | ||
rz(0.8199726992929931) q[3]; | ||
cx q[1],q[3]; | ||
cx q[1],q[4]; | ||
rz(0.8199726992929931) q[4]; | ||
cx q[1],q[4]; | ||
cx q[1],q[5]; | ||
cx q[3],q[4]; | ||
rz(0.8199726992929931) q[4]; | ||
cx q[3],q[4]; | ||
cx q[4],q[6]; | ||
rz(0.8199726992929931) q[5]; | ||
cx q[1],q[5]; | ||
cx q[3],q[5]; | ||
rz(0.8199726992929931) q[5]; | ||
cx q[3],q[5]; | ||
cx q[3],q[7]; | ||
rz(0.8199726992929931) q[6]; | ||
cx q[4],q[6]; | ||
cx q[5],q[6]; | ||
rz(0.8199726992929931) q[6]; | ||
cx q[5],q[6]; | ||
rx(9.808607416083087) q[6]; | ||
rz(0.8199726992929931) q[7]; | ||
cx q[3],q[7]; | ||
cx q[3],q[8]; | ||
cx q[4],q[7]; | ||
rz(0.8199726992929931) q[7]; | ||
cx q[4],q[7]; | ||
rx(9.808607416083087) q[4]; | ||
rx(9.808607416083087) q[7]; | ||
rz(0.8199726992929931) q[8]; | ||
cx q[3],q[8]; | ||
cx q[5],q[8]; | ||
rz(0.8199726992929931) q[8]; | ||
cx q[5],q[8]; | ||
rx(9.808607416083087) q[5]; | ||
rx(9.808607416083087) q[8]; | ||
rx(1.9993980494552113) q[9]; | ||
cx q[1],q[9]; | ||
rz(0.8199726992929931) q[9]; | ||
cx q[1],q[9]; | ||
rx(9.808607416083087) q[1]; | ||
cx q[0],q[1]; | ||
rz(1.2724239654332838) q[1]; | ||
cx q[0],q[1]; | ||
cx q[0],q[2]; | ||
rz(1.2724239654332838) q[2]; | ||
cx q[0],q[2]; | ||
rx(4.304211127616218) q[2]; | ||
cx q[3],q[9]; | ||
rz(0.8199726992929931) q[9]; | ||
cx q[3],q[9]; | ||
rx(9.808607416083087) q[3]; | ||
cx q[0],q[3]; | ||
rz(1.2724239654332838) q[3]; | ||
cx q[0],q[3]; | ||
rx(4.304211127616218) q[0]; | ||
cx q[1],q[3]; | ||
rz(1.2724239654332838) q[3]; | ||
cx q[1],q[3]; | ||
cx q[1],q[4]; | ||
rz(1.2724239654332838) q[4]; | ||
cx q[1],q[4]; | ||
cx q[1],q[5]; | ||
cx q[3],q[4]; | ||
rz(1.2724239654332838) q[4]; | ||
cx q[3],q[4]; | ||
cx q[4],q[6]; | ||
rz(1.2724239654332838) q[5]; | ||
cx q[1],q[5]; | ||
cx q[3],q[5]; | ||
rz(1.2724239654332838) q[5]; | ||
cx q[3],q[5]; | ||
cx q[3],q[7]; | ||
rz(1.2724239654332838) q[6]; | ||
cx q[4],q[6]; | ||
cx q[5],q[6]; | ||
rz(1.2724239654332838) q[6]; | ||
cx q[5],q[6]; | ||
rx(4.304211127616218) q[6]; | ||
rz(1.2724239654332838) q[7]; | ||
cx q[3],q[7]; | ||
cx q[3],q[8]; | ||
cx q[4],q[7]; | ||
rz(1.2724239654332838) q[7]; | ||
cx q[4],q[7]; | ||
rx(4.304211127616218) q[4]; | ||
rx(4.304211127616218) q[7]; | ||
rz(1.2724239654332838) q[8]; | ||
cx q[3],q[8]; | ||
cx q[5],q[8]; | ||
rz(1.2724239654332838) q[8]; | ||
cx q[5],q[8]; | ||
rx(4.304211127616218) q[5]; | ||
rx(4.304211127616218) q[8]; | ||
rx(9.808607416083087) q[9]; | ||
cx q[1],q[9]; | ||
rz(1.2724239654332838) q[9]; | ||
cx q[1],q[9]; | ||
rx(4.304211127616218) q[1]; | ||
cx q[3],q[9]; | ||
rz(1.2724239654332838) q[9]; | ||
cx q[3],q[9]; | ||
rx(4.304211127616218) q[3]; | ||
rx(4.304211127616218) q[9]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth a sentence or two on what the absolute error definition is here? Or maybe better in the docs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related+for my own understanding.
We have two circuits, the original
O
and the compiledC = compile(O)
. For some measurement/metricM
, we then generateM(O)
M(noisy_simulation(C)) = M(noisy_simulation(compile(O))
My questions are
M(0)
andM(C)
are equal? In principle yes, but are all circuit transformations lossless, especially if floating point precision comes into play?M(noisy_simulation(O))
andM(noisy_simulation(C))
compared toM(O)
to know how much more noise-tolerant the compiled circuit is than the original circuit?cc @Misty-W as this also related to the benchmark specific measurement work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1e-20
. But, to answer your question, I was using the following definition of relative error which is recorded in the results object.M(O) == M(C)
, and that's a good point about approximate compilation. I'll punt that question to @Misty-W since I'm not super familiar with the exactness of current passes.I'll add a note in the README which is also part of the built documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do have approximate compilation passes in UCC, they are:
Agreed, benchmarking circuits for noise resilience is a great follow-up.