This repository was archived by the owner on Jan 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -76,4 +76,16 @@ public partial class M
7676 return null ;
7777 }
7878 }
79+
80+ public partial class ResetAll
81+ {
82+ /// <inheritdoc/>
83+ public override RuntimeMetadata ? GetRuntimeMetadata ( IApplyData args )
84+ {
85+ var metadata = base . GetRuntimeMetadata ( args ) ;
86+ if ( metadata == null ) throw new NullReferenceException ( $ "Null RuntimeMetadata found for { this . ToString ( ) } .") ;
87+ metadata . IsComposite = true ;
88+ return metadata ;
89+ }
90+ }
7991}
Original file line number Diff line number Diff line change @@ -297,6 +297,28 @@ public void M()
297297 Assert . Equal ( op . GetRuntimeMetadata ( args ) , expected ) ;
298298 }
299299
300+ [ Fact ]
301+ public void Reset ( )
302+ {
303+ var target = new FreeQubit ( 0 ) ;
304+ var op = new QuantumSimulator ( ) . Get < Intrinsic . Reset > ( ) ;
305+ var args = op . __dataIn ( target ) ;
306+ var expected = new RuntimeMetadata ( )
307+ {
308+ Label = "Reset" ,
309+ FormattedNonQubitArgs = "" ,
310+ IsAdjoint = false ,
311+ IsControlled = false ,
312+ IsMeasurement = false ,
313+ IsComposite = false ,
314+ Children = null ,
315+ Controls = new List < Qubit > ( ) { } ,
316+ Targets = new List < Qubit > ( ) { target } ,
317+ } ;
318+
319+ Assert . Equal ( op . GetRuntimeMetadata ( args ) , expected ) ;
320+ }
321+
300322 [ Fact ]
301323 public void ResetAll ( )
302324 {
@@ -310,7 +332,7 @@ public void ResetAll()
310332 IsAdjoint = false ,
311333 IsControlled = false ,
312334 IsMeasurement = false ,
313- IsComposite = false ,
335+ IsComposite = true ,
314336 Children = null ,
315337 Controls = new List < Qubit > ( ) { } ,
316338 Targets = targets ,
You can’t perform that action at this time.
0 commit comments