diff --git a/benchmarking/adder_8/adder_8.qasm b/benchmarking/adder_8/adder_8.qasm new file mode 100644 index 0000000..c6619d8 --- /dev/null +++ b/benchmarking/adder_8/adder_8.qasm @@ -0,0 +1,139 @@ +OPENQASM 2.0; +include "qelib1.inc"; +qreg q[24]; +cx q[3], q[2]; +cx q[8], q[7]; +cx q[14], q[13]; +cx q[21], q[20]; +cx q[3], q[4]; +cx q[8], q[9]; +cx q[14], q[15]; +cx q[21], q[22]; +ccx q[0], q[1], q[3]; +ccx q[5], q[6], q[8]; +ccx q[11], q[12], q[14]; +ccx q[18], q[19], q[21]; +ccx q[2], q[3], q[4]; +ccx q[7], q[8], q[9]; +ccx q[7], q[8], q[10]; +ccx q[13], q[14], q[15]; +ccx q[13], q[14], q[16]; +ccx q[20], q[21], q[22]; +ccx q[20], q[21], q[23]; +cx q[6], q[5]; +cx q[12], q[11]; +cx q[19], q[18]; +cx q[5], q[8]; +cx q[11], q[14]; +cx q[18], q[21]; +ccx q[7], q[8], q[10]; +ccx q[13], q[14], q[16]; +ccx q[20], q[21], q[23]; +ccx q[16], q[23], q[17]; +ccx q[15], q[23], q[22]; +ccx q[4], q[10], q[9]; +ccx q[9], q[17], q[22]; +ccx q[9], q[16], q[15]; +ccx q[16], q[23], q[17]; +ccx q[7], q[8], q[10]; +ccx q[13], q[14], q[16]; +ccx q[20], q[21], q[23]; +cx q[5], q[8]; +cx q[11], q[14]; +cx q[18], q[21]; +cx q[6], q[5]; +cx q[12], q[11]; +cx q[19], q[18]; +ccx q[7], q[8], q[10]; +ccx q[13], q[14], q[16]; +ccx q[20], q[21], q[23]; +ccx q[0], q[1], q[3]; +ccx q[5], q[6], q[8]; +ccx q[11], q[12], q[14]; +ccx q[18], q[19], q[21]; +cx q[3], q[2]; +cx q[8], q[7]; +cx q[14], q[13]; +cx q[21], q[20]; +cx q[6], q[5]; +cx q[12], q[11]; +cx q[19], q[18]; +cx q[6], q[8]; +cx q[12], q[14]; +cx q[19], q[21]; +cx q[4], q[6]; +cx q[9], q[12]; +cx q[15], q[19]; +ccx q[0], q[1], q[3]; +ccx q[5], q[6], q[8]; +ccx q[11], q[12], q[14]; +ccx q[18], q[19], q[21]; +cx q[3], q[2]; +cx q[8], q[7]; +cx q[14], q[13]; +cx q[21], q[20]; +ccx q[0], q[1], q[3]; +ccx q[5], q[6], q[8]; +ccx q[11], q[12], q[14]; +ccx q[18], q[19], q[21]; +cx q[6], q[5]; +cx q[12], q[11]; +cx q[19], q[18]; +cx q[4], q[6]; +cx q[9], q[12]; +cx q[15], q[19]; +cx q[6], q[8]; +cx q[12], q[14]; +cx q[19], q[21]; +cx q[1], q[0]; +cx q[6], q[5]; +cx q[12], q[11]; +cx q[19], q[18]; +x q[0]; +x q[2]; +x q[5]; +x q[7]; +x q[11]; +x q[13]; +cx q[3], q[2]; +cx q[8], q[7]; +cx q[14], q[13]; +ccx q[0], q[1], q[3]; +ccx q[5], q[6], q[8]; +ccx q[11], q[12], q[14]; +cx q[6], q[5]; +cx q[12], q[11]; +ccx q[7], q[8], q[10]; +ccx q[13], q[14], q[16]; +cx q[5], q[8]; +cx q[11], q[14]; +ccx q[7], q[8], q[10]; +ccx q[13], q[14], q[16]; +ccx q[9], q[16], q[15]; +ccx q[4], q[10], q[9]; +ccx q[7], q[8], q[10]; +ccx q[13], q[14], q[16]; +cx q[5], q[8]; +cx q[11], q[14]; +ccx q[7], q[8], q[10]; +ccx q[13], q[14], q[16]; +cx q[6], q[5]; +cx q[12], q[11]; +ccx q[7], q[8], q[9]; +ccx q[13], q[14], q[15]; +ccx q[2], q[3], q[4]; +ccx q[0], q[1], q[3]; +ccx q[5], q[6], q[8]; +ccx q[11], q[12], q[14]; +cx q[3], q[4]; +cx q[8], q[9]; +cx q[14], q[15]; +cx q[3], q[2]; +cx q[8], q[7]; +cx q[14], q[13]; +x q[0]; +x q[2]; +x q[5]; +x q[7]; +x q[11]; +x q[13]; \ No newline at end of file diff --git a/benchmarking/adder_8/processed_data_summary.json b/benchmarking/adder_8/processed_data_summary.json new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/benchmarking/adder_8/processed_data_summary.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/benchmarking/ex1_226.qasm b/benchmarking/ex1_226/ex1_226.qasm similarity index 100% rename from benchmarking/ex1_226.qasm rename to benchmarking/ex1_226/ex1_226.qasm diff --git a/benchmarking/processed_data_summary.json b/benchmarking/ex1_226/processed_data_summary.json similarity index 100% rename from benchmarking/processed_data_summary.json rename to benchmarking/ex1_226/processed_data_summary.json diff --git a/benchmarking/results/ex1_226-qiskit0.13.0-ibm_rochester.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.13.0-ibm_rochester.csv similarity index 100% rename from benchmarking/results/ex1_226-qiskit0.13.0-ibm_rochester.csv rename to benchmarking/ex1_226/results/ex1_226-qiskit0.13.0-ibm_rochester.csv diff --git a/benchmarking/results/ex1_226-qiskit0.13.0-rigetti_16q_aspen.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.13.0-rigetti_16q_aspen.csv similarity index 100% rename from benchmarking/results/ex1_226-qiskit0.13.0-rigetti_16q_aspen.csv rename to benchmarking/ex1_226/results/ex1_226-qiskit0.13.0-rigetti_16q_aspen.csv diff --git a/benchmarking/results/ex1_226-qiskit0.14.2-ibm_rochester.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.14.2-ibm_rochester.csv similarity index 100% rename from benchmarking/results/ex1_226-qiskit0.14.2-ibm_rochester.csv rename to benchmarking/ex1_226/results/ex1_226-qiskit0.14.2-ibm_rochester.csv diff --git a/benchmarking/results/ex1_226-qiskit0.14.2-rigetti_16q_aspen.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.14.2-rigetti_16q_aspen.csv similarity index 100% rename from benchmarking/results/ex1_226-qiskit0.14.2-rigetti_16q_aspen.csv rename to benchmarking/ex1_226/results/ex1_226-qiskit0.14.2-rigetti_16q_aspen.csv diff --git a/benchmarking/results/ex1_226-qiskit0.15.2-ibm_rochester.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.15.2-ibm_rochester.csv similarity index 100% rename from benchmarking/results/ex1_226-qiskit0.15.2-ibm_rochester.csv rename to benchmarking/ex1_226/results/ex1_226-qiskit0.15.2-ibm_rochester.csv diff --git a/benchmarking/results/ex1_226-qiskit0.15.2-rigetti_16q_aspen.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.15.2-rigetti_16q_aspen.csv similarity index 100% rename from benchmarking/results/ex1_226-qiskit0.15.2-rigetti_16q_aspen.csv rename to benchmarking/ex1_226/results/ex1_226-qiskit0.15.2-rigetti_16q_aspen.csv diff --git a/benchmarking/results/ex1_226-qiskit0.16.4-ibm_rochester.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.16.4-ibm_rochester.csv similarity index 100% rename from benchmarking/results/ex1_226-qiskit0.16.4-ibm_rochester.csv rename to benchmarking/ex1_226/results/ex1_226-qiskit0.16.4-ibm_rochester.csv diff --git a/benchmarking/results/ex1_226-qiskit0.16.4-rigetti_16q_aspen.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.16.4-rigetti_16q_aspen.csv similarity index 100% rename from benchmarking/results/ex1_226-qiskit0.16.4-rigetti_16q_aspen.csv rename to benchmarking/ex1_226/results/ex1_226-qiskit0.16.4-rigetti_16q_aspen.csv diff --git a/benchmarking/results/ex1_226-qiskit0.17.4-ibm_rochester.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.17.4-ibm_rochester.csv similarity index 100% rename from benchmarking/results/ex1_226-qiskit0.17.4-ibm_rochester.csv rename to benchmarking/ex1_226/results/ex1_226-qiskit0.17.4-ibm_rochester.csv diff --git a/benchmarking/results/ex1_226-qiskit0.17.4-rigetti_16q_aspen.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.17.4-rigetti_16q_aspen.csv similarity index 100% rename from benchmarking/results/ex1_226-qiskit0.17.4-rigetti_16q_aspen.csv rename to benchmarking/ex1_226/results/ex1_226-qiskit0.17.4-rigetti_16q_aspen.csv diff --git a/benchmarking/results/ex1_226-qiskit0.18.3-ibm_rochester.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.18.3-ibm_rochester.csv similarity index 100% rename from benchmarking/results/ex1_226-qiskit0.18.3-ibm_rochester.csv rename to benchmarking/ex1_226/results/ex1_226-qiskit0.18.3-ibm_rochester.csv diff --git a/benchmarking/results/ex1_226-qiskit0.18.3-rigetti_16q_aspen.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.18.3-rigetti_16q_aspen.csv similarity index 100% rename from benchmarking/results/ex1_226-qiskit0.18.3-rigetti_16q_aspen.csv rename to benchmarking/ex1_226/results/ex1_226-qiskit0.18.3-rigetti_16q_aspen.csv diff --git a/benchmarking/results/ex1_226-qiskit0.19.2-ibm_rochester.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.19.2-ibm_rochester.csv similarity index 100% rename from benchmarking/results/ex1_226-qiskit0.19.2-ibm_rochester.csv rename to benchmarking/ex1_226/results/ex1_226-qiskit0.19.2-ibm_rochester.csv diff --git a/benchmarking/results/ex1_226-qiskit0.19.2-rigetti_16q_aspen.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.19.2-rigetti_16q_aspen.csv similarity index 100% rename from benchmarking/results/ex1_226-qiskit0.19.2-rigetti_16q_aspen.csv rename to benchmarking/ex1_226/results/ex1_226-qiskit0.19.2-rigetti_16q_aspen.csv diff --git a/benchmarking/results/ex1_226-qiskit0.20.2-ibm_rochester.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.20.2-ibm_rochester.csv similarity index 100% rename from benchmarking/results/ex1_226-qiskit0.20.2-ibm_rochester.csv rename to benchmarking/ex1_226/results/ex1_226-qiskit0.20.2-ibm_rochester.csv diff --git a/benchmarking/results/ex1_226-qiskit0.20.2-rigetti_16q_aspen.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.20.2-rigetti_16q_aspen.csv similarity index 100% rename from benchmarking/results/ex1_226-qiskit0.20.2-rigetti_16q_aspen.csv rename to benchmarking/ex1_226/results/ex1_226-qiskit0.20.2-rigetti_16q_aspen.csv diff --git a/benchmarking/results/ex1_226-qiskit0.21.2-ibm_rochester.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.21.2-ibm_rochester.csv similarity index 100% rename from benchmarking/results/ex1_226-qiskit0.21.2-ibm_rochester.csv rename to benchmarking/ex1_226/results/ex1_226-qiskit0.21.2-ibm_rochester.csv diff --git a/benchmarking/results/ex1_226-qiskit0.21.2-rigetti_16q_aspen.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.21.2-rigetti_16q_aspen.csv similarity index 100% rename from benchmarking/results/ex1_226-qiskit0.21.2-rigetti_16q_aspen.csv rename to benchmarking/ex1_226/results/ex1_226-qiskit0.21.2-rigetti_16q_aspen.csv diff --git a/benchmarking/results/ex1_226-qiskit0.22.4-ibm_rochester.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.22.4-ibm_rochester.csv similarity index 100% rename from benchmarking/results/ex1_226-qiskit0.22.4-ibm_rochester.csv rename to benchmarking/ex1_226/results/ex1_226-qiskit0.22.4-ibm_rochester.csv diff --git a/benchmarking/results/ex1_226-qiskit0.22.4-rigetti_16q_aspen.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.22.4-rigetti_16q_aspen.csv similarity index 100% rename from benchmarking/results/ex1_226-qiskit0.22.4-rigetti_16q_aspen.csv rename to benchmarking/ex1_226/results/ex1_226-qiskit0.22.4-rigetti_16q_aspen.csv diff --git a/benchmarking/results/ex1_226-qiskit0.23.3-ibm_rochester.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.23.3-ibm_rochester.csv similarity index 100% rename from benchmarking/results/ex1_226-qiskit0.23.3-ibm_rochester.csv rename to benchmarking/ex1_226/results/ex1_226-qiskit0.23.3-ibm_rochester.csv diff --git a/benchmarking/results/ex1_226-qiskit0.23.3-rigetti_16q_aspen.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.23.3-rigetti_16q_aspen.csv similarity index 100% rename from benchmarking/results/ex1_226-qiskit0.23.3-rigetti_16q_aspen.csv rename to benchmarking/ex1_226/results/ex1_226-qiskit0.23.3-rigetti_16q_aspen.csv diff --git a/benchmarking/results/ex1_226-qiskit0.24.1-ibm_rochester.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.24.1-ibm_rochester.csv similarity index 100% rename from benchmarking/results/ex1_226-qiskit0.24.1-ibm_rochester.csv rename to benchmarking/ex1_226/results/ex1_226-qiskit0.24.1-ibm_rochester.csv diff --git a/benchmarking/results/ex1_226-qiskit0.24.1-rigetti_16q_aspen.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.24.1-rigetti_16q_aspen.csv similarity index 100% rename from benchmarking/results/ex1_226-qiskit0.24.1-rigetti_16q_aspen.csv rename to benchmarking/ex1_226/results/ex1_226-qiskit0.24.1-rigetti_16q_aspen.csv diff --git a/benchmarking/results/ex1_226-qiskit0.24.2-ibm_rochester.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.24.2-ibm_rochester.csv similarity index 100% rename from benchmarking/results/ex1_226-qiskit0.24.2-ibm_rochester.csv rename to benchmarking/ex1_226/results/ex1_226-qiskit0.24.2-ibm_rochester.csv diff --git a/benchmarking/results/ex1_226-qiskit0.24.2-rigetti_16q_aspen.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.24.2-rigetti_16q_aspen.csv similarity index 100% rename from benchmarking/results/ex1_226-qiskit0.24.2-rigetti_16q_aspen.csv rename to benchmarking/ex1_226/results/ex1_226-qiskit0.24.2-rigetti_16q_aspen.csv diff --git a/benchmarking/results/ex1_226-qiskit0.25.3-ibm_rochester.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.25.3-ibm_rochester.csv similarity index 100% rename from benchmarking/results/ex1_226-qiskit0.25.3-ibm_rochester.csv rename to benchmarking/ex1_226/results/ex1_226-qiskit0.25.3-ibm_rochester.csv diff --git a/benchmarking/results/ex1_226-qiskit0.25.3-rigetti_16q_aspen.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.25.3-rigetti_16q_aspen.csv similarity index 100% rename from benchmarking/results/ex1_226-qiskit0.25.3-rigetti_16q_aspen.csv rename to benchmarking/ex1_226/results/ex1_226-qiskit0.25.3-rigetti_16q_aspen.csv diff --git a/benchmarking/ex1_226/results/ex1_226-qiskit0.44.1-ibm_rochester.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.44.1-ibm_rochester.csv new file mode 100644 index 0000000..6b07ce1 --- /dev/null +++ b/benchmarking/ex1_226/results/ex1_226-qiskit0.44.1-ibm_rochester.csv @@ -0,0 +1,101 @@ +|Qasm file|Method|Date|Opt level|Platform|Seed|Circuit depth|Gate count +0|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|0|11|15 +1|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|1|11|16 +2|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|2|9|17 +3|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|3|8|12 +4|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|4|11|16 +5|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|5|10|15 +6|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|6|11|15 +7|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|7|13|20 +8|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|8|9|13 +9|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|9|10|17 +10|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|10|11|15 +11|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|11|10|17 +12|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|12|9|13 +13|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|13|9|12 +14|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|14|11|17 +15|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|15|12|22 +16|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|16|11|17 +17|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|17|11|16 +18|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|18|12|20 +19|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|19|10|16 +20|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|20|11|18 +21|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|21|8|12 +22|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|22|9|17 +23|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|23|10|17 +24|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|24|11|18 +25|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|25|11|16 +26|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|26|10|17 +27|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|27|10|16 +28|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|28|13|19 +29|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|29|13|19 +30|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|30|11|17 +31|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|31|11|15 +32|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|32|9|13 +33|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|33|11|16 +34|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|34|10|17 +35|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|35|13|21 +36|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|36|11|16 +37|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|37|10|16 +38|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|38|13|22 +39|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|39|11|17 +40|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|40|11|16 +41|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|41|10|17 +42|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|42|10|17 +43|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|43|9|13 +44|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|44|13|18 +45|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|45|8|13 +46|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|46|13|18 +47|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|47|11|17 +48|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|48|9|17 +49|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|49|11|18 +50|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|50|8|12 +51|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|51|11|15 +52|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|52|8|12 +53|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|53|10|16 +54|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|54|7|13 +55|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|55|10|17 +56|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|56|11|16 +57|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|57|10|16 +58|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|58|9|17 +59|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|59|13|19 +60|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|60|9|13 +61|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|61|11|15 +62|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|62|10|17 +63|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|63|10|17 +64|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|64|10|17 +65|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|65|9|12 +66|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|66|11|15 +67|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|67|10|15 +68|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|68|9|17 +69|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|69|10|17 +70|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|70|8|12 +71|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|71|9|17 +72|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|72|11|16 +73|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|73|10|17 +74|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|74|9|12 +75|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|75|11|17 +76|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|76|11|17 +77|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|77|8|12 +78|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|78|11|16 +79|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|79|11|15 +80|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|80|9|17 +81|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|81|12|21 +82|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|82|10|15 +83|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|83|9|17 +84|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|84|11|17 +85|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|85|13|20 +86|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|86|12|21 +87|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|87|11|16 +88|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|88|13|19 +89|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|89|11|16 +90|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|90|11|16 +91|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|91|9|17 +92|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|92|13|19 +93|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|93|13|22 +94|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|94|13|19 +95|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|95|9|12 +96|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|96|9|17 +97|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|97|9|17 +98|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|98|7|12 +99|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|ibm_rochester|99|11|15 diff --git a/benchmarking/ex1_226/results/ex1_226-qiskit0.44.1-rigetti_16q_aspen.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.44.1-rigetti_16q_aspen.csv new file mode 100644 index 0000000..a76276b --- /dev/null +++ b/benchmarking/ex1_226/results/ex1_226-qiskit0.44.1-rigetti_16q_aspen.csv @@ -0,0 +1,101 @@ +|Qasm file|Method|Date|Opt level|Platform|Seed|Circuit depth|Gate count +0|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|0|8|16 +1|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|1|10|16 +2|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|2|9|13 +3|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|3|10|15 +4|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|4|8|14 +5|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|5|9|13 +6|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|6|8|16 +7|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|7|8|13 +8|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|8|8|12 +9|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|9|10|18 +10|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|10|8|14 +11|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|11|9|14 +12|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|12|8|15 +13|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|13|10|19 +14|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|14|8|14 +15|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|15|10|16 +16|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|16|8|11 +17|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|17|10|18 +18|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|18|8|13 +19|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|19|8|11 +20|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|20|8|11 +21|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|21|10|16 +22|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|22|8|14 +23|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|23|8|11 +24|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|24|10|16 +25|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|25|10|16 +26|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|26|9|17 +27|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|27|8|16 +28|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|28|10|19 +29|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|29|6|9 +30|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|30|10|19 +31|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|31|8|11 +32|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|32|13|19 +33|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|33|13|22 +34|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|34|10|17 +35|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|35|10|16 +36|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|36|8|11 +37|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|37|8|12 +38|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|38|11|20 +39|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|39|10|16 +40|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|40|10|15 +41|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|41|13|20 +42|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|42|9|19 +43|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|43|10|18 +44|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|44|10|17 +45|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|45|8|13 +46|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|46|8|12 +47|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|47|10|16 +48|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|48|8|12 +49|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|49|10|17 +50|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|50|10|16 +51|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|51|10|16 +52|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|52|10|19 +53|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|53|8|16 +54|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|54|10|19 +55|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|55|10|16 +56|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|56|8|14 +57|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|57|10|19 +58|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|58|8|11 +59|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|59|8|15 +60|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|60|10|19 +61|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|61|10|18 +62|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|62|10|17 +63|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|63|10|19 +64|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|64|10|19 +65|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|65|8|11 +66|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|66|11|20 +67|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|67|8|15 +68|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|68|8|11 +69|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|69|10|19 +70|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|70|8|12 +71|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|71|10|16 +72|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|72|8|14 +73|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|73|8|12 +74|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|74|11|16 +75|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|75|10|16 +76|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|76|11|16 +77|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|77|10|16 +78|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|78|8|15 +79|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|79|10|18 +80|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|80|8|15 +81|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|81|8|13 +82|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|82|10|19 +83|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|83|8|14 +84|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|84|8|11 +85|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|85|10|19 +86|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|86|8|14 +87|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|87|8|11 +88|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|88|8|14 +89|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|89|10|16 +90|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|90|8|14 +91|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|91|8|15 +92|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|92|10|18 +93|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|93|10|15 +94|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|94|10|16 +95|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|95|8|11 +96|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|96|10|16 +97|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|97|8|11 +98|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|98|8|15 +99|ex1_226.qasm|Qiskit 0.44.1 compilation|2023-08-17|3|rigetti_16q_aspen|99|8|15 diff --git a/benchmarking/results/ex1_226-qiskit0.45.0-ibm_rochester.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.45.0-ibm_rochester.csv similarity index 100% rename from benchmarking/results/ex1_226-qiskit0.45.0-ibm_rochester.csv rename to benchmarking/ex1_226/results/ex1_226-qiskit0.45.0-ibm_rochester.csv diff --git a/benchmarking/results/ex1_226-qiskit0.45.0-rigetti_16q_aspen.csv b/benchmarking/ex1_226/results/ex1_226-qiskit0.45.0-rigetti_16q_aspen.csv similarity index 100% rename from benchmarking/results/ex1_226-qiskit0.45.0-rigetti_16q_aspen.csv rename to benchmarking/ex1_226/results/ex1_226-qiskit0.45.0-rigetti_16q_aspen.csv diff --git a/benchmarking/results/visualizations/boxplot-aspen_depth.png b/benchmarking/ex1_226/results/visualizations/boxplot-aspen_depth.png similarity index 100% rename from benchmarking/results/visualizations/boxplot-aspen_depth.png rename to benchmarking/ex1_226/results/visualizations/boxplot-aspen_depth.png diff --git a/benchmarking/results/visualizations/boxplot-aspen_gates.png b/benchmarking/ex1_226/results/visualizations/boxplot-aspen_gates.png similarity index 100% rename from benchmarking/results/visualizations/boxplot-aspen_gates.png rename to benchmarking/ex1_226/results/visualizations/boxplot-aspen_gates.png diff --git a/benchmarking/results/visualizations/boxplot-rochester_depth.png b/benchmarking/ex1_226/results/visualizations/boxplot-rochester_depth.png similarity index 100% rename from benchmarking/results/visualizations/boxplot-rochester_depth.png rename to benchmarking/ex1_226/results/visualizations/boxplot-rochester_depth.png diff --git a/benchmarking/results/visualizations/boxplot-rochester_gates.png b/benchmarking/ex1_226/results/visualizations/boxplot-rochester_gates.png similarity index 100% rename from benchmarking/results/visualizations/boxplot-rochester_gates.png rename to benchmarking/ex1_226/results/visualizations/boxplot-rochester_gates.png diff --git a/src/circuit_depth_and_gate_count.py b/src/circuit_depth_and_gate_count.py index d747bff..d27651b 100644 --- a/src/circuit_depth_and_gate_count.py +++ b/src/circuit_depth_and_gate_count.py @@ -16,7 +16,7 @@ def run_experiment(qasm_id: str): print(f"\nRunning {METHOD} for circuit {qasm_id}\n") - qasm_file_path = os.path.abspath(os.path.join( os.path.dirname( __file__ ),"..", "benchmarking",f"{qasm_id}.qasm")) + qasm_file_path = os.path.abspath(os.path.join( os.path.dirname( __file__ ),"..","benchmarking",qasm_id,f"{qasm_id}.qasm")) circuit = QuantumCircuit.from_qasm_file(qasm_file_path) # Transpile for each architecture using pyzx for arch in ARCHITECTURES: @@ -35,7 +35,7 @@ def run_experiment(qasm_id: str): results = [f"{qasm_id}.qasm", METHOD, DATE, OPTIMIZATION_LEVEL,arch,i,result.depth(),sum(result.count_ops().values())] df.loc[len(df)] = results - output_path = os.path.abspath(os.path.join(os.path.dirname( __file__ ),"..","benchmarking","results",f"{qasm_id}-qiskit{VERSION}-{arch}.csv")) + output_path = os.path.abspath(os.path.join(os.path.dirname( __file__ ),"..","benchmarking",qasm_id,"results",f"{qasm_id}-qiskit{VERSION}-{arch}.csv")) df.to_csv(output_path, sep="|") print(f"{arch}\n", diff --git a/src/data_visualization_example.py b/src/data_visualization_example.py index 0bcd6fc..c3bfdb3 100644 --- a/src/data_visualization_example.py +++ b/src/data_visualization_example.py @@ -4,80 +4,83 @@ import matplotlib.pyplot as plt import glob -# All results -csv_files = glob.glob(os.path.abspath(os.path.join( os.path.dirname( __file__ ),"..", "benchmarking", "results", "*.csv"))) +experiment_names = ["adder_8","ex1_226"] +for experiment_name in experiment_names: + # All results + csv_files = glob.glob(os.path.abspath(os.path.join( os.path.dirname( __file__ ),"..","benchmarking",experiment_name,"results", "*.csv"))) -# Filter by architecture -architectures = {"aspen" : "rigetti_16q_aspen", "rochester" : "ibm_rochester"} -aspen_files = [file for file in csv_files if architectures["aspen"] in file] -rochester_files = [file for file in csv_files if architectures["rochester"] in file] + # Filter by architecture + architectures = {"aspen" : "rigetti_16q_aspen", "rochester" : "ibm_rochester"} + aspen_files = [file for file in csv_files if architectures["aspen"] in file] + rochester_files = [file for file in csv_files if architectures["rochester"] in file] -# Store dataframes by architecture -aspen_dataframes = [] -rochester_dataframes = [] + # Store dataframes by architecture + aspen_dataframes = [] + rochester_dataframes = [] -# For each architecture, read each file and store its dataframe -for csv_file_path in aspen_files: - df = pd.read_csv(csv_file_path, sep="|") - aspen_dataframes.append(df) + # For each architecture, read each file and store its dataframe + for csv_file_path in aspen_files: + df = pd.read_csv(csv_file_path, sep="|") + aspen_dataframes.append(df) -for csv_file_path in rochester_files: - df = pd.read_csv(csv_file_path, sep="|") - rochester_dataframes.append(df) + for csv_file_path in rochester_files: + df = pd.read_csv(csv_file_path, sep="|") + rochester_dataframes.append(df) -# Concatenate all dataframes by architecture -aspen_combined_df = pd.concat(aspen_dataframes, ignore_index=True) -rochester_combined_df = pd.concat(rochester_dataframes, ignore_index=True) + # Concatenate all dataframes by architecture + aspen_combined_df = pd.concat(aspen_dataframes, ignore_index=True) + rochester_combined_df = pd.concat(rochester_dataframes, ignore_index=True) -# Get data columns for plotting chart -date_col = "Date" -method_col = "Method" -circuit_depth_col = "Circuit depth" -gate_count_col = "Gate count" + # Get data columns for plotting chart + date_col = "Date" + method_col = "Method" + circuit_depth_col = "Circuit depth" + gate_count_col = "Gate count" -# Sort dataframes by date -aspen_combined_df.sort_values(by=date_col, inplace=True) -rochester_combined_df.sort_values(by=date_col, inplace=True) + # Sort dataframes by date + aspen_combined_df.sort_values(by=date_col, inplace=True) + rochester_combined_df.sort_values(by=date_col, inplace=True) -# Extract version from Method column -version_col = "Qiskit version" -aspen_combined_df[version_col] = aspen_combined_df.apply(lambda row : str(row[method_col]).split(' ')[1], axis = 1) -rochester_combined_df[version_col] = rochester_combined_df.apply(lambda row : str(row[method_col]).split(' ')[1], axis = 1) + # Extract version from Method column + version_col = "Qiskit version" + aspen_combined_df[version_col] = aspen_combined_df.apply(lambda row : str(row[method_col]).split(' ')[1], axis = 1) + rochester_combined_df[version_col] = rochester_combined_df.apply(lambda row : str(row[method_col]).split(' ')[1], axis = 1) -# Enable grid lines -sns.set(style="whitegrid") + # Enable grid lines + sns.set(style="whitegrid") -# Create boxplots for aspen architecture -# Circuit depth -plt.figure(figsize=(10,6)) -sns.boxplot(data=aspen_combined_df,x=version_col,y=circuit_depth_col) -plt.title(f"{circuit_depth_col} distribution of Qiskit compilation for {architectures['aspen']}") -plt.xticks(rotation=90) -plt.tight_layout() -plt.show() -# Gate count -plt.figure(figsize=(10,6)) -sns.boxplot(data=aspen_combined_df,x=version_col,y=gate_count_col) -plt.title(f"{gate_count_col} distribution of Qiskit compilation for {architectures['aspen']}") -plt.xticks(rotation=90) -plt.tight_layout() -plt.show() + # TODO: refactor repetitive code below + # Create boxplots for aspen architecture + # Circuit depth + plt.figure(figsize=(10,6)) + sns.boxplot(data=aspen_combined_df,x=version_col,y=circuit_depth_col) + plt.title(f"{circuit_depth_col} distribution of Qiskit compilation for {architectures['aspen']}") + plt.xticks(rotation=90) + plt.tight_layout() + plt.show() + # Gate count + plt.figure(figsize=(10,6)) + sns.boxplot(data=aspen_combined_df,x=version_col,y=gate_count_col) + plt.title(f"{gate_count_col} distribution of Qiskit compilation for {architectures['aspen']}") + plt.xticks(rotation=90) + plt.tight_layout() + plt.show() -# Create boxplots for rochester architecture -# Circuit depth -plt.figure(figsize=(10,6)) -sns.boxplot(data=rochester_combined_df,x=version_col,y=circuit_depth_col) -plt.title(f"{circuit_depth_col} distribution of Qiskit compilation for {architectures['rochester']}") -plt.xticks(rotation=90) -plt.tight_layout() -plt.show() -# Gate count -plt.figure(figsize=(10,6)) -sns.boxplot(data=rochester_combined_df,x=version_col,y=gate_count_col) -plt.title(f"{gate_count_col} distribution of Qiskit compilation for {architectures['rochester']}") -plt.xticks(rotation=90) -plt.tight_layout() -plt.show() + # Create boxplots for rochester architecture + # Circuit depth + plt.figure(figsize=(10,6)) + sns.boxplot(data=rochester_combined_df,x=version_col,y=circuit_depth_col) + plt.title(f"{circuit_depth_col} distribution of Qiskit compilation for {architectures['rochester']}") + plt.xticks(rotation=90) + plt.tight_layout() + plt.show() + # Gate count + plt.figure(figsize=(10,6)) + sns.boxplot(data=rochester_combined_df,x=version_col,y=gate_count_col) + plt.title(f"{gate_count_col} distribution of Qiskit compilation for {architectures['rochester']}") + plt.xticks(rotation=90) + plt.tight_layout() + plt.show() diff --git a/src/postprocessing.py b/src/postprocessing.py index a870863..50d3a0e 100644 --- a/src/postprocessing.py +++ b/src/postprocessing.py @@ -11,8 +11,6 @@ CONTENT_URL = "https://github.com/qiskit-community/qiskit-metriq" METRICS = ["Circuit depth", "Gate count"] METRIQ_TOKEN = os.getenv("METRIQ_TOKEN") -RESULTS_PATH = os.path.abspath(os.path.join( os.path.dirname( __file__ ),"..", "benchmarking", "results")) -SUMMARY_PATH = os.path.abspath(os.path.join( os.path.dirname( __file__ ),"..", "benchmarking", "processed_data_summary.json")) THUMBNAIL_URL = "https://avatars.githubusercontent.com/u/30696987?s=200&v=4" # Metriq API parameters and associated ids @@ -22,6 +20,12 @@ TASKS = {"25": "ex1_226.qasm", "26": "ex1_226.qasm (Aspen)", "27": "ex1_226.qasm (Rochester)"} SUBMISSIONS = {"595": TASKS["25"],"661": TASKS["26"], "662": TASKS["27"]} +def get_results_path(experiment_name: str) -> str: + return os.path.abspath(os.path.join( os.path.dirname( __file__ ),"..","benchmarking",experiment_name,"results")) + +def get_summary_path(experiment_name: str) -> str: + return os.path.abspath(os.path.join( os.path.dirname( __file__ ),"..","benchmarking",experiment_name,"processed_data_summary.json")) + def get_substring_between_parentheses(input_str: str) -> str: start = input_str.find("(") end = input_str.find(")") @@ -43,9 +47,10 @@ def get_platform_id(keywork: str) -> str: return key return None -def files_to_be_processed (submission_id: str) -> []: +def files_to_be_processed (submission_id: str, experiment_name: str) -> []: + results_path = get_results_path(experiment_name) print("Processing results for Qiskit version ", VERSION) - all_filenames = os.listdir(RESULTS_PATH) + all_filenames = os.listdir(results_path) files_to_processed = [] for filename in all_filenames: if VERSION in filename: @@ -59,28 +64,30 @@ def files_to_be_processed (submission_id: str) -> []: files_to_processed.append(filename) return files_to_processed -def submit(client: MetriqClient, submission_id: str): - filenames = files_to_be_processed(submission_id) +def submit(client: MetriqClient, submission_id: str, experiment_name: str): + results_path = get_results_path(experiment_name) + filenames = files_to_be_processed(submission_id, experiment_name) for filename in filenames: # Process results and add them to existing submission - file_path = os.path.join(RESULTS_PATH, f"{filename}") + file_path = os.path.join(results_path, f"{filename}") df = pd.read_csv(file_path, sep='|') task_id = get_id(TASKS, SUBMISSIONS[submission_id]) method_id = get_id(METHOD, "Qiskit compilation") process_results(df, client, task_id, method_id, submission_id) -def submit_all(client: MetriqClient, task_name: str, submission_id: str = None): +def submit_all(client: MetriqClient, task_name: str, submission_id: str = None, experiment_name: str= "ex1_226"): if not submission_id: submission_id = create_new_submission(client,task_name) # Process results - filenames = os.listdir(RESULTS_PATH) + results_path = get_results_path(experiment_name) + filenames = os.listdir(results_path) for filename in filenames: architectures = ["aspen", "rochester"] for arch in architectures: if arch in filename and arch in task_name.lower(): print(f"*** Processing {arch} results from {filename}") - file_path = os.path.join(RESULTS_PATH, f"{filename}") + file_path = os.path.join(results_path, f"{filename}") df = pd.read_csv(file_path, sep='|') task_id = get_id(TASKS, task_name) method_id = get_id(METHOD, "Qiskit compilation") @@ -139,16 +146,17 @@ def process_results(dataframe, client: MetriqClient, task_id: str, method_id: st client.result_add(result_item, submission_id) -def evaluate_metrics(qiskit_version: str) -> dict: +def evaluate_metrics(qiskit_version: str, experiment_name: str) -> dict: processed_summary = {} # Process results and save to file - filenames = os.listdir(RESULTS_PATH) + results_path = get_results_path(experiment_name) + filenames = os.listdir(results_path) for filename in filenames: if qiskit_version in filename: for arch in ARCHITECTURES: if arch in filename: - file_path = os.path.join(RESULTS_PATH, f"{filename}") + file_path = os.path.join(results_path, f"{filename}") df = pd.read_csv(file_path, sep='|') obj_key = qiskit_version + "-" + arch processed_summary[obj_key] = [] @@ -186,21 +194,32 @@ def append_to_json_file(json_file_path: str, processed_info: dict, version: str) else: print(f"Summary for version '{version}' is already in file.") -def create_processed_data_summary(): +def create_processed_data_summary(experiment_name: str): + summary_file_path = get_summary_path(experiment_name) versions_info = get_qiskit_versions_info() for info in versions_info: qiskit_version = info["version"] - processed_summary = evaluate_metrics(qiskit_version) - append_to_json_file(SUMMARY_PATH, processed_summary, qiskit_version) + processed_summary = evaluate_metrics(qiskit_version, experiment_name) + append_to_json_file(summary_file_path, processed_summary, qiskit_version) -# create_processed_data_summary() +experiment_name = "ex1_226" +# create_processed_data_summary(experiment_name) # Process data -processed_summary = evaluate_metrics(VERSION) -append_to_json_file(SUMMARY_PATH, processed_summary, VERSION) +processed_summary = evaluate_metrics(VERSION, experiment_name) +summary_file_path = get_summary_path(experiment_name) +append_to_json_file(summary_file_path, processed_summary, VERSION) # Submit to Metriq.info submission_id = os.getenv("SUBMISSION_ID") print(f"Processing submission {submission_id}...") client = MetriqClient(token=METRIQ_TOKEN) -submit(client, submission_id) \ No newline at end of file +submit(client, submission_id) + +""" +TODO: +# get experiment name from tasks +# adjust constants for adder_8 +# remove default experiment_names in methods +# create common file for constants shared across scripts (new issue) +""" \ No newline at end of file diff --git a/src/qiskit_versions.py b/src/qiskit_versions.py index 82683fa..c5114cb 100644 --- a/src/qiskit_versions.py +++ b/src/qiskit_versions.py @@ -123,11 +123,6 @@ def filter_by_date(data_items: dict, min_date: [], max_date: []) -> []: return filtered_releases -def write_versions_to_file(versions: [], filename: str): - file_path = os.path.abspath(os.path.join( os.path.dirname( __file__ ),"..", "benchmarking", filename)) - with open(file_path,"w") as file: - json.dump(versions, file, indent=4) - def get_version_date(package_name: str, input_version:str) -> str: data_items = data_items = get_qiskit_releases_data(package_name) for release, release_info in data_items: diff --git a/src/run_experiment_steps.py b/src/run_experiment_steps.py index c4f2c0e..7bb0f94 100644 --- a/src/run_experiment_steps.py +++ b/src/run_experiment_steps.py @@ -3,20 +3,24 @@ from env_setup import create_tox_config_file # from pprint import pp -RESULTS_PATH = os.path.abspath(os.path.join(os.path.dirname( __file__ ),"..", "benchmarking", "results")) METRIQ_CLIENT_URL = "https://github.com/unitaryfund/metriq-client/tarball/development" -EXPERIMENT = "circuit_depth_and_gate_count" -def get_csv_files(qiskit_version: str) -> [str]: +def get_results_path(experiment_name: str) -> str: + return os.path.abspath(os.path.join( os.path.dirname( __file__ ),"..","benchmarking",experiment_name,"results")) + +def get_csv_files(qiskit_version: str, experiment_name: str) -> [str]: + results_path = get_results_path(experiment_name) matching_files = [] - for filename in os.listdir(RESULTS_PATH): + for filename in os.listdir(results_path): if "csv" in filename and qiskit_version in filename: matching_files.append(filename) return matching_files +# TODO: allow passing experiment_name to this script +experiment_name="ex1_226" + # Get summary of metriq submissions that need update (add/replace) based on new Qiskit versions submissions_to_be_updated = get_submissions_update_info("qiskit") # Use "qiskit-terra" to run on Qiskit < v0.45.0 - for key,value in submissions_to_be_updated.items(): submission_id = key add_versions = value["add"] @@ -26,10 +30,11 @@ def get_csv_files(qiskit_version: str) -> [str]: print(f"Replacing qiskit version {replace_version} results...") # Delete local csv results linked to replace_version + results_path = get_results_path(experiment_name) files_to_be_deleted = get_csv_files(replace_version) for filename in files_to_be_deleted: print(f"Deleting CSV files for outdated qiskit version {replace_version}...") - os.remove(os.path.join(RESULTS_PATH,filename)) + os.remove(os.path.join(results_path,filename)) # Delete result items linked to replace_version from metriq submission print(f"Deleting qiskit version {replace_version} results from submission {submission_id}...") @@ -42,7 +47,7 @@ def get_csv_files(qiskit_version: str) -> [str]: python_version = "3.11" env_name = "qiskit_v" + new_qiskit_version results_available = get_csv_files(new_qiskit_version) - run_experiment_command = f"python {{toxinidir}}/src/{EXPERIMENT}.py" if not results_available else "" + run_experiment_command = "python {{toxinidir}}/src/circuit_depth_and_gate_count.py" if not results_available else "" install_metriq_client_command = f"pip install --upgrade {METRIQ_CLIENT_URL}" submit_data_command = f"python {{toxinidir}}/src/postprocessing.py" env_var = submission_id