Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Update to 0.15 syntax, batch 2 #591

Merged
merged 29 commits into from
Jan 30, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b26c14c
[ExploringGroversAlgorithm] Fix dead link
vivanwin Oct 25, 2020
d6be7cd
Updating linkings to link directly to workbook
vivanwin Oct 25, 2020
c7ca8b9
Merge remote-tracking branch 'upstream/main' into main
vivanwin Dec 8, 2020
1f797b5
Add %config and %trace where it makes sense
vivanwin Dec 9, 2020
bebf0b2
Merge remote-tracking branch 'upstream/main' into main
vivanwin Dec 11, 2020
b7d7b93
Use config files
vivanwin Dec 11, 2020
96b73cb
Remove little endian kets from output
tcNickolas Dec 12, 2020
d999f06
Merge remote-tracking branch 'upstream/main' into main
vivanwin Dec 17, 2020
9768ef7
Merge remote-tracking branch 'upstream/main' into main
vivanwin Dec 21, 2020
598b078
Merge remote-tracking branch 'upstream/main' into main
vivanwin Dec 29, 2020
357683a
Merge remote-tracking branch 'upstream/main' into main
vivanwin Jan 3, 2021
1a8a51b
Merge remote-tracking branch 'upstream/main' into main
vivanwin Jan 29, 2021
b2ec052
update to SDK 0.15 CHSHGame
vivanwin Jan 29, 2021
f15743b
Update to 0.15 syntax DeutschJozsaAlgorithm
vivanwin Jan 29, 2021
76b81b3
Update to 0.15 syntax DistinguishUnitaries
vivanwin Jan 29, 2021
b279c14
Update to 0.15 syntax GHZGame
vivanwin Jan 29, 2021
8974bdb
Update to 0.15 syntax GraphColoring
vivanwin Jan 29, 2021
4364f98
Update to 0.15 syntax GroverAlgorithm
vivanwin Jan 29, 2021
d97ef59
Update to 0.15 syntax JointMeasurements
vivanwin Jan 29, 2021
d0e3e73
Update to 0.15 syntax KeyDistribution_BB84
vivanwin Jan 29, 2021
e0b1cbb
Update to 0.15 syntax MagicSquareGame
vivanwin Jan 29, 2021
1705530
Update to 0.15 syntax PhaseEstimation
vivanwin Jan 29, 2021
515071b
Update to 0.15 syntax QEC_BitFlipCode
vivanwin Jan 29, 2021
9dd9b13
Update to 0.15 syntax QFT
vivanwin Jan 29, 2021
f250db4
Update to 0.15 syntax RippleCarryAdder
vivanwin Jan 29, 2021
5577143
Update to 0.15 syntax SimonsAlgorithm
vivanwin Jan 29, 2021
82e1963
Fix a couple indentations
tcNickolas Jan 30, 2021
a58b127
Merge branch 'main' into main
tcNickolas Jan 30, 2021
d1b1b9d
Return scoped "use" to PhaseEstimation task 2.2
tcNickolas Jan 30, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix a couple indentations
  • Loading branch information
