tket_json_rs/clexpr/op.rs
1//! Classical expression operations.
2
3#[cfg(feature = "schemars")]
4use schemars::JsonSchema;
5use serde::{Deserialize, Serialize};
6use strum::EnumString;
7
8/// List of supported classical expressions.
9///
10/// Corresponds to `pytket.circuit.ClOp`.
11#[cfg_attr(feature = "schemars", derive(JsonSchema))]
12#[derive(Deserialize, Serialize, Clone, Debug, Default, PartialEq, Eq, Hash, EnumString)]
13#[non_exhaustive]
14pub enum ClOp {
15 /// Invalid operation
16 #[default]
17 INVALID,
18
19 /// Bitwise AND
20 BitAnd,
21 /// Bitwise OR
22 BitOr,
23 /// Bitwise XOR
24 BitXor,
25 /// Bitwise equality
26 BitEq,
27 /// Bitwise inequality
28 BitNeq,
29 /// Bitwise NOT
30 BitNot,
31 /// Constant zero bit
32 BitZero,
33 /// Constant one bit
34 BitOne,
35
36 /// Registerwise AND
37 RegAnd,
38 /// Registerwise OR
39 RegOr,
40 /// Registerwise XOR
41 RegXor,
42 /// Registerwise equality
43 RegEq,
44 /// Registerwise inequality
45 RegNeq,
46 /// Registerwise NOT
47 RegNot,
48 /// Constant all-zeros register
49 RegZero,
50 /// Constant all-ones register
51 RegOne,
52 /// Integer less-than comparison
53 RegLt,
54 /// Integer greater-than comparison
55 RegGt,
56 /// Integer less-than-or-equal comparison
57 RegLeq,
58 /// Integer greater-than-or-equal comparison
59 RegGeq,
60 /// Integer addition
61 RegAdd,
62 /// Integer subtraction
63 RegSub,
64 /// Integer multiplication
65 RegMul,
66 /// Integer division
67 RegDiv,
68 /// Integer exponentiation
69 RegPow,
70 /// Left shift
71 RegLsh,
72 /// Right shift
73 RegRsh,
74 /// Integer negation
75 RegNeg,
76}