Skip to content
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

97 reorg files #98

Merged
merged 15 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions benchmarks/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from .write_qasm import write_qasm
from .scripts import qasm_files, log_performance, save_results
241 changes: 233 additions & 8 deletions benchmarks/load_ucc_benchmarks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"./results/results_2024-11-14_12-22-50.csv\n",
"./results/results_2024-11-14_10-37-34.csv\n",
"./results/results_2024-11-15_09-49-13.csv\n",
"./results/results_2024-11-18_14-10-12.csv\n",
"./results/results_2024-10-01_20-15-41.csv\n",
"./results/results_2024-10-10_13-40-14.csv\n"
"./results/gates_2024-11-14_12-22-50.csv\n",
"./results/gates_2024-11-14_10-37-34.csv\n",
"./results/gates_2024-11-15_09-49-13.csv\n",
"./results/gates_2024-11-18_14-10-12.csv\n",
"./results/gates_2024-10-01_20-15-41.csv\n",
"./results/gates_2024-10-10_13-40-14.csv\n"
]
}
],
Expand All @@ -54,7 +54,7 @@
"import pandas as pd\n",
"\n",
"# Use glob to find all CSV files in the current directory\n",
"csv_files = glob.glob(\"./results/*.csv\")\n",
"csv_files = glob.glob(\"./results/gates*.csv\")\n",
"\n",
"# List to hold DataFrames\n",
"dataframes = []\n",
Expand All @@ -77,6 +77,231 @@
"df_dates = pd.concat(dataframes, ignore_index=True)\n"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>circuit_name</th>\n",
" <th>compiler</th>\n",
" <th>compile_time</th>\n",
" <th>raw_multiq_gates</th>\n",
" <th>compiled_multiq_gates</th>\n",
" <th>gate_reduction_per_s</th>\n",
" <th>reduction_factor</th>\n",
" <th>compiled_ratio</th>\n",
" <th>date</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>prep_select</td>\n",
" <td>cirq</td>\n",
" <td>29.483647</td>\n",
" <td>9744.0</td>\n",
" <td>9712.0</td>\n",
" <td>0.034029</td>\n",
" <td>1.003295</td>\n",
" <td>0.996716</td>\n",
" <td>2024-11-14</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>prep_select</td>\n",
" <td>pytket</td>\n",
" <td>0.066835</td>\n",
" <td>9744.0</td>\n",
" <td>9712.0</td>\n",
" <td>15.011536</td>\n",
" <td>1.003295</td>\n",
" <td>0.996716</td>\n",
" <td>2024-11-14</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>prep_select</td>\n",
" <td>qiskit</td>\n",
" <td>3.655327</td>\n",
" <td>9744.0</td>\n",
" <td>9708.0</td>\n",
" <td>0.274588</td>\n",
" <td>1.003708</td>\n",
" <td>0.996305</td>\n",
" <td>2024-11-14</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>prep_select</td>\n",
" <td>ucc</td>\n",
" <td>1.808951</td>\n",
" <td>9744.0</td>\n",
" <td>9710.0</td>\n",
" <td>0.554742</td>\n",
" <td>1.003502</td>\n",
" <td>0.996511</td>\n",
" <td>2024-11-14</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>qaoa_barabasi_albert</td>\n",
" <td>cirq</td>\n",
" <td>1.919739</td>\n",
" <td>1176.0</td>\n",
" <td>1176.0</td>\n",
" <td>0.520904</td>\n",
" <td>1.000000</td>\n",
" <td>1.000000</td>\n",
" <td>2024-11-14</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>139</th>\n",
" <td>qv</td>\n",
" <td>ucc</td>\n",
" <td>6.741943</td>\n",
" <td>15000.0</td>\n",
" <td>14856.0</td>\n",
" <td>0.149763</td>\n",
" <td>1.009693</td>\n",
" <td>0.990400</td>\n",
" <td>2024-10-10</td>\n",
" </tr>\n",
" <tr>\n",
" <th>140</th>\n",
" <td>square_heisenberg</td>\n",
" <td>cirq</td>\n",
" <td>6.504360</td>\n",
" <td>2160.0</td>\n",
" <td>540.0</td>\n",
" <td>0.614972</td>\n",
" <td>4.000000</td>\n",
" <td>0.250000</td>\n",
" <td>2024-10-10</td>\n",
" </tr>\n",
" <tr>\n",
" <th>141</th>\n",
" <td>square_heisenberg</td>\n",
" <td>pytket</td>\n",
" <td>0.182948</td>\n",
" <td>2160.0</td>\n",
" <td>2160.0</td>\n",
" <td>5.466031</td>\n",
" <td>1.000000</td>\n",
" <td>1.000000</td>\n",
" <td>2024-10-10</td>\n",
" </tr>\n",
" <tr>\n",
" <th>142</th>\n",
" <td>square_heisenberg</td>\n",
" <td>qiskit</td>\n",
" <td>0.653635</td>\n",
" <td>2160.0</td>\n",
" <td>540.0</td>\n",
" <td>6.119623</td>\n",
" <td>4.000000</td>\n",
" <td>0.250000</td>\n",
" <td>2024-10-10</td>\n",
" </tr>\n",
" <tr>\n",
" <th>143</th>\n",
" <td>square_heisenberg</td>\n",
" <td>ucc</td>\n",
" <td>0.288102</td>\n",
" <td>2160.0</td>\n",
" <td>540.0</td>\n",
" <td>13.883964</td>\n",
" <td>4.000000</td>\n",
" <td>0.250000</td>\n",
" <td>2024-10-10</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>144 rows × 9 columns</p>\n",
"</div>"
],
"text/plain": [
" circuit_name compiler compile_time raw_multiq_gates \\\n",
"0 prep_select cirq 29.483647 9744.0 \n",
"1 prep_select pytket 0.066835 9744.0 \n",
"2 prep_select qiskit 3.655327 9744.0 \n",
"3 prep_select ucc 1.808951 9744.0 \n",
"4 qaoa_barabasi_albert cirq 1.919739 1176.0 \n",
".. ... ... ... ... \n",
"139 qv ucc 6.741943 15000.0 \n",
"140 square_heisenberg cirq 6.504360 2160.0 \n",
"141 square_heisenberg pytket 0.182948 2160.0 \n",
"142 square_heisenberg qiskit 0.653635 2160.0 \n",
"143 square_heisenberg ucc 0.288102 2160.0 \n",
"\n",
" compiled_multiq_gates gate_reduction_per_s reduction_factor \\\n",
"0 9712.0 0.034029 1.003295 \n",
"1 9712.0 15.011536 1.003295 \n",
"2 9708.0 0.274588 1.003708 \n",
"3 9710.0 0.554742 1.003502 \n",
"4 1176.0 0.520904 1.000000 \n",
".. ... ... ... \n",
"139 14856.0 0.149763 1.009693 \n",
"140 540.0 0.614972 4.000000 \n",
"141 2160.0 5.466031 1.000000 \n",
"142 540.0 6.119623 4.000000 \n",
"143 540.0 13.883964 4.000000 \n",
"\n",
" compiled_ratio date \n",
"0 0.996716 2024-11-14 \n",
"1 0.996716 2024-11-14 \n",
"2 0.996305 2024-11-14 \n",
"3 0.996511 2024-11-14 \n",
"4 1.000000 2024-11-14 \n",
".. ... ... \n",
"139 0.990400 2024-10-10 \n",
"140 0.250000 2024-10-10 \n",
"141 1.000000 2024-10-10 \n",
"142 0.250000 2024-10-10 \n",
"143 0.250000 2024-10-10 \n",
"\n",
"[144 rows x 9 columns]"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": []
},
{
"cell_type": "code",
"execution_count": 3,
Expand Down
6 changes: 6 additions & 0 deletions benchmarks/results/expval_2024-11-27_12-41-04.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
compiler,expval,absoluate_error,relative_error,ideal
uncompiled,4.553649124439119e-18,1.0605990171102696e-16,0.9588328094519584,1.1061355083546608e-16
ucc,-8.890457814381136e-18,1.1950400864984722e-16,1.0803740386890337,1.1061355083546608e-16
cirq,2.0143392162608187e-15,1.9037256654253525e-15,17.21060079028726,1.1061355083546608e-16
qiskit,-2.3852447794681098e-18,1.129987956149342e-16,1.0215637664775457,1.1061355083546608e-16
pytket,-3.469446951953614e-18,1.140829977874197e-16,1.0313654785127937,1.1061355083546608e-16
5 changes: 5 additions & 0 deletions benchmarks/results/gates_2024-11-27_12-52-06.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
circuit_name,compiler,compile_time,raw_multiq_gates,compiled_multiq_gates,gate_reduction_per_s,reduction_factor,compiled_ratio
random_Clifford_N10_basis_rz_rx_ry_h_cx,cirq,3.9666528701782227,618.0,565.0,0.2757501968367019,1.0938053097345133,0.9142394822006472
random_Clifford_N10_basis_rz_rx_ry_h_cx,pytket,0.02327704429626465,618.0,604.0,43.956560589233106,1.0231788079470199,0.9773462783171522
random_Clifford_N10_basis_rz_rx_ry_h_cx,qiskit,1.098642110824585,618.0,565.0,0.9955974734243153,1.0938053097345133,0.9142394822006472
random_Clifford_N10_basis_rz_rx_ry_h_cx,ucc,0.23313593864440918,618.0,565.0,4.691706118303969,1.0938053097345133,0.9142394822006472
5 changes: 5 additions & 0 deletions benchmarks/results/gates_2024-11-27_12-54-44.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
circuit_name,compiler,compile_time,raw_multiq_gates,compiled_multiq_gates,gate_reduction_per_s,reduction_factor,compiled_ratio
random_Clifford_N10_basis_rz_rx_ry_h_cx,cirq,4.199394702911377,618.0,565.0,0.2604673737803676,1.0938053097345133,0.9142394822006472
random_Clifford_N10_basis_rz_rx_ry_h_cx,pytket,0.021860122680664062,618.0,604.0,46.80572121637965,1.0231788079470199,0.9773462783171522
random_Clifford_N10_basis_rz_rx_ry_h_cx,qiskit,0.3673858642578125,618.0,565.0,2.977265638524777,1.0938053097345133,0.9142394822006472
random_Clifford_N10_basis_rz_rx_ry_h_cx,ucc,0.21868014335632324,618.0,565.0,5.0018501586229425,1.0938053097345133,0.9142394822006472
Loading