|
26 | 26 | "\n", |
27 | 27 | "The state vector representation implies an exponential size representation, regardless of the actual circuit. Every quantum gate operating on this representation requires exponential time and memory.\n", |
28 | 28 | "\n", |
29 | | - "The matrix product state (MPS) reprentation offers a local representation, such that:\n", |
30 | | - "$c_{i_1 \\ldots i_n} = \\Gamma^{[1]} \\lambda^{[1]} \\Gamma^{[2]} \\lambda^{[2]}\\ldots \\Gamma^{[1]} \\lambda^{[n-1]} \\Gamma^{[n]} $.\n" |
| 29 | + "The matrix product state (MPS) representation offers a local representation, in the form:\n", |
| 30 | + "$\\Gamma^{[1]} \\lambda^{[1]} \\Gamma^{[2]} \\lambda^{[2]}\\ldots \\Gamma^{[1]} \\lambda^{[n-1]} \\Gamma^{[n]}$, such that all the information contained in the $c_{i_1 \\ldots i_n}$, can be generated out of the MPS representation..\n" |
31 | 31 | ] |
32 | 32 | }, |
33 | 33 | { |
|
36 | 36 | "source": [ |
37 | 37 | "Every $\\Gamma^{[i]}$ is a tensor of complex numbers that represents qubit $i$. Every $\\lambda^{[i]}$ is a matrix of real numbers that is used to normalize the amplitudes of qubits $i$ and $i+1$. Single-qubit gates operate only on the relevant tensor. \n", |
38 | 38 | "\n", |
39 | | - "Two-qubit gates operate on consecutive qubits $i$ and $i+1$. This involves a contract operation over $\\lambda^{[i-1]}$, $\\Gamma^{[i-1]}$, $\\lambda^{[i]}$, $\\Gamma^{[i+1]}$ and $\\lambda^{[i+1]}$, that creates a single tensor. We apply the gate to this tensor, and then decompose back to the original structure. However this operation may increase the size of the respective tensors. Gates that involve two qubits that are not consecutive, require a series of swap gates to bring the two qubits next to each other and then the reverse swaps. \n", |
| 39 | + "Two-qubit gates operate on consecutive qubits $i$ and $i+1$. This involves a tensor-contract operation over $\\lambda^{[i-1]}$, $\\Gamma^{[i-1]}$, $\\lambda^{[i]}$, $\\Gamma^{[i+1]}$ and $\\lambda^{[i+1]}$, that creates a single tensor. We apply the gate to this tensor, and then decompose back to the original structure. This operation may increase the size of the respective tensors. Gates that involve two qubits that are not consecutive, require a series of swap gates to bring the two qubits next to each other and then the reverse swaps. \n", |
40 | 40 | "\n", |
41 | 41 | "In the worst case, the tensors may grow exponentially. However, the size of the overall structure remains 'small' for circuits that do not have 'many' two-qubit gates. This allows much more efficient operations in circuits with relatively 'low' entanglement. Characterizing when to use this method over other methods is a subject of current research." |
42 | 42 | ] |
|
61 | 61 | "name": "stdout", |
62 | 62 | "output_type": "stream", |
63 | 63 | "text": [ |
64 | | - "{'11': 503, '00': 521}\n" |
| 64 | + "{'10': 517, '01': 507}\n" |
65 | 65 | ] |
66 | 66 | } |
67 | 67 | ], |
|
154 | 154 | "name": "stdout", |
155 | 155 | "output_type": "stream", |
156 | 156 | "text": [ |
157 | | - "{'11': 523, '00': 501}\n" |
| 157 | + "{'10': 529, '01': 495}\n" |
158 | 158 | ] |
159 | 159 | } |
160 | 160 | ], |
|
182 | 182 | "name": "stdout", |
183 | 183 | "output_type": "stream", |
184 | 184 | "text": [ |
185 | | - "{'11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111': 516, '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000': 508}\n", |
186 | | - "Time was 39.75238084793091 s\n" |
| 185 | + "{'00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000': 518, '11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111': 506}\n", |
| 186 | + "Time was 38.062061071395874 s\n" |
187 | 187 | ] |
188 | 188 | } |
189 | 189 | ], |
|
195 | 195 | "\n", |
196 | 196 | "# Create EPR state\n", |
197 | 197 | "circ.h(qr[0])\n", |
198 | | - "for i in range (1,num_qubits):\n", |
199 | | - " circ.cx(qr[0], qr[i])\n", |
| 198 | + "for i in range (0,num_qubits-1):\n", |
| 199 | + " circ.cx(qr[i], qr[i+1])\n", |
200 | 200 | "\n", |
201 | 201 | "# Measure\n", |
202 | 202 | "circ.measure(qr, cr)\n", |
|
206 | 206 | "print(result.get_counts())\n", |
207 | 207 | "print(\"Time was {} s\".format(result.time_taken))" |
208 | 208 | ] |
209 | | - }, |
210 | | - { |
211 | | - "cell_type": "code", |
212 | | - "execution_count": null, |
213 | | - "metadata": {}, |
214 | | - "outputs": [], |
215 | | - "source": [] |
216 | 209 | } |
217 | 210 | ], |
218 | 211 | "metadata": { |
|
0 commit comments