@@ -72,6 +72,7 @@ pub enum GateType {
7272 // MZ = 104
7373 Measure = 104 ,
7474 // MnZ = 105
75+ MeasureLeaked = 105 ,
7576 // TODO: MPauli instead of the other variants?
7677
7778 // PX = 130
@@ -104,6 +105,7 @@ impl From<u8> for GateType {
104105 58 => GateType :: SZZdg ,
105106 82 => GateType :: RZZ ,
106107 104 => GateType :: Measure ,
108+ 105 => GateType :: MeasureLeaked ,
107109 134 => GateType :: Prep ,
108110 200 => GateType :: Idle ,
109111 _ => panic ! ( "Invalid gate type ID: {value}" ) ,
@@ -134,6 +136,7 @@ impl GateType {
134136 | GateType :: SZZ
135137 | GateType :: SZZdg
136138 | GateType :: Measure
139+ | GateType :: MeasureLeaked
137140 | GateType :: Prep => 0 ,
138141
139142 // Gates with one parameter
@@ -170,6 +173,7 @@ impl GateType {
170173 | GateType :: R1XY
171174 | GateType :: U
172175 | GateType :: Measure
176+ | GateType :: MeasureLeaked
173177 | GateType :: Prep
174178 | GateType :: Idle => 1 ,
175179
@@ -217,6 +221,7 @@ impl fmt::Display for GateType {
217221 GateType :: SZZdg => write ! ( f, "SZZdg" ) ,
218222 GateType :: RZZ => write ! ( f, "RZZ" ) ,
219223 GateType :: Measure => write ! ( f, "Measure" ) ,
224+ GateType :: MeasureLeaked => write ! ( f, "MeasureLeaked" ) ,
220225 GateType :: Prep => write ! ( f, "Prep" ) ,
221226 GateType :: Idle => write ! ( f, "Idle" ) ,
222227 }
@@ -239,6 +244,7 @@ mod tests {
239244 assert_eq ! ( GateType :: RZ as u8 , 32 ) ;
240245 assert_eq ! ( GateType :: R1XY as u8 , 36 ) ;
241246 assert_eq ! ( GateType :: Measure as u8 , 104 ) ;
247+ assert_eq ! ( GateType :: MeasureLeaked as u8 , 105 ) ;
242248
243249 assert_eq ! ( GateType :: from( 0u8 ) , GateType :: I ) ;
244250 assert_eq ! ( GateType :: from( 1u8 ) , GateType :: X ) ;
@@ -250,6 +256,7 @@ mod tests {
250256 assert_eq ! ( GateType :: from( 32u8 ) , GateType :: RZ ) ;
251257 assert_eq ! ( GateType :: from( 36u8 ) , GateType :: R1XY ) ;
252258 assert_eq ! ( GateType :: from( 104u8 ) , GateType :: Measure ) ;
259+ assert_eq ! ( GateType :: from( 105u8 ) , GateType :: MeasureLeaked ) ;
253260 }
254261
255262 #[ test]
@@ -264,6 +271,7 @@ mod tests {
264271 assert_eq ! ( GateType :: SZZ . classical_arity( ) , 0 ) ;
265272 assert_eq ! ( GateType :: SZZdg . classical_arity( ) , 0 ) ;
266273 assert_eq ! ( GateType :: Measure . classical_arity( ) , 0 ) ;
274+ assert_eq ! ( GateType :: MeasureLeaked . classical_arity( ) , 0 ) ;
267275 assert_eq ! ( GateType :: Prep . classical_arity( ) , 0 ) ;
268276
269277 // Gates with one parameter
@@ -290,6 +298,7 @@ mod tests {
290298 assert_eq ! ( GateType :: R1XY . quantum_arity( ) , 1 ) ;
291299 assert_eq ! ( GateType :: U . quantum_arity( ) , 1 ) ;
292300 assert_eq ! ( GateType :: Measure . quantum_arity( ) , 1 ) ;
301+ assert_eq ! ( GateType :: MeasureLeaked . quantum_arity( ) , 1 ) ;
293302 assert_eq ! ( GateType :: Prep . quantum_arity( ) , 1 ) ;
294303 assert_eq ! ( GateType :: Idle . quantum_arity( ) , 1 ) ;
295304
@@ -312,6 +321,7 @@ mod tests {
312321 assert ! ( !GateType :: SZZ . is_parameterized( ) ) ;
313322 assert ! ( !GateType :: SZZdg . is_parameterized( ) ) ;
314323 assert ! ( !GateType :: Measure . is_parameterized( ) ) ;
324+ assert ! ( !GateType :: MeasureLeaked . is_parameterized( ) ) ;
315325 assert ! ( !GateType :: Prep . is_parameterized( ) ) ;
316326
317327 // Parameterized gates
@@ -334,6 +344,7 @@ mod tests {
334344 assert ! ( GateType :: R1XY . is_single_qubit( ) ) ;
335345 assert ! ( GateType :: U . is_single_qubit( ) ) ;
336346 assert ! ( GateType :: Measure . is_single_qubit( ) ) ;
347+ assert ! ( GateType :: MeasureLeaked . is_single_qubit( ) ) ;
337348 assert ! ( GateType :: Prep . is_single_qubit( ) ) ;
338349 assert ! ( GateType :: Idle . is_single_qubit( ) ) ;
339350
@@ -356,6 +367,7 @@ mod tests {
356367 assert ! ( !GateType :: R1XY . is_two_qubit( ) ) ;
357368 assert ! ( !GateType :: U . is_two_qubit( ) ) ;
358369 assert ! ( !GateType :: Measure . is_two_qubit( ) ) ;
370+ assert ! ( !GateType :: MeasureLeaked . is_two_qubit( ) ) ;
359371 assert ! ( !GateType :: Prep . is_two_qubit( ) ) ;
360372 assert ! ( !GateType :: Idle . is_two_qubit( ) ) ;
361373
0 commit comments