質問編集履歴
3
情報の追加
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
___ got an unexpected keyword argumentの
|
1
|
+
___ got an unexpected keyword argument のエラーの解消
|
test
CHANGED
@@ -4,6 +4,10 @@
|
|
4
4
|
|
5
5
|
PythonのQiskitで論文(https://iopscience.iop.org/article/10.1088/2058-9565/aba404/meta)の再現をしていたところ、何やら論文の関数(cr_pulse_utils.pyの中のcr_designer関数)とqiskitの方の関数(qiskit.schedule)で齟齬が起きているようです。
|
6
6
|
|
7
|
+
論文で使用されたソースコードは(https://doi.org/10.5281/zenodo.3751565)で公開されています。
|
8
|
+
|
9
|
+
|
10
|
+
|
7
11
|
Errorを解決したいです。
|
8
12
|
|
9
13
|
自分はかなりprograming初学者で、必要な情報がここに詰められているかも怪しいので、足りない情報があればリクエストお願いします泣
|
2
情報の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
-
PythonのQiskitで論文の再現をしていたところ、何やら論文
|
5
|
+
PythonのQiskitで論文(https://iopscience.iop.org/article/10.1088/2058-9565/aba404/meta)の再現をしていたところ、何やら論文の関数(cr_pulse_utils.pyの中のcr_designer関数)とqiskitの方の関数(qiskit.schedule)で齟齬が起きているようです。
|
6
6
|
|
7
7
|
Errorを解決したいです。
|
8
8
|
|
@@ -60,6 +60,192 @@
|
|
60
60
|
|
61
61
|
```Python
|
62
62
|
|
63
|
+
from copy import deepcopy
|
64
|
+
|
65
|
+
from functools import partial
|
66
|
+
|
67
|
+
import numpy as np
|
68
|
+
|
69
|
+
import matplotlib.pyplot as plt
|
70
|
+
|
71
|
+
import multiprocessing as mp
|
72
|
+
|
73
|
+
import pickle
|
74
|
+
|
75
|
+
import pprint
|
76
|
+
|
77
|
+
import scipy.optimize as opt
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
from qiskit import pulse, transpile, assemble, schedule, IBMQ, quantum_info as qi
|
82
|
+
|
83
|
+
from qiskit.pulse import library as pulse_lib
|
84
|
+
|
85
|
+
from qiskit.pulse.reschedule import align_measures
|
86
|
+
|
87
|
+
from qiskit.ignis.verification import randomized_benchmarking as rb
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
import qiskit
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
# utility for pulse schedule generation
|
96
|
+
|
97
|
+
from MyPythonLibrary.cr_pulse_utils import create_cr_circuit, var_amp, var_phi
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
# utility for quantum process tomography
|
102
|
+
|
103
|
+
from MyPythonLibrary.qpt_utils import create_qpt_experiment, extract_choi_matrix
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
# utility for randomized benchmarking
|
108
|
+
|
109
|
+
from MyPythonLibrary.rb_utils import create_rb_experiment, cache_circuit
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
# utility for analysis
|
114
|
+
|
115
|
+
from MyPythonLibrary.analysis_utils import (cr_3rd_order_perturbation, local_fidelity_optimization,
|
116
|
+
|
117
|
+
optimize_circuit, expectation_val, hamiltonian_reconstruction,
|
118
|
+
|
119
|
+
plot_quantum_channel, ExperimentRunner)
|
120
|
+
|
121
|
+
from google.colab import drive
|
122
|
+
|
123
|
+
drive.mount('/content/drive')
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
# use cache data
|
128
|
+
|
129
|
+
use_cache = True
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
# data data_directory
|
134
|
+
|
135
|
+
data_dir = './data/custom_cnot_experiments'
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
account_provider = IBMQ.load_account()
|
140
|
+
|
141
|
+
hub = 'ibm-q'
|
142
|
+
|
143
|
+
group = 'open'
|
144
|
+
|
145
|
+
project = 'main'
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
# target backend
|
150
|
+
|
151
|
+
backend_name = 'ibmq_manila'
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
provider = IBMQ.get_provider(group = group)
|
156
|
+
|
157
|
+
backend = provider.get_backend(backend_name)
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
########################
|
162
|
+
|
163
|
+
# #
|
164
|
+
|
165
|
+
# Setup of experiments #
|
166
|
+
|
167
|
+
# #
|
168
|
+
|
169
|
+
########################
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
# control qubit index
|
174
|
+
|
175
|
+
control = 1
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
# target qubit index
|
180
|
+
|
181
|
+
target = 0
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
# control channel index
|
186
|
+
|
187
|
+
u_index = 1
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
# maximum cross resonance amplitude in this experiment
|
192
|
+
|
193
|
+
max_cr_amplitude = 0.35
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
# sample number restriction
|
198
|
+
|
199
|
+
alignment = 16
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
# initial cross resonance pulse parameters
|
204
|
+
|
205
|
+
cr_params = {'duration': 53 * alignment, 'amp': var_amp, 'phi': var_phi,
|
206
|
+
|
207
|
+
'sigma': 2 * alignment, 'risefall': 4 * alignment}
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
# backend information
|
212
|
+
|
213
|
+
config = backend.configuration()
|
214
|
+
|
215
|
+
defaults = backend.defaults()
|
216
|
+
|
217
|
+
properties = backend.properties()
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
# sorted list of qubits used in the experiments
|
222
|
+
|
223
|
+
cr_qubits = sorted([control, target])
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
# quantum registers for handling abstracted schedule
|
228
|
+
|
229
|
+
qregs = qiskit.QuantumRegister(config.n_qubits)
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
# channels for visualization
|
234
|
+
|
235
|
+
channels = [pulse.DriveChannel(control), pulse.DriveChannel(target), pulse.ControlChannel(u_index)]
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
shots = 1024
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
# create QuantumCircuit layer abstraction of CR pulse schedule.
|
244
|
+
|
245
|
+
# this technique is useful to incorporate pulse schedule with circuit instruction to
|
246
|
+
|
247
|
+
# program complicated calibration sequence while keeping context of operation.
|
248
|
+
|
63
249
|
cr_cal_circ, ext_inst_map, ext_basis_gates = create_cr_circuit(
|
64
250
|
|
65
251
|
cross_resonance_params=cr_params,
|
@@ -78,8 +264,6 @@
|
|
78
264
|
|
79
265
|
use_echo=True)
|
80
266
|
|
81
|
-
|
82
|
-
|
83
267
|
cr_amps = np.linspace(-max_cr_amplitude, max_cr_amplitude, 20)
|
84
268
|
|
85
269
|
|
@@ -106,7 +290,11 @@
|
|
106
290
|
|
107
291
|
transpiled_circuits = transpile(cr_rabi_circs, backend, basis_gates=ext_basis_gates, optimization_level=0)
|
108
292
|
|
109
|
-
scheds = schedule(transpiled_circuits, backend,ext_inst_map)#ここです
|
293
|
+
scheds = schedule(transpiled_circuits, backend,ext_inst_map)##ここです
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
qobj_1_1 = assemble(scheds, backend, meas_level=2, shots=shots)
|
110
298
|
|
111
299
|
```
|
112
300
|
|
@@ -245,9 +433,3 @@
|
|
245
433
|
```
|
246
434
|
|
247
435
|
get関数の一番下のソースコードを見るとfunctionに**argを入れているが、cr_designer関数の引数は*argなので悪さが起こっているのかと思って色々試してみたが、知識不足が祟ってerrorが増えるだけだった。
|
248
|
-
|
249
|
-
### 補足情報(FW/ツールのバージョンなど)
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
ここにより詳細な情報を記載してください。
|
1
情報を付け足した。
test
CHANGED
File without changes
|
test
CHANGED
@@ -6,6 +6,8 @@
|
|
6
6
|
|
7
7
|
Errorを解決したいです。
|
8
8
|
|
9
|
+
自分はかなりprograming初学者で、必要な情報がここに詰められているかも怪しいので、足りない情報があればリクエストお願いします泣
|
10
|
+
|
9
11
|
### 発生している問題・エラーメッセージ
|
10
12
|
|
11
13
|
|