From 7f4d22b38f3d0db36e20ff1f0bb1ec26eaa1258c Mon Sep 17 00:00:00 2001 From: Frances Tibble Date: Sat, 13 Apr 2024 10:51:46 +0100 Subject: [PATCH 01/18] initial migration with edits --- .../four_bitstrings/Placeholder.qs | 7 ++ .../superposition/four_bitstrings/Solution.qs | 26 +++++++ .../four_bitstrings/Verification.qs | 78 +++++++++++++++++++ .../superposition/four_bitstrings/index.md | 14 ++++ .../superposition/four_bitstrings/solution.md | 26 +++++++ katas/content/superposition/index.md | 10 +++ 6 files changed, 161 insertions(+) create mode 100644 katas/content/superposition/four_bitstrings/Placeholder.qs create mode 100644 katas/content/superposition/four_bitstrings/Solution.qs create mode 100644 katas/content/superposition/four_bitstrings/Verification.qs create mode 100644 katas/content/superposition/four_bitstrings/index.md create mode 100644 katas/content/superposition/four_bitstrings/solution.md diff --git a/katas/content/superposition/four_bitstrings/Placeholder.qs b/katas/content/superposition/four_bitstrings/Placeholder.qs new file mode 100644 index 0000000000..97e8bf3295 --- /dev/null +++ b/katas/content/superposition/four_bitstrings/Placeholder.qs @@ -0,0 +1,7 @@ +namespace Kata { + operation FourBitstringSuperposition (qs : Qubit[], bits : Bool[][]) : Unit { + // Hint: remember that you can allocate extra qubits. + + // Implement your solution here... + } +} diff --git a/katas/content/superposition/four_bitstrings/Solution.qs b/katas/content/superposition/four_bitstrings/Solution.qs new file mode 100644 index 0000000000..fa1cde28a9 --- /dev/null +++ b/katas/content/superposition/four_bitstrings/Solution.qs @@ -0,0 +1,26 @@ +namespace Kata { + operation FourBitstringSuperposition (qs : Qubit[], bits : Bool[][]) : Unit is Adj { + use anc = Qubit[2]; + // Put two ancillas into equal superposition of 2-qubit basis states + ApplyToEachA(H, anc); + + // Set up the right pattern on the main qubits with control on ancillas + for i in 0 .. 3 { + for j in 0 .. Length(qs) - 1 { + if bits[i][j] { + (ApplyControlledOnInt(i, X))(anc, qs[j]); + } + } + } + + // Uncompute the ancillas, using patterns on main qubits as control + for i in 0 .. 3 { + if i % 2 == 1 { + (ApplyControlledOnBitString(bits[i], X))(qs, anc[0]); + } + if i / 2 == 1 { + (ApplyControlledOnBitString(bits[i], X))(qs, anc[1]); + } + } + } +} diff --git a/katas/content/superposition/four_bitstrings/Verification.qs b/katas/content/superposition/four_bitstrings/Verification.qs new file mode 100644 index 0000000000..0876e8cb3e --- /dev/null +++ b/katas/content/superposition/four_bitstrings/Verification.qs @@ -0,0 +1,78 @@ +namespace Kata.Verification { + open Microsoft.Quantum.Convert; + open Microsoft.Quantum.Katas; + + operation FourBitstringSuperposition_Reference (qs : Qubit[], bits : Bool[][]) : Unit is Adj { + use anc = Qubit[2]; + ApplyToEachA(H, anc); + + for i in 0 .. 3 { + for j in 0 .. Length(qs) - 1 { + if bits[i][j] { + (ApplyControlledOnInt(i, X))(anc, qs[j]); + } + } + } + + for i in 0 .. 3 { + if i % 2 == 1 { + (ApplyControlledOnBitString(bits[i], X))(qs, anc[0]); + } + if i / 2 == 1 { + (ApplyControlledOnBitString(bits[i], X))(qs, anc[1]); + } + } + } +// AssertEqualOnZeroState(n, EvenOddNumbersSuperposition(_, isEven), EvenOddNumbersSuperposition_Reference(_, isEven), false, ""); +// if not CheckOperationsEquivalenceOnZeroStateWithFeedback( +// Kata.EvenOddNumbersSuperposition(_, boolVal), +// EvenOddNumbersSuperposition_Reference(_, boolVal), +// i) { +// return false; +// } + @EntryPoint() + operation CheckSolution() : Bool { + + // cross-tests + mutable bits = [[false, false], [false, true], [true, false], [true, true]]; + if not CheckOperationsEquivalenceOnZeroStateWithFeedback( + FourBitstringSuperposition(_, bits), + ApplyToEachA(H, _), + 2 + ) { + return false; + } + + // random tests + for N in 3 .. 10 { + // generate 4 distinct numbers corresponding to the bit strings + mutable numbers = [0, size = 4]; + + repeat { + mutable ok = true; + for i in 0 .. 3 { + set numbers w/= i <- DrawRandomInt(0, 1 <<< N - 1); + for j in 0 .. i - 1 { + if numbers[i] == numbers[j] { + set ok = false; + } + } + } + } + until (ok); + + // convert numbers to bit strings + for i in 0 .. 3 { + set bits w/= i <- IntAsBoolArray(numbers[i], N); + } + + if not CheckOperationsEquivalenceOnZeroStateWithFeedback( + FourBitstringSuperposition(_, bits), + FourBitstringSuperposition_Reference(_, bits), + N + ) { + return false; + } + } + } +} diff --git a/katas/content/superposition/four_bitstrings/index.md b/katas/content/superposition/four_bitstrings/index.md new file mode 100644 index 0000000000..e164f7f4bf --- /dev/null +++ b/katas/content/superposition/four_bitstrings/index.md @@ -0,0 +1,14 @@ +**Inputs:** + +1. $N$ qubits in the $|0 \dots 0\rangle$ state. +2. Four bit string represented as `Bool[][]` `bits`. + + `bits` is an array of size $4 * N$ which describes the bit strings as follows: + - `bits[i]` describes the *i*th bit string and has $N$ elements. + - All four bit strings will be distinct. + +**Goal:** Create an equal superposition of the four basis states given by the bit strings. + +**Example:** + +For $N = 3$ and `bits = [[false, true, false], [true, false, false], [false, false, true], [true, true, false]]`, the state you need to prepare is $\frac{1}{2} \big(|010\rangle + |100\rangle + |001\rangle + |110\rangle\big)$. diff --git a/katas/content/superposition/four_bitstrings/solution.md b/katas/content/superposition/four_bitstrings/solution.md new file mode 100644 index 0000000000..faaabae8fe --- /dev/null +++ b/katas/content/superposition/four_bitstrings/solution.md @@ -0,0 +1,26 @@ +We are going to use the same trick of auxiliary qubits that we used in the previous task. + +Since the desired superposition has 4 basis states with equal amplitudes, we are going to need two qubits to define a unique basis to control preparation of each of the basis states in the superposition. + +We start by allocating two extra qubits and preparing an equal superposition of all 2-qubit states on them by applying an H gate to each of them: + +$$\frac12 (|00\rangle + |01\rangle + |10\rangle + |11\rangle)_a \otimes |0 \dots 0\rangle_r$$ + +Then, for each of the four given bit strings, we walk through it and prepare the matching basis state on the main register of qubits, using controlled X gates with the corresponding basis state of the auxiliary qubits as control. + +For example, when preparing the bit string `bits[0]`, we apply X gates controlled on the basis state $|00\rangle$; when preparing the bit string `bits[1]`, we apply X gates controlled on $|10\rangle$, and so on. + +> We can choose an arbitrary matching of the 2-qubit basis states used as controls and the bit strings prepared on the main register. +> Since all amplitudes are the same, the result does not depend on which state controlled which bit string preparation. +> It can be convenient to use indices of the bit strings, converted to little-endian, to control preparation of the bit strings. +> Q# library function [`ApplyControlledOnInt`](https://learn.microsoft.com/en-us/qsharp/api/qsharp-lang/microsoft.quantum.canon/applycontrolledonint) does exactly that. + +After this the system will be in the state + +$$\frac12 (|00\rangle_a |bits_0\rangle_r + |10\rangle_a |bits_1\rangle_r + |01\rangle_a |bits_2\rangle_r + |11\rangle_a |bits_3\rangle_r)$$ + +As the last step, we must uncompute the auxiliary qubits, i.e., return them to the $|00\\rangle$ state to unentangle them from the main register. + +Same as we did in the previous task, we will use [`ApplyControlledOnBitString`](https://learn.microsoft.com/en-us/qsharp/api/qsharp-lang/microsoft.quantum.canon/applycontrolledonbitstring) with the corresponding bit string and the X operation as arguments, the quantum register as the control, and the auxiliary qubits as the target. + +We will uncompute each of them separately, so one of the auxiliary qubits will be uncomputed with the `bits[1]` and `bits[3]` bit strings as controls, and the other - with the `bits[2]` and `bits[3]`. diff --git a/katas/content/superposition/index.md b/katas/content/superposition/index.md index bd1c0207ad..06441d0805 100644 --- a/katas/content/superposition/index.md +++ b/katas/content/superposition/index.md @@ -123,6 +123,16 @@ This kata is designed to get you familiar with the concept of superposition and ] }) +@[exercise]({ + "id": "superposition__four_bitstrings", + "title": "Four Bitstrings", + "path": "./four_bitstrings/", + "qsDependencies": [ + "../KatasLibrary.qs", + "./Common.qs" + ] +}) + @[section]({ "id": "superposition__uneven_superpositions", "title": "Uneven superpositions" From 05058ba27022eb6dc6940f60c46d3e9e98c99076 Mon Sep 17 00:00:00 2001 From: Frances Tibble Date: Sat, 13 Apr 2024 10:48:24 +0000 Subject: [PATCH 02/18] remove commented code --- .../content/superposition/four_bitstrings/Verification.qs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/katas/content/superposition/four_bitstrings/Verification.qs b/katas/content/superposition/four_bitstrings/Verification.qs index 0876e8cb3e..3b0907bd18 100644 --- a/katas/content/superposition/four_bitstrings/Verification.qs +++ b/katas/content/superposition/four_bitstrings/Verification.qs @@ -23,13 +23,7 @@ namespace Kata.Verification { } } } -// AssertEqualOnZeroState(n, EvenOddNumbersSuperposition(_, isEven), EvenOddNumbersSuperposition_Reference(_, isEven), false, ""); -// if not CheckOperationsEquivalenceOnZeroStateWithFeedback( -// Kata.EvenOddNumbersSuperposition(_, boolVal), -// EvenOddNumbersSuperposition_Reference(_, boolVal), -// i) { -// return false; -// } + @EntryPoint() operation CheckSolution() : Bool { From 7ca77eca278cc672b9bc4d341691613ac2077b8c Mon Sep 17 00:00:00 2001 From: Frances Tibble Date: Sat, 13 Apr 2024 11:00:53 +0000 Subject: [PATCH 03/18] add return --- katas/content/superposition/four_bitstrings/Verification.qs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/katas/content/superposition/four_bitstrings/Verification.qs b/katas/content/superposition/four_bitstrings/Verification.qs index 3b0907bd18..ea3f135372 100644 --- a/katas/content/superposition/four_bitstrings/Verification.qs +++ b/katas/content/superposition/four_bitstrings/Verification.qs @@ -68,5 +68,7 @@ namespace Kata.Verification { return false; } } + + return true; } } From d9df531d9cb1ee10a1b265d1b11f03f3c02a0bbe Mon Sep 17 00:00:00 2001 From: Frances Tibble Date: Sat, 13 Apr 2024 11:19:54 +0000 Subject: [PATCH 04/18] add wstate check --- .../four_bitstrings/Verification.qs | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/katas/content/superposition/four_bitstrings/Verification.qs b/katas/content/superposition/four_bitstrings/Verification.qs index ea3f135372..8b63eb064f 100644 --- a/katas/content/superposition/four_bitstrings/Verification.qs +++ b/katas/content/superposition/four_bitstrings/Verification.qs @@ -24,6 +24,27 @@ namespace Kata.Verification { } } + operation WState_Arbitrary_Reference (qs : Qubit[]) : Unit is Adj + Ctl { + + let N = Length(qs); + + if N ==1 { + // base case of recursion: |1⟩ + X(qs[0]); + } else { + // |W_N⟩ = |0⟩|W_(N-1)⟩ + |1⟩|0...0⟩ + // do a rotation on the first qubit to split it into |0⟩ and |1⟩ with proper weights + // |0⟩ -> sqrt((N-1)/N) |0⟩ + 1/sqrt(N) |1⟩ + let theta = ArcSin(1.0 / Sqrt(IntAsDouble(N))); + Ry(2.0 * theta, qs[0]); + + // do a zero-controlled W-state generation for qubits 1..N-1 + X(qs[0]); + Controlled WState_Arbitrary_Reference(qs[0 .. 0], qs[1 .. N - 1]); + X(qs[0]); + } + } + @EntryPoint() operation CheckSolution() : Bool { @@ -37,6 +58,15 @@ namespace Kata.Verification { return false; } + set bits = [[false, false, false, true], [false, false, true, false], [false, true, false, false], [true, false, false, false]]; + if not CheckOperationsEquivalenceOnZeroStateWithFeedback( + FourBitstringSuperposition(_, bits), + WState_Arbitrary_Reference(_), + 4 + ) { + return false; + } + // random tests for N in 3 .. 10 { // generate 4 distinct numbers corresponding to the bit strings From 6a98fbdda24b1c9d572f5e893b97af8950a4b9f7 Mon Sep 17 00:00:00 2001 From: frtibble <32080479+frtibble@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:30:43 +0100 Subject: [PATCH 05/18] Update katas/content/superposition/four_bitstrings/Verification.qs Co-authored-by: James Kingdon <96249042+jkingdon-ms@users.noreply.github.com> --- katas/content/superposition/four_bitstrings/Verification.qs | 1 + 1 file changed, 1 insertion(+) diff --git a/katas/content/superposition/four_bitstrings/Verification.qs b/katas/content/superposition/four_bitstrings/Verification.qs index 8b63eb064f..eb001e5042 100644 --- a/katas/content/superposition/four_bitstrings/Verification.qs +++ b/katas/content/superposition/four_bitstrings/Verification.qs @@ -50,6 +50,7 @@ namespace Kata.Verification { // cross-tests mutable bits = [[false, false], [false, true], [true, false], [true, true]]; + Message($"Testing for bits = {bits}..."); if not CheckOperationsEquivalenceOnZeroStateWithFeedback( FourBitstringSuperposition(_, bits), ApplyToEachA(H, _), From 83d8496e162f01ccb86353e41dcdb4213edb0b74 Mon Sep 17 00:00:00 2001 From: Frances Tibble Date: Thu, 18 Apr 2024 16:34:50 +0000 Subject: [PATCH 06/18] add test message --- katas/content/superposition/four_bitstrings/Verification.qs | 1 + 1 file changed, 1 insertion(+) diff --git a/katas/content/superposition/four_bitstrings/Verification.qs b/katas/content/superposition/four_bitstrings/Verification.qs index eb001e5042..3c641bb652 100644 --- a/katas/content/superposition/four_bitstrings/Verification.qs +++ b/katas/content/superposition/four_bitstrings/Verification.qs @@ -60,6 +60,7 @@ namespace Kata.Verification { } set bits = [[false, false, false, true], [false, false, true, false], [false, true, false, false], [true, false, false, false]]; + Message($"Testing for bits = {bits}..."); if not CheckOperationsEquivalenceOnZeroStateWithFeedback( FourBitstringSuperposition(_, bits), WState_Arbitrary_Reference(_), From a44f10601060f8748352ab78a666194c31f08158 Mon Sep 17 00:00:00 2001 From: frtibble <32080479+frtibble@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:35:17 +0100 Subject: [PATCH 07/18] Update katas/content/superposition/four_bitstrings/solution.md Co-authored-by: James Kingdon <96249042+jkingdon-ms@users.noreply.github.com> --- katas/content/superposition/four_bitstrings/solution.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/katas/content/superposition/four_bitstrings/solution.md b/katas/content/superposition/four_bitstrings/solution.md index faaabae8fe..6d16f8bc53 100644 --- a/katas/content/superposition/four_bitstrings/solution.md +++ b/katas/content/superposition/four_bitstrings/solution.md @@ -24,3 +24,9 @@ As the last step, we must uncompute the auxiliary qubits, i.e., return them to t Same as we did in the previous task, we will use [`ApplyControlledOnBitString`](https://learn.microsoft.com/en-us/qsharp/api/qsharp-lang/microsoft.quantum.canon/applycontrolledonbitstring) with the corresponding bit string and the X operation as arguments, the quantum register as the control, and the auxiliary qubits as the target. We will uncompute each of them separately, so one of the auxiliary qubits will be uncomputed with the `bits[1]` and `bits[3]` bit strings as controls, and the other - with the `bits[2]` and `bits[3]`. + +@[solution]({ + "id": "superposition__four_bitstrings_solution_a", + "codePath": "./SolutionA.qs" +}) + From 060fca00dc1bc60fab45ab9288fa8101e33f8e42 Mon Sep 17 00:00:00 2001 From: Frances Tibble Date: Thu, 18 Apr 2024 16:50:57 +0000 Subject: [PATCH 08/18] rename to SolutionA --- .../superposition/four_bitstrings/{Solution.qs => SolutionA.qs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename katas/content/superposition/four_bitstrings/{Solution.qs => SolutionA.qs} (100%) diff --git a/katas/content/superposition/four_bitstrings/Solution.qs b/katas/content/superposition/four_bitstrings/SolutionA.qs similarity index 100% rename from katas/content/superposition/four_bitstrings/Solution.qs rename to katas/content/superposition/four_bitstrings/SolutionA.qs From 9e9c8596e825ab24058d28527d1b14fedb38c22e Mon Sep 17 00:00:00 2001 From: Frances Tibble Date: Thu, 18 Apr 2024 16:51:17 +0000 Subject: [PATCH 09/18] add SolutionB --- .../four_bitstrings/SolutionB.qs | 37 +++++++++++++++++++ .../superposition/four_bitstrings/solution.md | 30 ++++++++++++++- 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 katas/content/superposition/four_bitstrings/SolutionB.qs diff --git a/katas/content/superposition/four_bitstrings/SolutionB.qs b/katas/content/superposition/four_bitstrings/SolutionB.qs new file mode 100644 index 0000000000..eee67f1099 --- /dev/null +++ b/katas/content/superposition/four_bitstrings/SolutionB.qs @@ -0,0 +1,37 @@ +namespace Kata { + operation FourBitstringSuperposition (qs : Qubit[], bits : Bool[][]) : Unit { + FourBitstringSuperposition_Recursive([], qs, bits); + } + + operation FourBitstringSuperposition_Recursive (currentBitString : Bool[], qs : Qubit[], bits : Bool[][]) : Unit { + // an array of bit strings whose columns we are considering begin with |0⟩ + mutable zeroLeads = []; + // an array of bit strings whose columns we are considering begin with |1⟩ + mutable oneLeads = []; + // the number of bit strings we're considering + let rows = Length(bits); + // the current position we're considering + let currentIndex = Length(currentBitString); + + if rows >= 1 and currentIndex < Length(qs) { + // figure out what percentage of the bits should be |0⟩ + for row in 0 .. rows - 1 { + if bits[row][currentIndex] { + set oneLeads = oneLeads + [bits[row]]; + } else { + set zeroLeads = zeroLeads + [bits[row]]; + } + } + // rotate the qubit to adjust coefficients based on the previous bit string + // for the first path through, when the bit string has zero length, + // the Controlled version of the rotation will perform a regular rotation + let theta = ArcCos(Sqrt(IntAsDouble(Length(zeroLeads)) / IntAsDouble(rows))); + (ApplyControlledOnBitString(currentBitString, Ry))(qs[0 .. currentIndex - 1], + (2.0 * theta, qs[currentIndex])); + + // call state preparation recursively based on the bit strings so far + FourBitstringSuperposition_Recursive(currentBitString + [false], qs, zeroLeads); + FourBitstringSuperposition_Recursive(currentBitString + [true], qs, oneLeads); + } + } +} diff --git a/katas/content/superposition/four_bitstrings/solution.md b/katas/content/superposition/four_bitstrings/solution.md index 6d16f8bc53..24d412d430 100644 --- a/katas/content/superposition/four_bitstrings/solution.md +++ b/katas/content/superposition/four_bitstrings/solution.md @@ -19,7 +19,7 @@ After this the system will be in the state $$\frac12 (|00\rangle_a |bits_0\rangle_r + |10\rangle_a |bits_1\rangle_r + |01\rangle_a |bits_2\rangle_r + |11\rangle_a |bits_3\rangle_r)$$ -As the last step, we must uncompute the auxiliary qubits, i.e., return them to the $|00\\rangle$ state to unentangle them from the main register. +As the last step, we must uncompute the auxiliary qubits, i.e., return them to the $|00\rangle$ state to unentangle them from the main register. Same as we did in the previous task, we will use [`ApplyControlledOnBitString`](https://learn.microsoft.com/en-us/qsharp/api/qsharp-lang/microsoft.quantum.canon/applycontrolledonbitstring) with the corresponding bit string and the X operation as arguments, the quantum register as the control, and the auxiliary qubits as the target. @@ -30,3 +30,31 @@ We will uncompute each of them separately, so one of the auxiliary qubits will b "codePath": "./SolutionA.qs" }) +We are going to leverage the recursion abilities of Q# to create a superposition of the four bit strings. This solution also extends to an arbitrary number of bit strings with no code changes. + +For this process we will look at the first bits of each string and adjust the probability of measuring a $|0\rangle$ or $|1\rangle$ accordingly on the first qubit of our answer. We will then recursively call (as needed) the process again to adjust the probabilities of measurement on the second bit depending on the first bit. This process recurses until no more input bits are provided. + +Consider for example the following four bit strings on which to create a superposition: $|001\rangle, |101\rangle, |111\rangle, |110\rangle$. + +We can rewrite the superposition state we need to prepare as + +$$\frac12 \big(|001\rangle + |101\rangle + |111\rangle + |110\rangle \big) = \frac12 |0\rangle \otimes |01\rangle + \frac{\sqrt3}{2} |1\rangle \otimes \frac{1}{\sqrt3} \big(|10\rangle + |11\rangle + |10\rangle \big)$$ + +As the first step of the solution, we need to prepare a state $\frac12 |0\rangle + \frac{\sqrt3}{2} |1\rangle$ on the first qubit (to measure $|0\rangle$ with $\frac14$ probability and to measure $|1\rangle$ with $\frac34$ probability). To do this, we will apply an [`Ry`](https://learn.microsoft.com/en-us/qsharp/api/qsharp-lang/microsoft.quantum.intrinsic/ry) rotation to the first qubit. + +After this, we'll need to prepare the rest of the qubits in appropriate states depending on the state of the first qubit - state $|01\rangle$ if the first qubit is in state $|0\rangle$ and state $\frac{1}{\sqrt3} \big(|10\rangle + |11\rangle + |10\rangle \big)$ if the first qubit is in state $|1\rangle$. We can do this recursively using the same logic. Let's finish walking through this example in detail. + +The second qubit of the recursion follows similarly but depends on the first qubit. If the first qubit measures $|0\rangle$, then we want the second qubit to measure $|0\rangle$ with 100% probability, but if it measures $|1\rangle$, we want it to measure $|0\rangle$ with $\frac13$ probability and $|1\rangle$ with $\frac23$ probability. For this, we can do a controlled [`Ry`](https://learn.microsoft.com/en-us/qsharp/api/qsharp-lang/microsoft.quantum.intrinsic/ry) rotation on the second qubit with the first qubit as control. + +The third qubit in this example will have three cases because it depends on the first two qubits; this follows naturally from the recursion. + +1. If the first two qubits measure $|00\rangle$, then we need the third qubit to measure $|0\rangle$ with 100% probability. +2. If the first two qubits measure $|10\rangle$, then we need the third qubit to measure $|1\rangle$ with 100% probability. +3. If the first two qubits measure $|11\rangle$, then we need the third qubit to measure $|0\rangle$ with $\frac12$ probability and $|1\rangle$ with $\frac12$ probability. Just as with the second qubit, a controlled [`Ry`](https://learn.microsoft.com/en-us/qsharp/api/qsharp-lang/microsoft.quantum.intrinsic/ry) rotation on the third qubit will accomplish this goal. + +> We will use [`ApplyControlledOnBitString`](https://learn.microsoft.com/en-us/qsharp/api/qsharp-lang/microsoft.quantum.canon/applycontrolledonbitstring) operation to perform rotations depending on the state of several previous qubits. + +@[solution]({ + "id": "superposition__four_bitstrings_solution_b", + "codePath": "./SolutionB.qs" +}) From c60098ce848a01b7144f0886ea28c851800a6da4 Mon Sep 17 00:00:00 2001 From: frtibble <32080479+frtibble@users.noreply.github.com> Date: Thu, 18 Apr 2024 19:30:06 +0100 Subject: [PATCH 10/18] Update katas/content/superposition/four_bitstrings/Verification.qs Co-authored-by: Mariia Mykhailova --- katas/content/superposition/four_bitstrings/Verification.qs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/katas/content/superposition/four_bitstrings/Verification.qs b/katas/content/superposition/four_bitstrings/Verification.qs index 3c641bb652..ff41292c7b 100644 --- a/katas/content/superposition/four_bitstrings/Verification.qs +++ b/katas/content/superposition/four_bitstrings/Verification.qs @@ -93,7 +93,7 @@ namespace Kata.Verification { } if not CheckOperationsEquivalenceOnZeroStateWithFeedback( - FourBitstringSuperposition(_, bits), + Kata.FourBitstringSuperposition(_, bits), FourBitstringSuperposition_Reference(_, bits), N ) { From 06a9d8306ea3535c795dc0ba07e870a983ee1625 Mon Sep 17 00:00:00 2001 From: frtibble <32080479+frtibble@users.noreply.github.com> Date: Thu, 18 Apr 2024 19:30:15 +0100 Subject: [PATCH 11/18] Update katas/content/superposition/four_bitstrings/Verification.qs Co-authored-by: Mariia Mykhailova --- katas/content/superposition/four_bitstrings/Verification.qs | 1 + 1 file changed, 1 insertion(+) diff --git a/katas/content/superposition/four_bitstrings/Verification.qs b/katas/content/superposition/four_bitstrings/Verification.qs index ff41292c7b..c227aafb9e 100644 --- a/katas/content/superposition/four_bitstrings/Verification.qs +++ b/katas/content/superposition/four_bitstrings/Verification.qs @@ -1,6 +1,7 @@ namespace Kata.Verification { open Microsoft.Quantum.Convert; open Microsoft.Quantum.Katas; + open Microsoft.Quantum.Math; operation FourBitstringSuperposition_Reference (qs : Qubit[], bits : Bool[][]) : Unit is Adj { use anc = Qubit[2]; From 73d0062b0ea34ebab3349e01075e94de94f2ccf6 Mon Sep 17 00:00:00 2001 From: Frances Tibble Date: Thu, 18 Apr 2024 18:33:00 +0000 Subject: [PATCH 12/18] add import --- katas/content/superposition/four_bitstrings/Verification.qs | 1 + 1 file changed, 1 insertion(+) diff --git a/katas/content/superposition/four_bitstrings/Verification.qs b/katas/content/superposition/four_bitstrings/Verification.qs index c227aafb9e..e50a63e084 100644 --- a/katas/content/superposition/four_bitstrings/Verification.qs +++ b/katas/content/superposition/four_bitstrings/Verification.qs @@ -2,6 +2,7 @@ namespace Kata.Verification { open Microsoft.Quantum.Convert; open Microsoft.Quantum.Katas; open Microsoft.Quantum.Math; + open Microsoft.Quantum.Random; operation FourBitstringSuperposition_Reference (qs : Qubit[], bits : Bool[][]) : Unit is Adj { use anc = Qubit[2]; From da22f6cc9e63e66e608ac037979ca8701eaf8a3a Mon Sep 17 00:00:00 2001 From: Frances Tibble Date: Thu, 18 Apr 2024 18:35:55 +0000 Subject: [PATCH 13/18] remove en-us --- .../superposition/four_bitstrings/solution.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/katas/content/superposition/four_bitstrings/solution.md b/katas/content/superposition/four_bitstrings/solution.md index 24d412d430..4adafa16da 100644 --- a/katas/content/superposition/four_bitstrings/solution.md +++ b/katas/content/superposition/four_bitstrings/solution.md @@ -13,7 +13,7 @@ For example, when preparing the bit string `bits[0]`, we apply X gates controlle > We can choose an arbitrary matching of the 2-qubit basis states used as controls and the bit strings prepared on the main register. > Since all amplitudes are the same, the result does not depend on which state controlled which bit string preparation. > It can be convenient to use indices of the bit strings, converted to little-endian, to control preparation of the bit strings. -> Q# library function [`ApplyControlledOnInt`](https://learn.microsoft.com/en-us/qsharp/api/qsharp-lang/microsoft.quantum.canon/applycontrolledonint) does exactly that. +> Q# library function [`ApplyControlledOnInt`](https://learn.microsoft.com/qsharp/api/qsharp-lang/microsoft.quantum.canon/applycontrolledonint) does exactly that. After this the system will be in the state @@ -21,7 +21,7 @@ $$\frac12 (|00\rangle_a |bits_0\rangle_r + |10\rangle_a |bits_1\rangle_r + |01\r As the last step, we must uncompute the auxiliary qubits, i.e., return them to the $|00\rangle$ state to unentangle them from the main register. -Same as we did in the previous task, we will use [`ApplyControlledOnBitString`](https://learn.microsoft.com/en-us/qsharp/api/qsharp-lang/microsoft.quantum.canon/applycontrolledonbitstring) with the corresponding bit string and the X operation as arguments, the quantum register as the control, and the auxiliary qubits as the target. +Same as we did in the previous task, we will use [`ApplyControlledOnBitString`](https://learn.microsoft.com/qsharp/api/qsharp-lang/microsoft.quantum.canon/applycontrolledonbitstring) with the corresponding bit string and the X operation as arguments, the quantum register as the control, and the auxiliary qubits as the target. We will uncompute each of them separately, so one of the auxiliary qubits will be uncomputed with the `bits[1]` and `bits[3]` bit strings as controls, and the other - with the `bits[2]` and `bits[3]`. @@ -40,19 +40,19 @@ We can rewrite the superposition state we need to prepare as $$\frac12 \big(|001\rangle + |101\rangle + |111\rangle + |110\rangle \big) = \frac12 |0\rangle \otimes |01\rangle + \frac{\sqrt3}{2} |1\rangle \otimes \frac{1}{\sqrt3} \big(|10\rangle + |11\rangle + |10\rangle \big)$$ -As the first step of the solution, we need to prepare a state $\frac12 |0\rangle + \frac{\sqrt3}{2} |1\rangle$ on the first qubit (to measure $|0\rangle$ with $\frac14$ probability and to measure $|1\rangle$ with $\frac34$ probability). To do this, we will apply an [`Ry`](https://learn.microsoft.com/en-us/qsharp/api/qsharp-lang/microsoft.quantum.intrinsic/ry) rotation to the first qubit. +As the first step of the solution, we need to prepare a state $\frac12 |0\rangle + \frac{\sqrt3}{2} |1\rangle$ on the first qubit (to measure $|0\rangle$ with $\frac14$ probability and to measure $|1\rangle$ with $\frac34$ probability). To do this, we will apply an [`Ry`](https://learn.microsoft.com/qsharp/api/qsharp-lang/microsoft.quantum.intrinsic/ry) rotation to the first qubit. After this, we'll need to prepare the rest of the qubits in appropriate states depending on the state of the first qubit - state $|01\rangle$ if the first qubit is in state $|0\rangle$ and state $\frac{1}{\sqrt3} \big(|10\rangle + |11\rangle + |10\rangle \big)$ if the first qubit is in state $|1\rangle$. We can do this recursively using the same logic. Let's finish walking through this example in detail. -The second qubit of the recursion follows similarly but depends on the first qubit. If the first qubit measures $|0\rangle$, then we want the second qubit to measure $|0\rangle$ with 100% probability, but if it measures $|1\rangle$, we want it to measure $|0\rangle$ with $\frac13$ probability and $|1\rangle$ with $\frac23$ probability. For this, we can do a controlled [`Ry`](https://learn.microsoft.com/en-us/qsharp/api/qsharp-lang/microsoft.quantum.intrinsic/ry) rotation on the second qubit with the first qubit as control. +The second qubit of the recursion follows similarly but depends on the first qubit. If the first qubit measures $|0\rangle$, then we want the second qubit to measure $|0\rangle$ with 100% probability, but if it measures $|1\rangle$, we want it to measure $|0\rangle$ with $\frac13$ probability and $|1\rangle$ with $\frac23$ probability. For this, we can do a controlled [`Ry`](https://learn.microsoft.com/qsharp/api/qsharp-lang/microsoft.quantum.intrinsic/ry) rotation on the second qubit with the first qubit as control. The third qubit in this example will have three cases because it depends on the first two qubits; this follows naturally from the recursion. 1. If the first two qubits measure $|00\rangle$, then we need the third qubit to measure $|0\rangle$ with 100% probability. 2. If the first two qubits measure $|10\rangle$, then we need the third qubit to measure $|1\rangle$ with 100% probability. -3. If the first two qubits measure $|11\rangle$, then we need the third qubit to measure $|0\rangle$ with $\frac12$ probability and $|1\rangle$ with $\frac12$ probability. Just as with the second qubit, a controlled [`Ry`](https://learn.microsoft.com/en-us/qsharp/api/qsharp-lang/microsoft.quantum.intrinsic/ry) rotation on the third qubit will accomplish this goal. +3. If the first two qubits measure $|11\rangle$, then we need the third qubit to measure $|0\rangle$ with $\frac12$ probability and $|1\rangle$ with $\frac12$ probability. Just as with the second qubit, a controlled [`Ry`](https://learn.microsoft.com/qsharp/api/qsharp-lang/microsoft.quantum.intrinsic/ry) rotation on the third qubit will accomplish this goal. -> We will use [`ApplyControlledOnBitString`](https://learn.microsoft.com/en-us/qsharp/api/qsharp-lang/microsoft.quantum.canon/applycontrolledonbitstring) operation to perform rotations depending on the state of several previous qubits. +> We will use [`ApplyControlledOnBitString`](https://learn.microsoft.com/qsharp/api/qsharp-lang/microsoft.quantum.canon/applycontrolledonbitstring) operation to perform rotations depending on the state of several previous qubits. @[solution]({ "id": "superposition__four_bitstrings_solution_b", From 0a4be03db7ef2a82fdffea4699f1456feb9b3e3d Mon Sep 17 00:00:00 2001 From: Frances Tibble Date: Thu, 18 Apr 2024 18:40:06 +0000 Subject: [PATCH 14/18] add to index --- katas/content/index.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/katas/content/index.json b/katas/content/index.json index f1536c33d9..3f18d36a5d 100644 --- a/katas/content/index.json +++ b/katas/content/index.json @@ -11,5 +11,6 @@ "random_numbers", "oracles", "deutsch_algo", - "deutsch_jozsa" + "deutsch_jozsa", + "superposition" ] From 535aae7813ff5f0bc99d4ea2aa94a8a74f1201d2 Mon Sep 17 00:00:00 2001 From: Frances Tibble Date: Mon, 22 Apr 2024 11:10:13 +0000 Subject: [PATCH 15/18] fix build --- .../four_bitstrings/SolutionA.qs | 8 ++-- .../four_bitstrings/SolutionB.qs | 5 ++- .../four_bitstrings/Verification.qs | 44 +++---------------- 3 files changed, 14 insertions(+), 43 deletions(-) diff --git a/katas/content/superposition/four_bitstrings/SolutionA.qs b/katas/content/superposition/four_bitstrings/SolutionA.qs index fa1cde28a9..fcaf4bf190 100644 --- a/katas/content/superposition/four_bitstrings/SolutionA.qs +++ b/katas/content/superposition/four_bitstrings/SolutionA.qs @@ -1,5 +1,5 @@ namespace Kata { - operation FourBitstringSuperposition (qs : Qubit[], bits : Bool[][]) : Unit is Adj { + operation FourBitstringSuperposition (qs : Qubit[], bits : Bool[][]) : Unit { use anc = Qubit[2]; // Put two ancillas into equal superposition of 2-qubit basis states ApplyToEachA(H, anc); @@ -8,7 +8,7 @@ namespace Kata { for i in 0 .. 3 { for j in 0 .. Length(qs) - 1 { if bits[i][j] { - (ApplyControlledOnInt(i, X))(anc, qs[j]); + ApplyControlledOnInt(i, X, anc, qs[j]); } } } @@ -16,10 +16,10 @@ namespace Kata { // Uncompute the ancillas, using patterns on main qubits as control for i in 0 .. 3 { if i % 2 == 1 { - (ApplyControlledOnBitString(bits[i], X))(qs, anc[0]); + ApplyControlledOnBitString(bits[i], X, qs, anc[0]); } if i / 2 == 1 { - (ApplyControlledOnBitString(bits[i], X))(qs, anc[1]); + ApplyControlledOnBitString(bits[i], X, qs, anc[1]); } } } diff --git a/katas/content/superposition/four_bitstrings/SolutionB.qs b/katas/content/superposition/four_bitstrings/SolutionB.qs index eee67f1099..10c62a3a0f 100644 --- a/katas/content/superposition/four_bitstrings/SolutionB.qs +++ b/katas/content/superposition/four_bitstrings/SolutionB.qs @@ -1,4 +1,7 @@ namespace Kata { + open Microsoft.Quantum.Convert; + open Microsoft.Quantum.Math; + operation FourBitstringSuperposition (qs : Qubit[], bits : Bool[][]) : Unit { FourBitstringSuperposition_Recursive([], qs, bits); } @@ -26,7 +29,7 @@ namespace Kata { // for the first path through, when the bit string has zero length, // the Controlled version of the rotation will perform a regular rotation let theta = ArcCos(Sqrt(IntAsDouble(Length(zeroLeads)) / IntAsDouble(rows))); - (ApplyControlledOnBitString(currentBitString, Ry))(qs[0 .. currentIndex - 1], + ApplyControlledOnBitString(currentBitString, Ry, qs[0 .. currentIndex - 1], (2.0 * theta, qs[currentIndex])); // call state preparation recursively based on the bit strings so far diff --git a/katas/content/superposition/four_bitstrings/Verification.qs b/katas/content/superposition/four_bitstrings/Verification.qs index e50a63e084..6373d652d3 100644 --- a/katas/content/superposition/four_bitstrings/Verification.qs +++ b/katas/content/superposition/four_bitstrings/Verification.qs @@ -4,24 +4,24 @@ namespace Kata.Verification { open Microsoft.Quantum.Math; open Microsoft.Quantum.Random; - operation FourBitstringSuperposition_Reference (qs : Qubit[], bits : Bool[][]) : Unit is Adj { + operation FourBitstringSuperposition_Reference (qs : Qubit[], bits : Bool[][]) : Unit { use anc = Qubit[2]; ApplyToEachA(H, anc); for i in 0 .. 3 { for j in 0 .. Length(qs) - 1 { if bits[i][j] { - (ApplyControlledOnInt(i, X))(anc, qs[j]); + ApplyControlledOnInt(i, X, anc, qs[j]); } } } for i in 0 .. 3 { if i % 2 == 1 { - (ApplyControlledOnBitString(bits[i], X))(qs, anc[0]); + ApplyControlledOnBitString(bits[i], X, qs, anc[0]); } if i / 2 == 1 { - (ApplyControlledOnBitString(bits[i], X))(qs, anc[1]); + ApplyControlledOnBitString(bits[i], X, qs, anc[1]); } } } @@ -54,7 +54,7 @@ namespace Kata.Verification { mutable bits = [[false, false], [false, true], [true, false], [true, true]]; Message($"Testing for bits = {bits}..."); if not CheckOperationsEquivalenceOnZeroStateWithFeedback( - FourBitstringSuperposition(_, bits), + Kata.FourBitstringSuperposition(_, bits), ApplyToEachA(H, _), 2 ) { @@ -64,45 +64,13 @@ namespace Kata.Verification { set bits = [[false, false, false, true], [false, false, true, false], [false, true, false, false], [true, false, false, false]]; Message($"Testing for bits = {bits}..."); if not CheckOperationsEquivalenceOnZeroStateWithFeedback( - FourBitstringSuperposition(_, bits), + Kata.FourBitstringSuperposition(_, bits), WState_Arbitrary_Reference(_), 4 ) { return false; } - // random tests - for N in 3 .. 10 { - // generate 4 distinct numbers corresponding to the bit strings - mutable numbers = [0, size = 4]; - - repeat { - mutable ok = true; - for i in 0 .. 3 { - set numbers w/= i <- DrawRandomInt(0, 1 <<< N - 1); - for j in 0 .. i - 1 { - if numbers[i] == numbers[j] { - set ok = false; - } - } - } - } - until (ok); - - // convert numbers to bit strings - for i in 0 .. 3 { - set bits w/= i <- IntAsBoolArray(numbers[i], N); - } - - if not CheckOperationsEquivalenceOnZeroStateWithFeedback( - Kata.FourBitstringSuperposition(_, bits), - FourBitstringSuperposition_Reference(_, bits), - N - ) { - return false; - } - } - return true; } } From 112e89aa02a4c471265c183d945b39332064debd Mon Sep 17 00:00:00 2001 From: Frances Tibble Date: Mon, 22 Apr 2024 14:19:34 +0000 Subject: [PATCH 16/18] modify test cases --- .../four_bitstrings/Verification.qs | 48 +++++++------------ 1 file changed, 17 insertions(+), 31 deletions(-) diff --git a/katas/content/superposition/four_bitstrings/Verification.qs b/katas/content/superposition/four_bitstrings/Verification.qs index 6373d652d3..b905c0a332 100644 --- a/katas/content/superposition/four_bitstrings/Verification.qs +++ b/katas/content/superposition/four_bitstrings/Verification.qs @@ -4,7 +4,7 @@ namespace Kata.Verification { open Microsoft.Quantum.Math; open Microsoft.Quantum.Random; - operation FourBitstringSuperposition_Reference (qs : Qubit[], bits : Bool[][]) : Unit { + operation FourBitstringSuperposition_Reference (qs : Qubit[], bits : Bool[][]) : Unit is Adj { use anc = Qubit[2]; ApplyToEachA(H, anc); @@ -26,31 +26,9 @@ namespace Kata.Verification { } } - operation WState_Arbitrary_Reference (qs : Qubit[]) : Unit is Adj + Ctl { - - let N = Length(qs); - - if N ==1 { - // base case of recursion: |1⟩ - X(qs[0]); - } else { - // |W_N⟩ = |0⟩|W_(N-1)⟩ + |1⟩|0...0⟩ - // do a rotation on the first qubit to split it into |0⟩ and |1⟩ with proper weights - // |0⟩ -> sqrt((N-1)/N) |0⟩ + 1/sqrt(N) |1⟩ - let theta = ArcSin(1.0 / Sqrt(IntAsDouble(N))); - Ry(2.0 * theta, qs[0]); - - // do a zero-controlled W-state generation for qubits 1..N-1 - X(qs[0]); - Controlled WState_Arbitrary_Reference(qs[0 .. 0], qs[1 .. N - 1]); - X(qs[0]); - } - } - @EntryPoint() operation CheckSolution() : Bool { - // cross-tests mutable bits = [[false, false], [false, true], [true, false], [true, true]]; Message($"Testing for bits = {bits}..."); if not CheckOperationsEquivalenceOnZeroStateWithFeedback( @@ -61,14 +39,22 @@ namespace Kata.Verification { return false; } - set bits = [[false, false, false, true], [false, false, true, false], [false, true, false, false], [true, false, false, false]]; - Message($"Testing for bits = {bits}..."); - if not CheckOperationsEquivalenceOnZeroStateWithFeedback( - Kata.FourBitstringSuperposition(_, bits), - WState_Arbitrary_Reference(_), - 4 - ) { - return false; + mutable bitstrings = [ + [[false, true, false], [true, false, false], [false, false, true], [true, true, false]], + [[true, false, false], [false, false, true], [false, true, false], [true, true, true]], + [[false, false, false], [false, true, false], [true, true, false], [true, false, true]] + ]; + + for i in 0 .. Length (bitstrings) - 1 { + let bitstring = bitstrings[i]; + Message($"Testing for bits = {bitstring}..."); + if not CheckOperationsEquivalenceOnZeroStateWithFeedback( + Kata.FourBitstringSuperposition(_, bitstring), + FourBitstringSuperposition_Reference(_, bitstring), + 3 + ) { + return false; + } } return true; From dceb42086661ff9b70e43842940fae74619d0770 Mon Sep 17 00:00:00 2001 From: Mariia Mykhailova Date: Mon, 22 Apr 2024 11:02:09 -0700 Subject: [PATCH 17/18] Apply suggestions from code review --- .../content/superposition/four_bitstrings/Verification.qs | 7 +++---- katas/content/superposition/four_bitstrings/index.md | 4 ++-- katas/content/superposition/four_bitstrings/solution.md | 4 ++-- katas/content/superposition/index.md | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/katas/content/superposition/four_bitstrings/Verification.qs b/katas/content/superposition/four_bitstrings/Verification.qs index b905c0a332..3adcf6100e 100644 --- a/katas/content/superposition/four_bitstrings/Verification.qs +++ b/katas/content/superposition/four_bitstrings/Verification.qs @@ -29,7 +29,7 @@ namespace Kata.Verification { @EntryPoint() operation CheckSolution() : Bool { - mutable bits = [[false, false], [false, true], [true, false], [true, true]]; + let bits = [[false, false], [false, true], [true, false], [true, true]]; Message($"Testing for bits = {bits}..."); if not CheckOperationsEquivalenceOnZeroStateWithFeedback( Kata.FourBitstringSuperposition(_, bits), @@ -39,14 +39,13 @@ namespace Kata.Verification { return false; } - mutable bitstrings = [ + let bitstrings = [ [[false, true, false], [true, false, false], [false, false, true], [true, true, false]], [[true, false, false], [false, false, true], [false, true, false], [true, true, true]], [[false, false, false], [false, true, false], [true, true, false], [true, false, true]] ]; - for i in 0 .. Length (bitstrings) - 1 { - let bitstring = bitstrings[i]; + for bitstring in bitstrings { Message($"Testing for bits = {bitstring}..."); if not CheckOperationsEquivalenceOnZeroStateWithFeedback( Kata.FourBitstringSuperposition(_, bitstring), diff --git a/katas/content/superposition/four_bitstrings/index.md b/katas/content/superposition/four_bitstrings/index.md index e164f7f4bf..25b98c4cb8 100644 --- a/katas/content/superposition/four_bitstrings/index.md +++ b/katas/content/superposition/four_bitstrings/index.md @@ -1,9 +1,9 @@ **Inputs:** 1. $N$ qubits in the $|0 \dots 0\rangle$ state. -2. Four bit string represented as `Bool[][]` `bits`. +2. Four bit strings represented as `Bool[][]` `bits`. - `bits` is an array of size $4 * N$ which describes the bit strings as follows: + `bits` is an array of size $4 \times N$ which describes the bit strings as follows: - `bits[i]` describes the *i*th bit string and has $N$ elements. - All four bit strings will be distinct. diff --git a/katas/content/superposition/four_bitstrings/solution.md b/katas/content/superposition/four_bitstrings/solution.md index 4adafa16da..4009f1f46b 100644 --- a/katas/content/superposition/four_bitstrings/solution.md +++ b/katas/content/superposition/four_bitstrings/solution.md @@ -30,11 +30,11 @@ We will uncompute each of them separately, so one of the auxiliary qubits will b "codePath": "./SolutionA.qs" }) -We are going to leverage the recursion abilities of Q# to create a superposition of the four bit strings. This solution also extends to an arbitrary number of bit strings with no code changes. +Alternatively, we can leverage the recursion abilities of Q# to create a superposition of the four bit strings. This solution also extends to an arbitrary number of bit strings with no code changes. For this process we will look at the first bits of each string and adjust the probability of measuring a $|0\rangle$ or $|1\rangle$ accordingly on the first qubit of our answer. We will then recursively call (as needed) the process again to adjust the probabilities of measurement on the second bit depending on the first bit. This process recurses until no more input bits are provided. -Consider for example the following four bit strings on which to create a superposition: $|001\rangle, |101\rangle, |111\rangle, |110\rangle$. +Consider, for example, the following four bit strings on which to create a superposition: $|001\rangle, |101\rangle, |111\rangle, |110\rangle$. We can rewrite the superposition state we need to prepare as diff --git a/katas/content/superposition/index.md b/katas/content/superposition/index.md index 665957bc55..9104292a2c 100644 --- a/katas/content/superposition/index.md +++ b/katas/content/superposition/index.md @@ -145,7 +145,7 @@ This kata is designed to get you familiar with the concept of superposition and @[exercise]({ "id": "superposition__four_bitstrings", - "title": "Four Bitstrings", + "title": "Four Bit Strings", "path": "./four_bitstrings/", "qsDependencies": [ "../KatasLibrary.qs", From 972321222ce5ef5581b69fc7ca0d635004dc9576 Mon Sep 17 00:00:00 2001 From: Mariia Mykhailova Date: Mon, 22 Apr 2024 11:34:28 -0700 Subject: [PATCH 18/18] Remove kata from list --- katas/content/index.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/katas/content/index.json b/katas/content/index.json index 3f18d36a5d..f1536c33d9 100644 --- a/katas/content/index.json +++ b/katas/content/index.json @@ -11,6 +11,5 @@ "random_numbers", "oracles", "deutsch_algo", - "deutsch_jozsa", - "superposition" + "deutsch_jozsa" ]