|
83 | 83 | "import math\n", |
84 | 84 | "import numpy as np\n", |
85 | 85 | "from qiskit.quantum_info.random import random_unitary \n", |
86 | | - "from qiskit.quantum_info.synthesis import two_qubit_kak" |
| 86 | + "from qiskit.quantum_info.synthesis import two_qubit_cnot_decompose" |
87 | 87 | ] |
88 | 88 | }, |
89 | 89 | { |
|
128 | 128 | " for k in range(math.floor(width/2)):\n", |
129 | 129 | " qubits = [int(perm[2*k]), int(perm[2*k+1])]\n", |
130 | 130 | " U = random_unitary(4) \n", |
131 | | - " for gate in two_qubit_kak(U):\n", |
| 131 | + " for gate in two_qubit_cnot_decompose(U):\n", |
132 | 132 | " gate_name = gate[0].name\n", |
133 | 133 | " gate_params = gate[0].params\n", |
134 | 134 | " # The first qubit argument used in gate\n", |
135 | | - " i0 = qubits[gate[1][0][1]]\n", |
| 135 | + " i0 = qubits[gate[1][0].index]\n", |
136 | 136 | " if gate_name == \"cx\":\n", |
137 | 137 | " # The second qubit argument used in gate\n", |
138 | | - " i1 = qubits[gate[1][1][1]]\n", |
| 138 | + " i1 = qubits[gate[1][1].index]\n", |
139 | 139 | " qc.cx(q[i0], q[i1])\n", |
140 | 140 | " elif gate_name == \"u1\":\n", |
141 | 141 | " qc.u1(gate_params[2], q[i0])\n", |
|
204 | 204 | "HTMLProgressBar()\n", |
205 | 205 | "parallel_map(build_qv_circuit, np.arange(num_circuits), task_args=(seeds, width, depth));" |
206 | 206 | ] |
207 | | - }, |
208 | | - { |
209 | | - "cell_type": "code", |
210 | | - "execution_count": null, |
211 | | - "metadata": {}, |
212 | | - "outputs": [], |
213 | | - "source": [] |
214 | 207 | } |
215 | 208 | ], |
216 | 209 | "metadata": { |
|
230 | 223 | "name": "python", |
231 | 224 | "nbconvert_exporter": "python", |
232 | 225 | "pygments_lexer": "ipython3", |
233 | | - "version": "3.7.3" |
| 226 | + "version": "3.7.4" |
234 | 227 | }, |
235 | 228 | "varInspector": { |
236 | 229 | "cols": { |
|
0 commit comments