Update to new empty array creation syntax (#670)

This commit is contained in:
Vincent van Wingerden 2021-10-11 22:00:01 +02:00 коммит произвёл GitHub
Родитель 234b856fac
Коммит fc459a75d9
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
7 изменённых файлов: 9 добавлений и 9 удалений

Просмотреть файл

@ -71,7 +71,7 @@ namespace Quantum.Kata.BoundedKnapsack
// Example: For n = 3 and the qubits state |101⟩, return [true, false, true].
operation MeasureCombination01 (selectedItems : Qubit[]) : Bool[] {
// ...
return new Bool[0];
return [];
}
@ -205,7 +205,7 @@ namespace Quantum.Kata.BoundedKnapsack
// Example: For state selectedItemCounts = [|101⟩, |1110⟩, |0100⟩], return [5, 7, 2].
operation MeasureCombination (selectedItemCounts : Qubit[][]) : Int[] {
// ...
return new Int[0];
return [];
}

Просмотреть файл

@ -65,7 +65,7 @@ namespace Quantum.Kata.GraphColoring {
// Example: for N = 2, K = 2 and the qubits in the state |0110⟩ return [2, 1].
operation MeasureColoring (K : Int, register : Qubit[]) : Int[] {
// ...
return new Int[0];
return [];
}

Просмотреть файл

@ -159,7 +159,7 @@ namespace Quantum.Kata.GraphColoring {
// - regular-ish graph with 5 vertices (3-colorable, as shown at https://en.wikipedia.org/wiki/File:3-coloringEx.svg without one vertex)
// - 6-vertex graph from https://en.wikipedia.org/wiki/File:3-coloringEx.svg
function ExampleGraphs () : (Int, (Int, Int)[])[] {
return [(3, new (Int, Int)[0]),
return [(3, []),
(4, [(0, 1), (0, 2), (0, 3), (1, 2), (1, 3), (2, 3)]),
(5, [(4, 0), (2, 1), (3, 1), (3, 2)]),
(5, [(0, 1), (1, 2), (1, 3), (3, 2), (4, 2), (3, 4)]),

Просмотреть файл

@ -81,7 +81,7 @@ namespace Quantum.Kata.KeyDistribution {
function GenerateSharedKey_Reference (basesAlice : Bool[], basesBob : Bool[], measurementsBob : Bool[]) : Bool[] {
// If Alice and Bob used the same basis, they will have the same value of the bit.
// The shared key consists of those bits.
mutable key = new Bool[0];
mutable key = [];
for (a, b, bit) in Zipped3(basesAlice, basesBob, measurementsBob) {
if (a == b) {
set key += [bit];

Просмотреть файл

@ -143,7 +143,7 @@ namespace Quantum.Kata.KeyDistribution {
Fact(Length(qs) == Length(bases), "Input arrays should have the same length");
// ...
return new Bool[0];
return [];
}
@ -170,7 +170,7 @@ namespace Quantum.Kata.KeyDistribution {
Fact(Length(basesAlice) == Length(measurementsBob), "Input arrays should have the same length");
// ...
return new Bool[0];
return [];
}

Просмотреть файл

@ -24,7 +24,7 @@ namespace Microsoft.Quantum.Kata.QuantumClassification {
// The definition of classifier structure for the case when the data is linearly separable and fits into 1 qubit
function ClassifierStructure() : ControlledRotation[] {
return [
ControlledRotation((0, new Int[0]), PauliY, 0)
ControlledRotation((0, []), PauliY, 0)
];
}

Просмотреть файл

@ -89,7 +89,7 @@ namespace Quantum.Kata.VisualizationTools {
// Normalize the amplitudes, to check the answer programmatically.
let amplitudesNorm = PNormalized(2.0, amplitudes);
// Filter out the amplitudes bigger than the threshold.
mutable expected = new Int[0];
mutable expected = [];
for i in IndexRange(amplitudes) {
if amplitudesNorm[i] > 0.01 {
set expected += [i];