Skip to content

Commit

Permalink
Revert "Revert "method and folder renaming""
Browse files Browse the repository at this point in the history
This reverts commit 7905e87.
  • Loading branch information
James Kingdon committed May 30, 2024
1 parent 6107f7e commit 95f9e13
Show file tree
Hide file tree
Showing 23 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion katas/content/distinguishing_unitaries/h_x/Placeholder.qs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace Kata {
operation DistinguishHX (unitary : (Qubit => Unit is Adj + Ctl)) : Int {
operation DistinguishHfromX(unitary : (Qubit => Unit is Adj + Ctl)) : Int {
// Implement your solution here...

return -1;
Expand Down
2 changes: 1 addition & 1 deletion katas/content/distinguishing_unitaries/h_x/Solution.qs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace Kata {
operation DistinguishHX (unitary : (Qubit => Unit is Adj + Ctl)) : Int {
operation DistinguishHfromX(unitary : (Qubit => Unit is Adj + Ctl)) : Int {
use q = Qubit();
within {
unitary(q);
Expand Down
2 changes: 1 addition & 1 deletion katas/content/distinguishing_unitaries/h_x/Verification.qs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ namespace Kata.Verification {

@EntryPoint()
operation CheckSolution() : Bool {
DistinguishUnitaries_Framework([H, X], Kata.DistinguishHX, ["H", "X"], 1)
DistinguishUnitaries_Framework([H, X], Kata.DistinguishHfromX, ["H", "X"], 1)
}
}
2 changes: 1 addition & 1 deletion katas/content/distinguishing_unitaries/i_x/Placeholder.qs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace Kata {
operation DistinguishIX (unitary : (Qubit => Unit is Adj + Ctl)) : Int {
operation DistinguishIfromX(unitary : (Qubit => Unit is Adj + Ctl)) : Int {
// Implement your solution here...

return -1;
Expand Down
2 changes: 1 addition & 1 deletion katas/content/distinguishing_unitaries/i_x/Solution.qs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace Kata {
operation DistinguishIX (unitary : (Qubit => Unit is Adj + Ctl)) : Int {
operation DistinguishIfromX(unitary : (Qubit => Unit is Adj + Ctl)) : Int {
use q = Qubit();
unitary(q);
return MResetZ(q) == Zero ? 0 | 1;
Expand Down
2 changes: 1 addition & 1 deletion katas/content/distinguishing_unitaries/i_x/Verification.qs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ namespace Kata.Verification {

@EntryPoint()
operation CheckSolution() : Bool {
DistinguishUnitaries_Framework([I, X], Kata.DistinguishIX, ["I", "X"], 1)
DistinguishUnitaries_Framework([I, X], Kata.DistinguishIfromX, ["I", "X"], 1)
}
}
2 changes: 1 addition & 1 deletion katas/content/distinguishing_unitaries/i_z/Placeholder.qs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace Kata {
operation DistinguishIZ (unitary : (Qubit => Unit is Adj + Ctl)) : Int {
operation DistinguishIfromZ(unitary : (Qubit => Unit is Adj + Ctl)) : Int {
// Implement your solution here...

return -1;
Expand Down
2 changes: 1 addition & 1 deletion katas/content/distinguishing_unitaries/i_z/Solution.qs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace Kata {
operation DistinguishIZ (unitary : (Qubit => Unit is Adj + Ctl)) : Int {
operation DistinguishIfromZ(unitary : (Qubit => Unit is Adj + Ctl)) : Int {
use q = Qubit();
H(q);
unitary(q);
Expand Down
2 changes: 1 addition & 1 deletion katas/content/distinguishing_unitaries/i_z/Verification.qs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ namespace Kata.Verification {

@EntryPoint()
operation CheckSolution() : Bool {
DistinguishUnitaries_Framework([I, Z], Kata.DistinguishIZ, ["I", "Z"], 1)
DistinguishUnitaries_Framework([I, Z], Kata.DistinguishIfromZ, ["I", "Z"], 1)
}
}
8 changes: 4 additions & 4 deletions katas/content/distinguishing_unitaries/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ This kata offers you a series of tasks in which you are given one unitary from t
})

@[exercise]({
"id": "distinguishing_unitaries__z_mz",
"id": "distinguishing_unitaries__z_minusz",
"title": "Z or -Z?",
"path": "./z_mz/",
"path": "./z_minusz/",
"qsDependencies": [
"../KatasLibrary.qs",
"./Common.qs"
Expand Down Expand Up @@ -94,9 +94,9 @@ This kata offers you a series of tasks in which you are given one unitary from t
})

@[exercise]({
"id": "distinguishing_unitaries__y_xz_my_mxz",
"id": "distinguishing_unitaries__y_xz_minusy_minusxz",
"title": "Y or XZ or -Y or -XZ?",
"path": "./y_xz_my_mxz/",
"path": "./y_xz_minusy_minusxz/",
"qsDependencies": [
"../KatasLibrary.qs",
"./Common.qs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ In this task we have to distinguish 4 gates that were identical up to a global p
One way to do this is "by hand", similar to the previous tasks. First we'll apply the controlled variant of the unitary twice and check whether the result is $I$ or $-I$ (which allows us to distinguish $\pm Y$ and $\pm iY$, since the first two gates squared will be equivalent to the $I$ gate, and the last two to the $-I$ gate). Then we distinguish the gates in each group ($Y$ from $-Y$ or $iY$ from $-iY$) by applying the controlled variant of the unitary once.

@[solution]({
"id": "distinguishing_unitaries__y_xz_my_mxz_solution",
"id": "distinguishing_unitaries__y_xz_minusy_minusxz_solution",
"codePath": "Solution.qs"
})
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ After this we can measure the first qubit to distinguish $\frac{1}{\sqrt2}(\ket{
> In Q# we can express controlled version of a gate using [Controlled functor](https://learn.microsoft.com/en-us/azure/quantum/user-guide/language/expressions/functorapplication#controlled-functor): the first argument of the resulting gate will be an array of control qubits, and the second one - the arguments of the original gate (in this case just the target qubit).
@[solution]({
"id": "distinguishing_unitaries__z_mz_solution",
"id": "distinguishing_unitaries__z_minusz_solution",
"codePath": "Solution.qs"
})
2 changes: 1 addition & 1 deletion katas/content/distinguishing_unitaries/z_s/Placeholder.qs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace Kata {
operation DistinguishZS (unitary : (Qubit => Unit is Adj + Ctl)) : Int {
operation DistinguishZfromS(unitary : (Qubit => Unit is Adj + Ctl)) : Int {
// Implement your solution here...

return -1;
Expand Down
2 changes: 1 addition & 1 deletion katas/content/distinguishing_unitaries/z_s/Solution.qs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace Kata {
operation DistinguishZS (unitary : (Qubit => Unit is Adj + Ctl)) : Int {
operation DistinguishZfromS(unitary : (Qubit => Unit is Adj + Ctl)) : Int {
use q = Qubit();
H(q);
unitary(q);
Expand Down
2 changes: 1 addition & 1 deletion katas/content/distinguishing_unitaries/z_s/Verification.qs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ namespace Kata.Verification {

@EntryPoint()
operation CheckSolution() : Bool {
DistinguishUnitaries_Framework([Z, S], Kata.DistinguishZS, ["Z", "S"], 1)
DistinguishUnitaries_Framework([Z, S], Kata.DistinguishZfromS, ["Z", "S"], 1)
}
}

0 comments on commit 95f9e13

Please sign in to comment.