tcNickolas committed Jan 30, 2021
commit 82e1963c17e656a7cd3ef1b00144a0ea3bad7e32
2 changes: 1 addition & 1 deletion CHSHGame/ReferenceImplementation.qs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ namespace Quantum.Kata.CHSHGame {
operation PlayQuantumCHSH_Reference (askAlice : (Qubit => Bool),
askBob : (Qubit => Bool)) : (Bool, Bool) {

use (aliceQubit, bobQubit) = (Qubit(), Qubit());
use (aliceQubit, bobQubit) = (Qubit(), Qubit());
CreateEntangledPair_Reference([aliceQubit, bobQubit]);

let aliceResult = askAlice(aliceQubit);
Expand Down
1 change: 0 additions & 1 deletion CHSHGame/Tests.qs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ namespace Quantum.Kata.CHSHGame {

// assert that all qubits end up in |0⟩ state
AssertAllZero(qs);

}

@Test("QuantumSimulator")
Expand Down
4 changes: 2 additions & 2 deletions CHSHGame/Workbook_CHSHGame.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@
"%kata T25_PlayQuantumCHSH \n",
"\n",
"operation PlayQuantumCHSH (askAlice : (Qubit => Bool), askBob : (Qubit => Bool)): (Bool, Bool) {\n",
" using bell = Qubit[2];\n",
" use bell = Qubit[2];\n",
" CreateEntangledPair(bell);\n",
"\n",
" let A = askAlice(bell[0]);\n",
Expand Down Expand Up @@ -598,7 +598,7 @@
"file_extension": ".qs",
"mimetype": "text/x-qsharp",
"name": "qsharp",
"version": "0.12"
"version": "0.14"
}
},
"nbformat": 4,
Expand Down
3 changes: 1 addition & 2 deletions DistinguishUnitaries/ReferenceImplementation.qs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ namespace Quantum.Kata.DistinguishUnitaries {
let ind1 = MeasureInteger(LittleEndian(qs));

// second run: distinguish II from SWAP, apply to |01⟩: II will remain |01⟩, SWAP will become |10⟩
ResetAll(qs);
X(qs[1]);
unitary(qs);
let ind2 = MeasureInteger(LittleEndian(qs));
Expand All @@ -297,6 +296,6 @@ namespace Quantum.Kata.DistinguishUnitaries {
return ind1;
} else {
return ind2 == 1 ? 3 | 0;
}
}
}
}
3 changes: 1 addition & 2 deletions DistinguishUnitaries/Workbook_DistinguishUnitaries.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,6 @@
" let ind1 = MeasureInteger(LittleEndian(qs));\n",
"\n",
" // second run: distinguish II from SWAP, apply to |01⟩: II will remain |01⟩, SWAP will become |10⟩\n",
" ResetAll(qs);\n",
" X(qs[1]);\n",
" unitary(qs);\n",
" let ind2 = MeasureInteger(LittleEndian(qs));\n",
Expand Down Expand Up @@ -1062,7 +1061,7 @@
"file_extension": ".qs",
"mimetype": "text/x-qsharp",
"name": "qsharp",
"version": "0.12"
"version": "0.14"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions JointMeasurements/Tests.qs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace Quantum.Kata.JointMeasurements {
mutable unknownClassifications = new Int[nStates];

use qs = Qubit[nQubits];
for i in 1 .. nTotal {
for i in 1 .. nTotal {
// get a random integer to define the state of the qubits
let state = DrawRandomInt(0, nStates - 1);
// get a random rotation angle to define the exact state of the qubits
Expand Down Expand Up @@ -245,7 +245,7 @@ namespace Quantum.Kata.JointMeasurements {

// Check that the implementation of ControlledX_General doesn't call multi-qubit gates (other than itself)
use qs = Qubit[2];
// prepare a non-trivial input state
// prepare a non-trivial input state
ApplyToEachA(H, qs);

ResetOracleCallsCount();
Expand All @@ -254,7 +254,7 @@ namespace Quantum.Kata.JointMeasurements {

// the 1 in the following condition is the task operation itself being called
Fact(GetMultiQubitNonMeasurementOpCount() <= 1,
"You are not allowed to use multi-qubit gates in this task.");
"You are not allowed to use multi-qubit gates in this task.");

// apply adjoint reference operation and adjoint of state prep
CNOT(qs[0], qs[1]);
Expand Down
2 changes: 1 addition & 1 deletion RippleCarryAdder/ReferenceImplementation.qs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ namespace Quantum.Kata.RippleCarryAdder {
LowestBitCarry_Reference(a[0], b[0], carry);
}
else {
use internalCarries = Qubit[N-1];
use internalCarries = Qubit[N-1];
LowestBitSum_Reference(a[0], b[0], sum[0]);
LowestBitCarry_Reference(a[0], b[0], internalCarries[0]);

Expand Down