forked from sola-st/MorphQ-Quantum-Qiskit-Testing-ICSE-23
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qmt_v52.yaml
633 lines (605 loc) · 14.1 KB
/
qmt_v52.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
# Run the Quantum Metamorphic Testing (QDiff re-implementation)
# This file can enable the concatenation of these metamorphic relationships:
# - Qdiff G1 SwapToCnot
# - Qdiff G2 TwoHToId
# - Qdiff G3 XToHSSH
# - Qdiff G4 ZtoSS
# - Qdiff G5 CZtoHCnotH
# - Qdiff G6 TwoCzToId
# - Qdiff G7 CCNOTDecomposition
# Then it concatenates a differential testing setup
# - change_backend
# - change_opt_level
# all gates used unless deprecated
version: 52
# FOLDER ORGANIZATION
experiment_folder: data/qmt_v52/
# SUBFOLDER STRUCTURE
folder_structure:
programs:
metadata: null
metadata_exec: null
source: null
followup: null
coverage_reports: null
# COVERAGE SETTINGS
track_coverage: true
coverage_settings_filepath: config/qmt_v52.cover
programs_between_coverage_checkpoints_start: 64
programs_between_coverage_checkpoints_cap: 1000
# EXECUTION
strategy_sample_size_estimation: qdiff # qdiff | null
fixed_sample_size: 8192
# SAMPLE SIZE ESTIMATION PARAMETERS
qdiff_user_defined_threshold: 0.1
qdiff_confidence_level: 0.66666
# DIVERGENCE THRESHOLD
divergence_threshold_method: bh # holm | bonferroni | bh
divergence_alpha_level: 0.05
divergence_primary_test: ks
# DETECTORS
detectors:
- name: ks
test_long_name: Kolmogorov–Smirnov Test
detector_object: KS_Detector
# GENERATION STRATEGY
generation_strategy:
name: QiskitFuzzer
generator_object: QiskitFuzzer
random_seed: 42
min_n_qubits: 2 # at least 1
max_n_qubits: 11
min_n_ops: 0
max_n_ops: 30
backends:
- qasm_simulator
gate_set_dropout: 0.5
optimizations_dropout: 0.2
optimization_levels:
- 0
- 1
- 2
- 3
optimizations: []
gate_set:
- name: C3XGate
n_bits: 4
n_params: 1
shortname: mcx
- name: C3SXGate
n_bits: 4
n_params: 0
- name: C4XGate
n_bits: 5
n_params: 0
shortname: mcx
- name: CCXGate
n_bits: 3
n_params: 0
shortname: ccx
- name: DCXGate
n_bits: 2
n_params: 0
shortname: dcx
- name: CHGate
n_bits: 2
n_params: 0
shortname: ch
- name: CPhaseGate
n_bits: 2
n_params: 1
shortname: cp
- name: CRXGate
n_bits: 2
n_params: 1
shortname: crx
- name: CRYGate
n_bits: 2
n_params: 1
shortname: cry
- name: CRZGate
n_bits: 2
n_params: 1
shortname: crz
- name: CSwapGate
n_bits: 3
n_params: 0
shortname: cswap
- name: CSXGate
n_bits: 2
n_params: 0
shortname: csx
- name: CUGate
n_bits: 2
n_params: 4
shortname: cu
- name: CU1Gate
n_bits: 2
n_params: 1
shortname: cu1
- name: CU3Gate
n_bits: 2
n_params: 3
shortname: cu3
- name: CXGate
n_bits: 2
n_params: 0
shortname: cx
- name: CYGate
n_bits: 2
n_params: 0
- name: CZGate
n_bits: 2
n_params: 0
shortname: cz
- name: HGate
n_bits: 1
n_params: 0
shortname: h
- name: IGate
n_bits: 1
n_params: 0
shortname: id
- name: PhaseGate
n_bits: 1
n_params: 1
shortname: p
- name: RCCXGate
n_bits: 3
n_params: 0
shortname: rccx
- name: RC3XGate
n_bits: 4
n_params: 0
shortname: rcccx
- name: RXGate
n_bits: 1
n_params: 1
shortname: rx
- name: RXXGate
n_bits: 2
n_params: 1
shortname: rxx
- name: RYGate
n_bits: 1
n_params: 1
shortname: ry
- name: RYYGate
n_bits: 2
n_params: 1
shortname: ryy
- name: RZGate
n_bits: 1
n_params: 1
shortname: rz
- name: RZZGate
n_bits: 2
n_params: 1
shortname: rzz
- name: RZXGate
n_bits: 2
n_params: 1
shortname: rzx
- name: ECRGate
n_bits: 2
n_params: 0
shortname: ecr
- name: SGate
n_bits: 1
n_params: 0
shortname: s
- name: SdgGate
n_bits: 1
n_params: 0
shortname: sdg
- name: SwapGate
n_bits: 2
n_params: 0
shortname: swap
- name: iSwapGate
n_bits: 2
n_params: 0
shortname: iswap
- name: SXGate
n_bits: 1
n_params: 0
shortname: sx
- name: SXdgGate
n_bits: 1
n_params: 0
shortname: sxdg
- name: TGate
n_bits: 1
n_params: 0
shortname: t
- name: TdgGate
n_bits: 1
n_params: 0
shortname: tdg
- name: UGate
n_bits: 1
n_params: 3
shortname: u
- name: U1Gate
n_bits: 1
n_params: 1
shortname: u1
- name: U2Gate
n_bits: 1
n_params: 2
shortname: u2
- name: U3Gate
n_bits: 1
n_params: 3
shortname: u3
- name: XGate
n_bits: 1
n_params: 0
shortname: x
- name: YGate
n_bits: 1
n_params: 0
shortname: y
- name: ZGate
n_bits: 1
n_params: 0
shortname: z
# DEPRECATED
#- name: MSGate
# n_bits: 0
# n_params: 0
# ADVANCED - N-bits
#- name: MCPhaseGate
# n_bits: 0
# n_params: 0
# NOT IN DOC: https://qiskit.org/documentation/apidoc/circuit_library.html
#- name: XYGate
# n_bits:
# n_params: 0
# METAMORPH PIPELINE:
pipeline:
max_transformations_per_program: 1
# METAMORPH RELATIONSHIPS
# The following keys in the metamorphic strategies field refer to class names.
transformation_mode: qdiff # qdiff | morphq
qdiff_metamorphic_strategies:
QdiffG1SwapToCnot:
min_to_change: 1
max_to_change: 1
QdiffG2TwoHToId:
add_identity_matrix: true
QdiffG3XToHSSH:
min_to_change: 1
max_to_change: 1
QdiffG4ZtoSS:
min_to_change: 1
max_to_change: 1
QdiffG5CZtoHCnotH:
min_to_change: 1
max_to_change: 1
QdiffG6TwoCzToId:
add_identity_matrix: true
QdiffG7CCNOTDecomposition:
min_to_change: 1
max_to_change: 1
qdiff_diff_testing:
ChangeOptLevel:
levels:
- 0
- 1
- 2
- 3
ChangeBackend:
available_backends:
- aer_simulator
- aer_simulator_statevector
# - aer_simulator_statevector_gpu # cannot run GPU in multithreading
- statevector_simulator
- aer_simulator_density_matrix
# - aer_simulator_density_matrix_gpu # cannot run GPU in multithreading
# the stabilizer simulator works only if the circuit can be decomposed
# in the clifford group, e.g., in CNOT, Hadamard, phase gate S gates
#- aer_simulator_stabilizer
#- aer_simulator_extended_stabilizer
- aer_simulator_matrix_product_state
# the unitary simulators are exponential in the number of qubits.
#- aer_simulator_unitary
#- aer_simulator_unitary_gpu
#- unitary_simulator
# From Qiskit doc:
# "A dense superoperator matrix simulation of an ideal or noisy circuit.
# This simulates the superoperator matrix of the circuit itself rather
# than the evolution of an initial quantum state. This method can
# simulate ideal and noisy gates, and reset, but does not support
# measurement.""
# QiskitError: 'Data for experiment "qc" could not be found.'
#- aer_simulator_superop
- qasm_simulator
#- pulse_simulator
morphq_metamorphic_strategies:
ChangeOptLevel:
levels:
- 0
- 1
- 2
- 3
ChangeCouplingMap:
min_perc_nodes: 1
max_perc_nodes: 1.5
min_connection_density: 0.05
max_connection_density: 0.20
force_connected: true # true | false
ChangeBackend:
available_backends:
- aer_simulator
- aer_simulator_statevector
# - aer_simulator_statevector_gpu # cannot run GPU in multithreading
- statevector_simulator
- aer_simulator_density_matrix
# - aer_simulator_density_matrix_gpu # cannot run GPU in multithreading
# the stabilizer simulator works only if the circuit can be decomposed
# in the clifford group, e.g., in CNOT, Hadamard, phase gate S gates
#- aer_simulator_stabilizer
#- aer_simulator_extended_stabilizer
- aer_simulator_matrix_product_state
# the unitary simulators are exponential in the number of qubits.
#- aer_simulator_unitary
#- aer_simulator_unitary_gpu
#- unitary_simulator
# From Qiskit doc:
# "A dense superoperator matrix simulation of an ideal or noisy circuit.
# This simulates the superoperator matrix of the circuit itself rather
# than the evolution of an initial quantum state. This method can
# simulate ideal and noisy gates, and reset, but does not support
# measurement.""
# QiskitError: 'Data for experiment "qc" could not be found.'
#- aer_simulator_superop
- qasm_simulator
#- pulse_simulator
ChangeTargetBasis:
universal_gate_sets:
- gates:
- rx
- ry
- rz
- p
- cx
- gates:
- cx
- h
- s
- t
- gates:
- ccx # TOFFOLI
- h
ChangeQubitOrder:
scramble_percentage: 1
RunIndependentPartitions:
n_partitions: 2
InjectNullEffect:
min_n_ops: 0
max_n_ops: 10
fuzzer_object: QiskitFuzzer
gate_set:
- name: C3XGate
n_bits: 4
n_params: 1
shortname: mcx
- name: C4XGate
n_bits: 5
n_params: 0
shortname: mcx
- name: CCXGate
n_bits: 3
n_params: 0
shortname: ccx
- name: DCXGate
n_bits: 2
n_params: 0
shortname: dcx
- name: CHGate
n_bits: 2
n_params: 0
shortname: ch
- name: CPhaseGate
n_bits: 2
n_params: 1
shortname: cp
- name: CRXGate
n_bits: 2
n_params: 1
shortname: crx
- name: CRYGate
n_bits: 2
n_params: 1
shortname: cry
- name: CRZGate
n_bits: 2
n_params: 1
shortname: crz
- name: CSwapGate
n_bits: 3
n_params: 0
shortname: cswap
- name: CSXGate
n_bits: 2
n_params: 0
shortname: csx
- name: CUGate
n_bits: 2
n_params: 4
shortname: cu
- name: CU1Gate
n_bits: 2
n_params: 1
shortname: cu1
- name: CU3Gate
n_bits: 2
n_params: 3
shortname: cu3
- name: CXGate
n_bits: 2
n_params: 0
shortname: cx
- name: CYGate
n_bits: 2
n_params: 0
- name: CZGate
n_bits: 2
n_params: 0
shortname: cz
- name: HGate
n_bits: 1
n_params: 0
shortname: h
- name: IGate
n_bits: 1
n_params: 0
shortname: id
- name: PhaseGate
n_bits: 1
n_params: 1
shortname: p
- name: RCCXGate
n_bits: 3
n_params: 0
shortname: rccx
- name: RC3XGate
n_bits: 4
n_params: 0
shortname: rcccx
- name: RXGate
n_bits: 1
n_params: 1
shortname: rx
- name: RXXGate
n_bits: 2
n_params: 1
shortname: rxx
- name: RYGate
n_bits: 1
n_params: 1
shortname: ry
- name: RYYGate
n_bits: 2
n_params: 1
shortname: ryy
- name: RZGate
n_bits: 1
n_params: 1
shortname: rz
- name: RZZGate
n_bits: 2
n_params: 1
shortname: rzz
- name: RZXGate
n_bits: 2
n_params: 1
shortname: rzx
- name: ECRGate
n_bits: 2
n_params: 0
shortname: ecr
- name: SGate
n_bits: 1
n_params: 0
shortname: s
- name: SdgGate
n_bits: 1
n_params: 0
shortname: sdg
- name: SwapGate
n_bits: 2
n_params: 0
shortname: swap
- name: iSwapGate
n_bits: 2
n_params: 0
shortname: iswap
- name: SXGate
n_bits: 1
n_params: 0
shortname: sx
- name: SXdgGate
n_bits: 1
n_params: 0
shortname: sxdg
- name: TGate
n_bits: 1
n_params: 0
shortname: t
- name: TdgGate
n_bits: 1
n_params: 0
shortname: tdg
- name: UGate
n_bits: 1
n_params: 3
shortname: u
- name: U1Gate
n_bits: 1
n_params: 1
shortname: u1
- name: U2Gate
n_bits: 1
n_params: 2
shortname: u2
- name: U3Gate
n_bits: 1
n_params: 3
shortname: u3
- name: XGate
n_bits: 1
n_params: 0
shortname: x
- name: YGate
n_bits: 1
n_params: 0
shortname: y
- name: ZGate
n_bits: 1
n_params: 0
shortname: z
# NOT CLEAR HOW MANY BITS OR IF IT NEEDS ADDITIONAL CONTROL BITS
#- name: C3SXGate
# n_bits: 4
# n_params: 0
# DEPRECATED
#- name: MSGate
# n_bits: 0
# n_params: 0
# ADVANCED - N-bits
#- name: MCPhaseGate
# n_bits: 0
# n_params: 0
# NOT IN DOC: https://qiskit.org/documentation/apidoc/circuit_library.html
#- name: XYGate
# n_bits:
# n_params: 0
AddUnusedRegister:
min_n_bit: 1
max_n_bit: 10
reg_types:
- QuantumRegister
# - ClassicalRegister
# ClassicalRegister leads to a longer output string because qiskit
# measures all the classical registers
after_sections:
- CIRCUIT
- MEASURE
InjectParameters:
min_n_params: 1
max_n_params: null # null to consider all concrete values in the program
ToQasmAndBack:
qasm_version: 2
before_sections:
- OPTIMIZATION_LEVEL
- EXECUTION
# BUDGET
budget_time: null # SECONDS: null for continuous running
budget_time_per_program_couple: 120 # SECONDS: null for continuous running
# DEBUGGER
max_runs_per_suspect_bug: 10
max_seconds_per_suspect_bug: 20
update_db_every_n_programs: 1
primary_detector_for_debug: ks