Skip to content

Commit 482fb05

Browse files
committed
importするより前にRZGateを使っていたのを修正
1 parent 9700ae3 commit 482fb05

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

doc/source/notebooks/02_01_basics.ipynb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@
338338
"outputs": [],
339339
"source": [
340340
"import pygridsynth\n",
341-
"from qiskit.circuit.library import HGate\n",
341+
"from qiskit.circuit.library import HGate, RZGate\n",
342342
"# generate string consisting of {T,H,S,W} which corresponds to Rz(theta) with precision epsilon\n",
343343
"# W corresponds to global phase shift of pi/4\n",
344344
"theta = np.random.rand()\n",
@@ -358,7 +358,6 @@
358358
"unitary = get_unitary_from_circuit(qc)\n",
359359
"print(\"error: \", np.linalg.norm(get_unitary_from_circuit(qc) - RZGate(theta).to_matrix()))\n",
360360
"display_complex_matrix(get_unitary_from_circuit(qc), title=\"Unitary of circuit\")\n",
361-
"from qiskit.circuit.library import RZGate\n",
362361
"display_complex_matrix(RZGate(theta).to_matrix(), title=\"Exact Rz\")"
363362
]
364363
},

0 commit comments

Comments
 (0)