From ec999ea24f783441eea8ddea3a42916630a406f1 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Thu, 26 Sep 2024 08:48:52 +0100 Subject: [PATCH] scratch --- scratchpads/ak2.ipynb | 80 +++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/scratchpads/ak2.ipynb b/scratchpads/ak2.ipynb index dcb5c0e3..ff0680a8 100644 --- a/scratchpads/ak2.ipynb +++ b/scratchpads/ak2.ipynb @@ -22,7 +22,7 @@ { "cell_type": "code", "execution_count": 2, - "id": "4f030a0a", + "id": "abb9cd7f", "metadata": {}, "outputs": [ { @@ -49,7 +49,7 @@ { "cell_type": "code", "execution_count": 3, - "id": "b19c5271", + "id": "b29c0dc8", "metadata": {}, "outputs": [], "source": [ @@ -62,21 +62,21 @@ }, { "cell_type": "code", - "execution_count": 13, - "id": "ccf76e80", + "execution_count": 4, + "id": "a8f60750", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "496\n", + "559\n", "True\n" ] } ], "source": [ - "c = zx.generate.qft(32) #zx.Circuit.load('../circuits/QFT_and_Adders/QFT32_before')\n", + "c = zx.Circuit.load('../circuits/QFT_and_Adders/QFTAdd16_before')\n", "g = c.to_graph()\n", "zx.full_reduce(g)\n", "print(g.num_edges() - g.num_vertices() + g.num_outputs())\n", @@ -85,14 +85,14 @@ }, { "cell_type": "code", - "execution_count": 14, - "id": "90d49c61", + "execution_count": 5, + "id": "aeb06e7f", "metadata": {}, "outputs": [ { "data": { "text/html": [ - "
\n", + "
\n", "" ], @@ -442,8 +442,8 @@ }, { "cell_type": "code", - "execution_count": 15, - "id": "cb5cf517", + "execution_count": 7, + "id": "d9a8bce2", "metadata": {}, "outputs": [], "source": [ @@ -473,18 +473,18 @@ }, { "cell_type": "code", - "execution_count": 16, - "id": "783574b6", + "execution_count": 8, + "id": "79b1ddf4", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Circuit on 32 qubits with 2512 gates.\n", - " 1488 is the T-count\n", - " 1024 Cliffords among which\n", - " 992 2-qubit gates (992 CNOT, 0 other) and\n", + "Circuit QFTAdd16_before on 32 qubits with 1822 gates.\n", + " 1026 is the T-count\n", + " 796 Cliffords among which\n", + " 716 2-qubit gates (716 CNOT, 0 other) and\n", " 32 Hadamard gates.\n" ] } @@ -495,7 +495,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 9, "id": "44aad5a9", "metadata": {}, "outputs": [ @@ -504,11 +504,11 @@ "output_type": "stream", "text": [ "extracting circuit...\n", - "Circuit on 32 qubits with 2818 gates.\n", - " 558 is the T-count\n", - " 2260 Cliffords among which\n", - " 1174 2-qubit gates (909 CNOT, 265 other) and\n", - " 1086 Hadamard gates.\n" + "Circuit on 32 qubits with 2142 gates.\n", + " 402 is the T-count\n", + " 1740 Cliffords among which\n", + " 964 2-qubit gates (613 CNOT, 351 other) and\n", + " 776 Hadamard gates.\n" ] } ], @@ -524,8 +524,8 @@ }, { "cell_type": "code", - "execution_count": 19, - "id": "976f071e", + "execution_count": 41, + "id": "c5e37ac3", "metadata": { "scrolled": false }, @@ -535,17 +535,17 @@ "output_type": "stream", "text": [ "extracting circuit...\n", - "Circuit on 32 qubits with 928 gates.\n", - " 180 is the T-count\n", - " 748 Cliffords among which\n", - " 418 2-qubit gates (110 CNOT, 308 other) and\n", - " 330 Hadamard gates.\n" + "Circuit on 32 qubits with 2142 gates.\n", + " 402 is the T-count\n", + " 1740 Cliffords among which\n", + " 964 2-qubit gates (613 CNOT, 351 other) and\n", + " 776 Hadamard gates.\n" ] } ], "source": [ "g1 = c.to_graph()\n", - "squash_reduce(g1, err_budget=0.01, quiet=True)\n", + "squash_reduce(g1, err_budget=2**-15)\n", "print(\"extracting circuit...\")\n", "c1 = zx.extract_circuit(g1, up_to_perm=True)\n", "zx.basic_optimization(c1)\n", @@ -555,8 +555,8 @@ }, { "cell_type": "code", - "execution_count": 20, - "id": "29239690", + "execution_count": 10, + "id": "1c955dc6", "metadata": { "scrolled": false }, @@ -566,11 +566,11 @@ "output_type": "stream", "text": [ "extracting circuit...\n", - "Circuit on 32 qubits with 311 gates.\n", - " 93 is the T-count\n", - " 218 Cliffords among which\n", - " 62 2-qubit gates (0 CNOT, 62 other) and\n", - " 156 Hadamard gates.\n" + "Circuit on 32 qubits with 680 gates.\n", + " 122 is the T-count\n", + " 558 Cliffords among which\n", + " 308 2-qubit gates (121 CNOT, 187 other) and\n", + " 244 Hadamard gates.\n" ] } ],