DrawMany 作業
完整名稱:Std.Arrays.DrawMany
operation DrawMany<'TInput, 'TOutput>(op : ('TInput => 'TOutput), nSamples : Int, input : 'TInput) : 'TOutput[]
總結
針對指定數目的樣本重複作業,並在數位中收集其輸出。
輸入
op
要重複呼叫的作業。
nSamples
要收集的呼叫 op
樣本數目。
輸入
要傳遞至 op
的輸入。
類型參數
TInput
op
所預期的輸入類型。
TOutput
op
所傳回的輸出類型。
例
下列範例是替代的結果陣列。
use qubit = Qubit();
let results = Std.Arrays.DrawMany(q => {X(q); M(q)}, 3, qubit);