Skip to content
This repository was archived by the owner on Aug 21, 2023. It is now read-only.

Commit 52219f2

Browse files
committed
cosmetic changes
1 parent 77217b6 commit 52219f2

1 file changed

Lines changed: 9 additions & 16 deletions

File tree

qiskit/aer/matrix_product_state_method.ipynb

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
"\n",
2727
"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",
2828
"\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"
3131
]
3232
},
3333
{
@@ -36,7 +36,7 @@
3636
"source": [
3737
"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",
3838
"\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",
4040
"\n",
4141
"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."
4242
]
@@ -61,7 +61,7 @@
6161
"name": "stdout",
6262
"output_type": "stream",
6363
"text": [
64-
"{'11': 503, '00': 521}\n"
64+
"{'10': 517, '01': 507}\n"
6565
]
6666
}
6767
],
@@ -154,7 +154,7 @@
154154
"name": "stdout",
155155
"output_type": "stream",
156156
"text": [
157-
"{'11': 523, '00': 501}\n"
157+
"{'10': 529, '01': 495}\n"
158158
]
159159
}
160160
],
@@ -182,8 +182,8 @@
182182
"name": "stdout",
183183
"output_type": "stream",
184184
"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"
187187
]
188188
}
189189
],
@@ -195,8 +195,8 @@
195195
"\n",
196196
"# Create EPR state\n",
197197
"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",
200200
"\n",
201201
"# Measure\n",
202202
"circ.measure(qr, cr)\n",
@@ -206,13 +206,6 @@
206206
"print(result.get_counts())\n",
207207
"print(\"Time was {} s\".format(result.time_taken))"
208208
]
209-
},
210-
{
211-
"cell_type": "code",
212-
"execution_count": null,
213-
"metadata": {},
214-
"outputs": [],
215-
"source": []
216209
}
217210
],
218211
"metadata": {

0 commit comments

Comments
 (0)