@@ -238,21 +238,24 @@ supports can be set:
238
238
239
239
exp.set_run_options(shots=1000,
240
240
meas_level=MeasLevel.CLASSIFIED)
241
+ print(f"Shots set to {exp.run_options.get('shots')}, "
242
+ "measurement level set to {exp.run_options.get('meas_level')}")
241
243
242
244
Consult the documentation of the run method of your
243
245
specific backend type for valid options.
244
246
For example, see :meth: `qiskit_ibm_provider.IBMBackend.run ` for IBM backends.
245
247
246
248
Transpile options
247
249
-----------------
248
- These options are passed to the Terra transpiler to transpile the experiment circuits
250
+ These options are passed to the Qiskit :mod: ` ~qiskit. transpiler` to transpile the experiment circuits
249
251
before execution:
250
252
251
253
.. jupyter-execute ::
252
254
253
255
exp.set_transpile_options(scheduling_method='asap',
254
256
optimization_level=3,
255
257
basis_gates=["x", "sx", "rz"])
258
+ print(f"Transpile options are {exp.transpile_options}")
256
259
257
260
Consult the documentation of :func: `qiskit.compiler.transpile ` for valid options.
258
261
@@ -267,14 +270,15 @@ upon experiment instantiation, but can also be explicitly set via
267
270
exp = T1(physical_qubits=(0,), delays=delays)
268
271
new_delays=np.arange(1e-6, 600e-6, 50e-6)
269
272
exp.set_experiment_options(delays=new_delays)
273
+ print(f"Experiment options are {exp.experiment_options}")
270
274
271
275
Consult the :doc: `API documentation </apidocs/index >` for the options of each experiment
272
276
class.
273
277
274
278
Analysis options
275
279
----------------
276
280
277
- These options are unique to each analysis class. Unlike the other options, analyis
281
+ These options are unique to each analysis class. Unlike the other options, analysis
278
282
options are not directly set via the experiment object but use instead a method of the
279
283
associated ``analysis ``:
280
284
@@ -295,7 +299,7 @@ Running experiments on multiple qubits
295
299
======================================
296
300
297
301
To run experiments across many qubits of the same device, we use **composite
298
- experiments **. A composite experiment is a parent object that contains one or more child
302
+ experiments **. A :class: ` .CompositeExperiment ` is a parent object that contains one or more child
299
303
experiments, which may themselves be composite. There are two core types of composite
300
304
experiments:
301
305
@@ -323,7 +327,7 @@ Note that when the transpile and run options are set for a composite experiment,
323
327
child experiments's options are also set to the same options recursively. Let's examine
324
328
how the parallel experiment is constructed by visualizing child and parent circuits. The
325
329
child experiments can be accessed via the
326
- :meth: `~.ParallelExperiment .component_experiment ` method, which indexes from zero:
330
+ :meth: `~.CompositeExperiment .component_experiment ` method, which indexes from zero:
327
331
328
332
.. jupyter-execute ::
329
333
@@ -333,6 +337,16 @@ child experiments can be accessed via the
333
337
334
338
parallel_exp.component_experiment(1).circuits()[0].draw(output='mpl')
335
339
340
+ Similarly, the child analyses can be accessed via :meth: `.CompositeAnalysis.component_analysis ` or via
341
+ the analysis of the child experiment class:
342
+
343
+ .. jupyter-execute ::
344
+
345
+ parallel_exp.component_experiment(0).analysis.set_options(plot = True)
346
+
347
+ # This should print out what we set because it's the same option
348
+ print(parallel_exp.analysis.component_analysis(0).options.get("plot"))
349
+
336
350
The circuits of all experiments assume they're acting on virtual qubits starting from
337
351
index 0. In the case of a parallel experiment, the child experiment
338
352
circuits are composed together and then reassigned virtual qubit indices:
@@ -393,4 +407,17 @@ into one level:
393
407
parallel_data = parallel_exp.run(backend, seed_simulator=101).block_for_results()
394
408
395
409
for result in parallel_data.analysis_results():
396
- print(result)
410
+ print(result)
411
+
412
+ Broadcasting analysis options to child experiments
413
+ --------------------------------------------------
414
+
415
+ Use the `broadcast ` parameter to set analysis options to each of the child experiments.
416
+
417
+ .. jupyter-execute ::
418
+
419
+ parallel_exp.analysis.set_options(plot=False, broadcast=True)
420
+
421
+ If the child experiment inherits from :class: `.CompositeExperiment ` (such as :class: `.ParallelExperiment `
422
+ and :class: `.BatchExperiment ` classes), this process will continue to work recursively.
423
+ In this instance, the analysis will not generate a figure for the child experiment after the analysis.
0 commit comments