Skip to content

Commit 9ed8376

Browse files
committed
Fixed operator call
1 parent a2caccb commit 9ed8376

File tree

2 files changed

+35
-39
lines changed

2 files changed

+35
-39
lines changed

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
__pycache__/
3+
.cache/
4+
5+
.ipynb_checkpoints/
6+
7+
Qconfig.py
8+
9+
# editor files
10+
.vscode/
11+
.idea/
12+
13+
# Distribution / packaging
14+
*.egg-info/
15+
16+
# Spyder project settings
17+
.spyderproject
18+
.spyproject
19+
20+
.DS_Store

aqua/algorithm_introduction_with_vqe.ipynb

Lines changed: 15 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
},
2626
{
2727
"cell_type": "code",
28-
"execution_count": 13,
28+
"execution_count": 1,
2929
"metadata": {},
3030
"outputs": [],
3131
"source": [
32-
"from qiskit.aqua import Operator"
32+
"from qiskit.aqua.operators import WeightedPauliOperator"
3333
]
3434
},
3535
{
@@ -43,7 +43,7 @@
4343
},
4444
{
4545
"cell_type": "code",
46-
"execution_count": 14,
46+
"execution_count": 2,
4747
"metadata": {},
4848
"outputs": [],
4949
"source": [
@@ -56,7 +56,7 @@
5656
" ]\n",
5757
"}\n",
5858
"\n",
59-
"qubit_op = Operator.load_from_dict(pauli_dict)"
59+
"qubit_op = WeightedPauliOperator.from_dict(pauli_dict)"
6060
]
6161
},
6262
{
@@ -74,14 +74,14 @@
7474
},
7575
{
7676
"cell_type": "code",
77-
"execution_count": 15,
77+
"execution_count": 3,
7878
"metadata": {},
7979
"outputs": [
8080
{
8181
"name": "stdout",
8282
"output_type": "stream",
8383
"text": [
84-
"-1.857275030202378\n"
84+
"-1.8572750302023797\n"
8585
]
8686
}
8787
],
@@ -106,14 +106,14 @@
106106
},
107107
{
108108
"cell_type": "code",
109-
"execution_count": 17,
109+
"execution_count": 4,
110110
"metadata": {},
111111
"outputs": [
112112
{
113113
"name": "stdout",
114114
"output_type": "stream",
115115
"text": [
116-
"-1.8572750302023808\n"
116+
"-1.8572750302023813\n"
117117
]
118118
}
119119
],
@@ -149,19 +149,11 @@
149149
},
150150
{
151151
"cell_type": "code",
152-
"execution_count": 22,
152+
"execution_count": null,
153153
"metadata": {
154154
"scrolled": true
155155
},
156-
"outputs": [
157-
{
158-
"name": "stdout",
159-
"output_type": "stream",
160-
"text": [
161-
"-1.8572750302012253\n"
162-
]
163-
}
164-
],
156+
"outputs": [],
165157
"source": [
166158
"aqua_cfg_dict = {\n",
167159
" 'algorithm': {\n",
@@ -199,17 +191,9 @@
199191
},
200192
{
201193
"cell_type": "code",
202-
"execution_count": 29,
194+
"execution_count": null,
203195
"metadata": {},
204-
"outputs": [
205-
{
206-
"name": "stdout",
207-
"output_type": "stream",
208-
"text": [
209-
"-1.8572750301886618\n"
210-
]
211-
}
212-
],
196+
"outputs": [],
213197
"source": [
214198
"from qiskit import BasicAer\n",
215199
"from qiskit.aqua.algorithms import VQE\n",
@@ -233,17 +217,9 @@
233217
},
234218
{
235219
"cell_type": "code",
236-
"execution_count": 31,
220+
"execution_count": null,
237221
"metadata": {},
238-
"outputs": [
239-
{
240-
"name": "stdout",
241-
"output_type": "stream",
242-
"text": [
243-
"-1.8572750302012366\n"
244-
]
245-
}
246-
],
222+
"outputs": [],
247223
"source": [
248224
"from qiskit.aqua import QuantumInstance\n",
249225
"from qiskit.transpiler import PassManager\n",
@@ -290,7 +266,7 @@
290266
"name": "python",
291267
"nbconvert_exporter": "python",
292268
"pygments_lexer": "ipython3",
293-
"version": "3.6.1"
269+
"version": "3.6.8"
294270
}
295271
},
296272
"nbformat": 4,

0 commit comments

Comments
 (0)