tket_json_rs/optype.rs
1//! Defines the `OpType` enum, which represents the operation types in a quantum
2//! circuit.
3
4#[cfg(feature = "pyo3")]
5use pyo3::prelude::*;
6#[cfg(feature = "schemars")]
7use schemars::JsonSchema;
8use serde::{Deserialize, Serialize};
9use strum::EnumString;
10
11/// Operation types in a quantum circuit.
12#[cfg_attr(feature = "pyo3", pyclass(name = "RsOpType", eq, eq_int))]
13#[derive(
14 Deserialize,
15 Serialize,
16 Copy,
17 Clone,
18 Debug,
19 Default,
20 PartialEq,
21 Eq,
22 Hash,
23 EnumString,
24 derive_more::Display,
25)]
26#[cfg_attr(feature = "schemars", derive(JsonSchema))]
27#[non_exhaustive]
28pub enum OpType {
29 /// Quantum input node of the circuit
30 Input,
31
32 /// Quantum output node of the circuit
33 Output,
34
35 /// Quantum node with no predecessors, implicitly in zero state.
36 Create,
37
38 /// Quantum node with no successors, not composable with input nodes of other
39 /// circuits.
40 Discard,
41
42 /// Classical input node of the circuit
43 ClInput,
44
45 /// Classical output node of the circuit
46 ClOutput,
47
48 /// No-op that must be preserved by compilation
49 Barrier,
50
51 /// FlowOp introducing a target for Branch or Goto commands
52 Label,
53
54 /// Execution jumps to a label if a condition bit is true (1),
55 /// otherwise continues to next command
56 Branch,
57
58 /// Execution jumps to a label unconditionally
59 Goto,
60
61 /// Execution halts and the program terminates
62 Stop,
63
64 /// A general classical operation where all inputs are also outputs
65 ClassicalTransform,
66
67 /// Op containing a classical wasm function call.
68 WASM,
69
70 /// An operation to set some bits to specified values
71 SetBits,
72
73 /// An operation to copy some bit values
74 CopyBits,
75
76 /// A classical predicate defined by a range of values in binary encoding
77 RangePredicate,
78
79 /// A classical predicate defined by a truth table
80 ExplicitPredicate,
81
82 /// An operation defined by a truth table that modifies one bit
83 ExplicitModifier,
84
85 /// A classical operation applied to multiple bits simultaneously
86 MultiBit,
87
88 /// Global phase $\alpha \mapsto \[\e^{i\pi\alpha}\]$
89 Phase,
90
91 /// \f$ \left[ \begin{array}{cc} 1 & 0 \\ 0 & -1 \end{array} \right] \f$
92 Z,
93
94 /// \f$ \left[ \begin{array}{cc} 0 & 1 \\ 1 & 0 \end{array} \right] \f$
95 X,
96
97 /// \f$ \left[ \begin{array}{cc} 0 & -i \\ i & 0 \end{array} \right] \f$
98 Y,
99
100 /// \f$ \left[ \begin{array}{cc} 1 & 0 \\ 0 & i \end{array} \right] =
101 /// \mathrm{U1}(\frac12) \f$
102 S,
103
104 /// \f$ \left[ \begin{array}{cc} 1 & 0 \\ 0 & -i \end{array} \right] =
105 /// \mathrm{U1}(-\frac12) \f$
106 Sdg,
107
108 /// \f$ \left[ \begin{array}{cc} 1 & 0 \\ 0 & e^{i\pi/4} \end{array} \right]
109 /// = \mathrm{U1}(\frac14) \f$
110 T,
111
112 /// \f$ \left[ \begin{array}{cc} 1 & 0 \\ 0 & e^{-i\pi/4} \end{array} \right]
113 /// \equiv \mathrm{U1}(-\frac14) \f$
114 Tdg,
115
116 /// \f$ \frac{1}{\sqrt 2} \left[ \begin{array}{cc} 1 & -i \\ -i & 1
117 /// \end{array} \right] = \mathrm{Rx}(\frac12) \f$
118 V,
119
120 /// \f$ \frac{1}{\sqrt 2} \left[ \begin{array}{cc} 1 & i \\ i & 1 \end{array}
121 /// \right] = \mathrm{Rx}(-\frac12) \f$
122 Vdg,
123
124 /// \f$ \frac{1}{2} \left[ \begin{array}{cc} 1+i & 1-i \\ 1-i & 1+i
125 /// \end{array} \right] = e^{\frac{i\pi}{4}}\mathrm{Rx}(\frac12) \f$
126 SX,
127
128 /// \f$ \frac{1}{2} \left[ \begin{array}{cc} 1-i & 1+i \\ 1+i & 1-i
129 /// \end{array} \right] = e^{\frac{-i\pi}{4}}\mathrm{Rx}(-\frac12) \f$
130 SXdg,
131
132 /// \f$ \frac{1}{\sqrt 2} \left[ \begin{array}{cc} 1 & 1 \\ 1 & -1
133 /// \end{array} \right] \f$
134 H,
135
136 /// \f$ \mathrm{Rx}(\alpha) = e^{-\frac12 i \pi \alpha X} = \left[
137 /// \begin{array}{cc} \cos\frac{\pi\alpha}{2} & -i\sin\frac{\pi\alpha}{2} \\
138 /// -i\sin\frac{\pi\alpha}{2} & \cos\frac{\pi\alpha}{2} \end{array} \right]
139 /// \f$
140 Rx,
141
142 /// \f$ \mathrm{Ry}(\alpha) = e^{-\frac12 i \pi \alpha Y} = \left[
143 /// \begin{array}{cc} \cos\frac{\pi\alpha}{2} & -\sin\frac{\pi\alpha}{2}
144 /// \\ \sin\frac{\pi\alpha}{2} & \cos\frac{\pi\alpha}{2} \end{array} \right]
145 /// \f$
146 Ry,
147
148 /// \f$ \mathrm{Rz}(\alpha) = e^{-\frac12 i \pi \alpha Z} = \left[
149 /// \begin{array}{cc} e^{-\frac12 i \pi\alpha} & 0 \\ 0 & e^{\frac12 i
150 /// \pi\alpha} \end{array} \right] \f$
151 Rz,
152
153 /// \f$ \mathrm{U3}(\theta, \phi, \lambda) = \left[ \begin{array}{cc}
154 /// \cos\frac{\pi\theta}{2} & -e^{i\pi\lambda} \sin\frac{\pi\theta}{2} \\
155 /// e^{i\pi\phi} \sin\frac{\pi\theta}{2} & e^{i\pi(\lambda+\phi)}
156 /// \cos\frac{\pi\theta}{2} \end{array} \right] = e^{\frac12
157 /// i\pi(\lambda+\phi)} \mathrm{Rz}(\phi) \mathrm{Ry}(\theta)
158 /// \mathrm{Rz}(\lambda) \f$
159 U3,
160
161 /// \f$ \mathrm{U2}(\phi, \lambda) = \mathrm{U3}(\frac12, \phi, \lambda)
162 /// = e^{\frac12 i\pi(\lambda+\phi)} \mathrm{Rz}(\phi) \mathrm{Ry}(\frac12)
163 /// \mathrm{Rz}(\lambda) \f$
164 U2,
165
166 /// \f$ \mathrm{U1}(\lambda) = \mathrm{U3}(0, 0, \lambda) = e^{\frac12
167 /// i\pi\lambda} \mathrm{Rz}(\lambda) \f$
168 U1,
169
170 /// \f$ \mathrm{TK1}(\alpha, \beta, \gamma) = \mathrm{Rz}(\alpha)
171 /// \mathrm{Rx}(\beta) \mathrm{Rz}(\gamma) \f$
172 #[serde(alias = "tk1")]
173 TK1,
174
175 /// \f$ \mathrm{TK2}(\alpha, \beta, \gamma) = \mathrm{XXPhase}(\alpha)
176 /// \mathrm{YYPhase}(\beta) \mathrm{ZZPhase}(\gamma) \f$
177 #[serde(alias = "tk2")]
178 TK2,
179
180 /// Controlled [`OpType::X`].
181 CX,
182
183 /// Controlled [`OpType::Y`]
184 CY,
185
186 /// Controlled [`OpType::Z`]
187 CZ,
188
189 /// Controlled [`OpType::H`]
190 CH,
191
192 /// Controlled [`OpType::V`]
193 ///
194 /// \f$ \left[ \begin{array}{cccc}
195 /// 1 & 0 & 0 & 0 \\
196 /// 0 & 1 & 0 & 0 \\
197 /// 0 & 0 & \frac{1}{\sqrt 2} & -i \frac{1}{\sqrt 2} \\
198 /// 0 & 0 & -i \frac{1}{\sqrt 2} & \frac{1}{\sqrt 2}
199 /// \end{array} \right] \f$
200 CV,
201
202 /// Controlled [`OpType::Vdg`]
203 ///
204 /// \f$ \left[ \begin{array}{cccc}
205 /// 1 & 0 & 0 & 0 \\
206 /// 0 & 1 & 0 & 0 \\
207 /// 0 & 0 & \frac{1}{\sqrt 2} & i \frac{1}{\sqrt 2} \\
208 /// 0 & 0 & i \frac{1}{\sqrt 2} & \frac{1}{\sqrt 2}
209 /// \end{array} \right] \f$
210 CVdg,
211
212 /// Controlled [`OpType::SX`]
213 ///
214 /// \f$ \left[ \begin{array}{cccc}
215 /// 1 & 0 & 0 & 0 \\
216 /// 0 & 1 & 0 & 0 \\
217 /// 0 & 0 & \frac{1+i}{2} & \frac{1-i}{2} \\
218 /// 0 & 0 & \frac{1-i}{2} & \frac{1+i}{2}
219 /// \end{array} \right] \f$
220 CSX,
221
222 /// Controlled [`OpType::SXdg`]
223 ///
224 /// \f$ \left[ \begin{array}{cccc}
225 /// 1 & 0 & 0 & 0 \\
226 /// 0 & 1 & 0 & 0 \\
227 /// 0 & 0 & \frac{1-i}{2} & \frac{1+i}{2} \\
228 /// 0 & 0 & \frac{1+i}{2} & \frac{1-i}{2}
229 /// \end{array} \right] \f$
230 CSXdg,
231
232 /// Controlled [`OpType::S`] gate
233 CS,
234
235 /// Controlled [`OpType::Sdg`] gate
236 CSdg,
237
238 /// Controlled [`OpType::Rz`]
239 ///
240 /// \f$ \mathrm{CRz}(\alpha) = \left[ \begin{array}{cccc} 1 & 0 & 0 & 0 \\ 0
241 /// & 1 & 0 & 0 \\ 0 & 0 & e^{-\frac12 i \pi\alpha} & 0 \\ 0 & 0 & 0 &
242 /// e^{\frac12 i \pi\alpha} \end{array} \right] \f$
243 ///
244 /// The phase parameter \f$ \alpha \f$ is defined modulo \f$ 4 \f$.
245 CRz,
246
247 /// Controlled [`OpType::Rx`]
248 ///
249 /// \f$ \mathrm{CRx}(\alpha) = \left[ \begin{array}{cccc} 1 & 0 & 0 & 0 \\ 0
250 /// & 1 & 0 & 0 \\ 0 & 0 & \cos \frac{\pi \alpha}{2} & -i \sin \frac{\pi
251 /// \alpha}{2}
252 /// \\ 0 & 0 & -i \sin \frac{\pi \alpha}{2} & \cos \frac{\pi \alpha}{2}
253 /// \end{array} \right] \f$
254 ///
255 /// The phase parameter \f$ \alpha \f$ is defined modulo \f$ 4 \f$.
256 CRx,
257
258 /// Controlled [`OpType::Ry`]
259 ///
260 /// \f$ \mathrm{CRy}(\alpha) = \left[ \begin{array}{cccc} 1 & 0 & 0 & 0 \\ 0
261 /// & 1 & 0 & 0 \\ 0 & 0 & \cos \frac{\pi \alpha}{2} & -\sin \frac{\pi
262 /// \alpha}{2}
263 /// \\ 0 & 0 & \sin \frac{\pi \alpha}{2} & \cos \frac{\pi \alpha}{2}
264 /// \end{array} \right] \f$
265 ///
266 /// The phase parameter \f$ \alpha \f$ is defined modulo \f$ 4 \f$.
267 CRy,
268
269 /// Controlled [`OpType::U1`]
270 ///
271 /// \f$ \mathrm{CU1}(\alpha) = \left[ \begin{array}{cccc} 1 & 0 & 0 & 0 \\ 0
272 /// & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & e^{i\pi\alpha} \end{array}
273 /// \right] \f$
274 CU1,
275
276 /// Controlled [`OpType::U3`]
277 CU3,
278
279 /// \f$ \alpha \mapsto e^{-\frac12 i \pi\alpha Z^{\otimes n}} \f$
280 PhaseGadget,
281
282 /// Controlled [`OpType::CX`]
283 CCX,
284
285 /// Swap two qubits
286 SWAP,
287
288 /// Controlled [`OpType::SWAP`]
289 CSWAP,
290
291 /// Three-qubit gate that swaps the first and third qubits
292 BRIDGE,
293
294 /// Identity
295 #[allow(non_camel_case_types)]
296 #[default]
297 noop,
298
299 /// Measure a qubit, producing a classical output
300 Measure,
301
302 /// Measure a qubit producing no output
303 Collapse,
304
305 /// Reset a qubit to the zero state
306 Reset,
307
308 /// \f$ \frac{1}{\sqrt 2} \left[ \begin{array}{cccc} 0 & 0 & 1 & i \\ 0 & 0 &
309 /// i & 1 \\ 1 & -i & 0 & 0 \\ -i & 1 & 0 & 0 \end{array} \right] \f$
310 ECR,
311
312 /// \f$ \alpha \mapsto e^{\frac14 i \pi\alpha (X \otimes X + Y \otimes Y)}
313 /// = \left[ \begin{array}{cccc} 1 & 0 & 0 & 0 \\ 0 & \cos\frac{\pi\alpha}{2}
314 /// & i\sin\frac{\pi\alpha}{2} & 0 \\ 0 & i\sin\frac{\pi\alpha}{2} &
315 /// \cos\frac{\pi\alpha}{2} & 0 \\ 0 & 0 & 0 & 1 \end{array} \right] \f$
316 ///
317 /// Also known as an XY gate.
318 ISWAP,
319
320 /// \f$ (\alpha, \beta) \mapsto \mathrm{Rz}(\beta) \mathrm{Rx}(\alpha)
321 /// \mathrm{Rz}(-\beta) \f$
322 PhasedX,
323
324 /// PhasedX gates on multiple qubits
325 NPhasedX,
326
327 /// \f$ \mathrm{ZZPhase}(\frac12) \f$
328 ZZMax,
329
330 /// \f$ \alpha \mapsto e^{-\frac12 i \pi\alpha (X \otimes X)} = \left[
331 /// \begin{array}{cccc} \cos\frac{\pi\alpha}{2} & 0 & 0 &
332 /// -i\sin\frac{\pi\alpha}{2} \\ 0 & \cos\frac{\pi\alpha}{2} &
333 /// -i\sin\frac{\pi\alpha}{2} & 0 \\ 0 & -i\sin\frac{\pi\alpha}{2} &
334 /// \cos\frac{\pi\alpha}{2} & 0 \\ -i\sin\frac{\pi\alpha}{2} & 0 & 0 &
335 /// \cos\frac{\pi\alpha}{2} \end{array} \right] \f$
336 XXPhase,
337
338 /// \f$ \alpha \mapsto e^{-\frac12 i \pi\alpha (Y \otimes Y)} = \left[
339 /// \begin{array}{cccc} \cos\frac{\pi\alpha}{2} & 0 & 0 &
340 /// i\sin\frac{\pi\alpha}{2} \\ 0 & \cos\frac{\pi\alpha}{2} &
341 /// -i\sin\frac{\pi\alpha}{2} & 0 \\ 0 & -i\sin\frac{\pi\alpha}{2} &
342 /// \cos\frac{\pi\alpha}{2} & 0 \\ i\sin\frac{\pi\alpha}{2} & 0 & 0 &
343 /// \cos\frac{\pi\alpha}{2} \end{array} \right] \f$
344 YYPhase,
345
346 /// \f$ \alpha \mapsto e^{-\frac12 i \pi\alpha (Z \otimes Z)} = \left[
347 /// \begin{array}{cccc} e^{-\frac12 i \pi\alpha} & 0 & 0 & 0 \\ 0 &
348 /// e^{\frac12 i \pi\alpha} & 0 & 0 \\ 0 & 0 & e^{\frac12 i \pi\alpha} & 0 \\ 0
349 /// & 0 & 0 & e^{-\frac12 i \pi\alpha} \end{array} \right] \f$
350 ZZPhase,
351
352 /// Three-qubit phase MSGate
353 XXPhase3,
354
355 /// \f$ \alpha \mapsto e^{-\frac12 i\pi\alpha \cdot \mathrm{SWAP}} = \left[
356 /// \begin{array}{cccc} e^{-\frac12 i \pi\alpha} & 0 & 0 & 0 \\ 0 &
357 /// \cos\frac{\pi\alpha}{2} & -i\sin\frac{\pi\alpha}{2} & 0 \\ 0 &
358 /// -i\sin\frac{\pi\alpha}{2} & \cos\frac{\pi\alpha}{2} & 0 \\ 0 & 0 & 0 &
359 /// e^{-\frac12 i \pi\alpha} \end{array} \right] \f$
360 ESWAP,
361
362 /// \f$ (\alpha, \beta) \mapsto \left[ \begin{array}{cccc} 1 & 0 & 0 & 0 \\ 0
363 /// & \cos \pi\alpha & -i\sin \pi\alpha & 0 \\ 0 &
364 /// -i\sin \pi\alpha & \cos \pi\alpha & 0 \\ 0 & 0 & 0 &
365 /// e^{-i\pi\beta} \end{array} \right] \f$
366 FSim,
367
368 /// Fixed instance of a [`OpType::FSim`] gate with parameters
369 /// \f$ (\frac12, \frac16) \f$:
370 /// \f$ \left[ \begin{array}{cccc} 1 & 0 & 0 & 0 \\ 0 & 0 & -i & 0 \\ 0 & -i
371 /// & 0 & 0 \\ 0 & 0 & 0 & e^{-i\pi/6} \end{array} \right] \f$
372 Sycamore,
373
374 /// Fixed instance of a [`OpType::ISWAP`] gate with parameter \f$ 1.0 \f$:
375 /// \f$ \left[ \begin{array}{cccc} 1 & 0 & 0 & 0 \\ 0 & 0 & i & 0 \\ 0 & i
376 /// & 0 & 0 \\ 0 & 0 & 0 & 1 \end{array} \right] \f$
377 ISWAPMax,
378
379 /// ISwap gate with extra `Rz`s on each qubit
380 // TODO: Matrix description
381 PhasedISWAP,
382
383 /// N-controlled [`OpType::Rx`]
384 CnRx,
385
386 /// N-controlled [`OpType::Ry`]
387 CnRy,
388
389 /// N-controlled [`OpType::Rz`]
390 CnRz,
391
392 /// Multiply-controlled [`OpType::X`]
393 CnX,
394
395 /// Multiply-controlled [`OpType::Y`]
396 CnY,
397
398 /// Multiply-controlled [`OpType::Z`]
399 CnZ,
400
401 /// GPi gate
402 ///
403 /// \f$ (\\phi) \\mapsto \\left[ \\begin{array}{cc} 0 &
404 /// e^{-i\\pi\\phi} \\\\ e^{i\\pi\\phi} & 0 \\end{array} \\right] \f$
405 GPI,
406
407 /// GPi2 gate
408 ///
409 /// \f$
410 /// (\\phi) \\mapsto \\frac{1}{\\sqrt 2} \\left[
411 /// \\begin{array}{cc} 1 & -ie^{-i\\pi\\phi} \\\\ -ie^{i\\pi\\phi} &
412 /// 1 \\end{array} \\right]
413 /// \f$
414 GPI2,
415
416 /// AAMS gate
417 ///
418 /// \f$
419 ///
420 /// (\\theta, \\phi_0, \\phi_1) \\mapsto \\left[ "
421 /// \\begin{array}{cccc} \\cos\\frac{\\pi\\theta}{2} & 0 & 0 &
422 /// -ie^{-i\\pi(\\phi_0+\\phi_1)}\\sin\\frac{\\pi\\theta}{2} \\\\
423 /// 0 &
424 /// \\cos\\frac{\\pi\\theta}{2} &
425 /// -ie^{i\\pi(\\phi_1-\\phi_0)}\\sin\\frac{\\pi\\theta}{2} & 0 \\\\ 0
426 /// &
427 /// -ie^{i\\pi(\\phi_0-\\phi_1)}\\sin\\frac{\\pi\\theta}{2} &
428 /// \\cos\\frac{\\pi\\theta}{2} & 0 \\\\
429 /// -ie^{i\\pi(\\phi_0+\\phi_1)}\\sin\\frac{\\pi\\theta}{2} & 0 & 0 &
430 /// \\cos\\frac{\\pi\\theta}{2} \\end{array} \\right]`
431 /// \f$
432 AAMS,
433
434 /// See [`CircBox`]
435 ///
436 /// [`CircBox`]: crate::opbox::OpBox::CircBox
437 CircBox,
438
439 /// See [`Unitary1qBox`]
440 ///
441 /// [`Unitary1qBox`]: crate::opbox::OpBox::Unitary1qBox
442 Unitary1qBox,
443
444 /// See [`Unitary2qBox`]
445 ///
446 /// [`Unitary2qBox`]: crate::opbox::OpBox::Unitary2qBox
447 Unitary2qBox,
448
449 /// See [`Unitary3qBox`]
450 ///
451 /// [`Unitary3qBox`]: crate::opbox::OpBox::Unitary3qBox
452 Unitary3qBox,
453
454 /// See [`ExpBox`]
455 ///
456 /// [`ExpBox`]: crate::opbox::OpBox::ExpBox
457 ExpBox,
458
459 /// See [`PauliExpBox`]
460 ///
461 /// [`PauliExpBox`]: crate::opbox::OpBox::PauliExpBox
462 PauliExpBox,
463
464 /// See [`PauliExpPairBox`]
465 ///
466 /// [`PauliExpPairBox`]: crate::opbox::OpBox::PauliExpPairBox
467 PauliExpPairBox,
468
469 /// See [`PauliExpCommutingSetBox`]
470 ///
471 /// [`PauliExpCommutingSetBox`]: crate::opbox::OpBox::PauliExpCommutingSetBox
472 PauliExpCommutingSetBox,
473
474 /// See [`TermSequenceBox`]
475 ///
476 /// [`TermSequenceBox`]: crate::opbox::OpBox::TermSequenceBox
477 TermSequenceBox,
478
479 /// NYI
480 CliffBox,
481
482 /// See [`PhasePolyBox`]
483 ///
484 /// [`PhasePolyBox`]: crate::opbox::OpBox::PhasePolyBox
485 PhasePolyBox,
486
487 /// NYI
488 #[serde(alias = "Condition")]
489 Conditional,
490
491 /// See [`StabiliserAssertionBox`]
492 ///
493 /// [`StabiliserAssertionBox`]: crate::opbox::OpBox::StabiliserAssertionBox
494 StabiliserAssertionBox,
495
496 /// See [`ProjectorAssertionBox`]
497 ///
498 /// [`ProjectorAssertionBox`]: crate::opbox::OpBox::ProjectorAssertionBox
499 ProjectorAssertionBox,
500
501 /// See [`CustomGate`]
502 ///
503 /// [`CustomGate`]: crate::opbox::OpBox::CustomGate
504 #[serde(alias = "Composite")]
505 CustomGate,
506
507 /// See [`QControlBox`]
508 ///
509 /// [`QControlBox`]: crate::opbox::OpBox::QControlBox
510 QControlBox,
511
512 /// See [`UnitaryTableauBox`]
513 ///
514 /// [`UnitaryTableauBox`]: crate::opbox::OpBox::UnitaryTableauBox
515 UnitaryTableauBox,
516
517 /// See [`ClassicalExpBox`]
518 ///
519 /// Deprecated. Use [`OpType::ClExpr`] instead.
520 ///
521 /// [`ClassicalExpBox`]: crate::opbox::OpBox::ClassicalExpBox
522 ClassicalExpBox,
523
524 /// See [`MultiplexorBox`]
525 ///
526 /// [`MultiplexorBox`]: crate::opbox::OpBox::MultiplexorBox
527 MultiplexorBox,
528
529 /// See [`MultiplexedRotationBox`]
530 ///
531 /// [`MultiplexedRotationBox`]: crate::opbox::OpBox::MultiplexedRotationBox
532 MultiplexedRotationBox,
533
534 /// See [`MultiplexedU2Box`]
535 ///
536 /// [`MultiplexedU2Box`]: crate::opbox::OpBox::MultiplexedU2Box
537 MultiplexedU2Box,
538
539 /// See [`MultiplexedTensoredU2Box`]
540 ///
541 /// [`MultiplexedTensoredU2Box`]: crate::opbox::OpBox::MultiplexedTensoredU2Box
542 MultiplexedTensoredU2Box,
543
544 /// See [`ToffoliBox`]
545 ///
546 /// [`ToffoliBox`]: crate::opbox::OpBox::ToffoliBox
547 ToffoliBox,
548
549 /// See [`ConjugationBox`]
550 ///
551 /// [`ConjugationBox`]: crate::opbox::OpBox::ConjugationBox
552 ConjugationBox,
553
554 /// See [`DummyBox`]
555 ///
556 /// [`DummyBox`]: crate::opbox::OpBox::DummyBox
557 DummyBox,
558
559 /// See [`StatePreparationBox`]
560 ///
561 /// [`StatePreparationBox`]: crate::opbox::OpBox::StatePreparationBox
562 StatePreparationBox,
563
564 /// See [`DiagonalBox`]
565 ///
566 /// [`DiagonalBox`]: crate::opbox::OpBox::DiagonalBox
567 DiagonalBox,
568
569 /// Classical expression.
570 ///
571 /// An operation of this type is accompanied by a [`ClExpr`] object.
572 ///
573 /// This is a replacement of the deprecated [`OpType::ClassicalExpBox`].
574 ///
575 /// [`ClExpr`]: crate::clexpr::ClExpr
576 ClExpr,
577
578 /// RNG input node of the circuit
579 RNGInput,
580
581 /// RNG output node of the circuit
582 RNGOutput,
583
584 /// Seed an RNG using 64 bits
585 RNGSeed,
586
587 /// Set an (inclusive) 32-bit upper bound on RNG output
588 RNGBound,
589
590 /// Set a 32-bit index on an RNG
591 RNGIndex,
592
593 /// Get 32-bit output from an RNG
594 RNGNum,
595
596 /// Get 32-bit (little-endian) shot number
597 JobShotNum,
598}