@@ -122,23 +122,40 @@ impl<'a> SynthesisData<'a> {
122
122
}
123
123
124
124
// Convenience functions
125
+
126
+ /// Appends XGate to the circuit.
125
127
#[ inline]
126
128
pub fn x ( & mut self , q : u32 ) {
127
129
self . push_standard_gate ( StandardGate :: XGate , & [ ] , & [ q] ) ;
128
130
}
129
131
132
+ /// Appends HGate to the circuit.
130
133
#[ inline]
131
134
pub fn h ( & mut self , q : u32 ) {
132
135
self . push_standard_gate ( StandardGate :: HGate , & [ ] , & [ q] ) ;
133
136
}
134
137
138
+ /// Appends TGate to the circuit.
135
139
#[ inline]
136
140
pub fn t ( & mut self , q : u32 ) {
137
141
self . push_standard_gate ( StandardGate :: TGate , & [ ] , & [ q] ) ;
138
142
}
139
143
144
+ /// Appends TdgGate to the circuit.
140
145
#[ inline]
141
146
pub fn tdg ( & mut self , q : u32 ) {
142
147
self . push_standard_gate ( StandardGate :: TdgGate , & [ ] , & [ q] ) ;
143
148
}
149
+
150
+ /// Appends PhaseGate to the circuit.
151
+ #[ inline]
152
+ pub fn p ( & mut self , theta : f64 , q : u32 ) {
153
+ self . push_standard_gate ( StandardGate :: PhaseGate , & [ Param :: Float ( theta) ] , & [ q] ) ;
154
+ }
155
+
156
+ /// Appends CXGate to the circuit.
157
+ #[ inline]
158
+ pub fn cx ( & mut self , q1 : u32 , q2 : u32 ) {
159
+ self . push_standard_gate ( StandardGate :: CXGate , & [ ] , & [ q1, q2] ) ;
160
+ }
144
161
}
0 commit comments