Skip to content

Commit 91899c2

Browse files
anpazmartinquantum
authored andcommitted
Typo corrections into 0.3 (microsoft#131)
* cherry-picking commit 0c01ba2 * Cherry-picking correct commit. * Update Samples/src/OpenQasm/OpenQasmDriver.cs Co-Authored-By: anpaz-msft <[email protected]>
1 parent 1456352 commit 91899c2

28 files changed

+97
-97
lines changed

Samples/src/AdiabaticIsing/AdiabaticIsing.qs

+4-4
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ namespace Microsoft.Quantum.Samples.Ising {
108108
//////////////////////////////////////////////////////////////////////////
109109

110110
/// # Summary
111-
/// This uses the Ising model `GeneratorSystem` construced previously to
111+
/// This uses the Ising model `GeneratorSystem` constructed previously to
112112
/// represent the desired interpolated Hamiltonian H(s). This is
113113
/// accomplished by choosing an appropriate function for its coefficients.
114114
///
@@ -220,7 +220,7 @@ namespace Microsoft.Quantum.Samples.Ising {
220220

221221
/// # Summary
222222
/// We now allocate qubits to the simulation, implement adiabatic state
223-
/// prepartion, and then return the results of spin measurement on each
223+
/// preparation, and then return the results of spin measurement on each
224224
/// site.
225225
///
226226
/// # Input
@@ -335,7 +335,7 @@ namespace Microsoft.Quantum.Samples.Ising {
335335
let end = EndEvoGen(nSites, jCoupling);
336336

337337
// We choose the time-dependent Trotter–Suzuki decomposition as
338-
// our similation algorithm.
338+
// our simulation algorithm.
339339
let timeDependentSimulationAlgorithm = TimeDependentTrotterSimulationAlgorithm(trotterStepSize, trotterOrder);
340340

341341
// The function InterpolatedEvolution uniformly interpolates between the start and the end Hamiltonians.
@@ -345,7 +345,7 @@ namespace Microsoft.Quantum.Samples.Ising {
345345

346346
/// # Summary
347347
/// We now choose uniform coupling coefficients, allocate qubits to the
348-
/// simulation, implement adiabatic state prepartion, and then return
348+
/// simulation, implement adiabatic state preparation, and then return
349349
/// the results of spin measurement on each site.
350350
///
351351
/// # Input

Samples/src/BitFlipCode/BitFlipCode.qs

+16-16
Original file line numberDiff line numberDiff line change
@@ -56,24 +56,24 @@ namespace Microsoft.Quantum.Samples.BitFlipCode {
5656
// Thus, we can write out our encoder in a very simple form:
5757

5858
/// # Summary
59-
/// Given a qubit representing a state to be protected and two auxillary
59+
/// Given a qubit representing a state to be protected and two auxiliary
6060
/// qubits initially in the |0〉 state, encodes the state into the
6161
/// three-qubit bit-flip code.
6262
///
6363
/// # Input
6464
/// ## data
6565
/// A qubit whose state is to be protected.
66-
/// ## auxillaryQubits
66+
/// ## auxiliaryQubits
6767
/// Two qubits, initially in the |00〉 state, to be used in protecting
6868
/// the state of `data`.
69-
operation EncodeIntoBitFlipCode (data : Qubit, auxillaryQubits : Qubit[]) : Unit {
69+
operation EncodeIntoBitFlipCode (data : Qubit, auxiliaryQubits : Qubit[]) : Unit {
7070

7171
body (...) {
7272
// We use the ApplyToEach operation from the canon,
7373
// partially applied with the data qubit, to represent
7474
// a "CNOT-ladder." In this case, the line below
7575
// applies CNOT₀₁ · CNOT₀₂.
76-
ApplyToEachCA(CNOT(data, _), auxillaryQubits);
76+
ApplyToEachCA(CNOT(data, _), auxiliaryQubits);
7777
}
7878

7979
// Since decoding is the adjoint of encoding, we must
@@ -105,15 +105,15 @@ namespace Microsoft.Quantum.Samples.BitFlipCode {
105105
operation CheckBitFlipCodeStateParity () : Unit {
106106

107107
// We start by preparing R_x(π / 3) |0〉 as our
108-
// test state, along with two auxillary qubits in the |00〉
108+
// test state, along with two auxiliary qubits in the |00〉
109109
// state that we can use to encode.
110110
using (register = Qubit[3]) {
111111
let data = register[0];
112-
let auxillaryQubits = register[1 .. 2];
112+
let auxiliaryQubits = register[1 .. 2];
113113
Rx(PI() / 3.0, data);
114114

115115
// Next, we encode our test state.
116-
EncodeIntoBitFlipCode(data, auxillaryQubits);
116+
EncodeIntoBitFlipCode(data, auxiliaryQubits);
117117

118118
// At this point, register represents a code block
119119
// that protects the state R_x(π / 3) |0〉.
@@ -143,7 +143,7 @@ namespace Microsoft.Quantum.Samples.BitFlipCode {
143143

144144
// To check that we have not disturbed the state, we decode,
145145
// rotate back, and assert once more.
146-
Adjoint EncodeIntoBitFlipCode(data, auxillaryQubits);
146+
Adjoint EncodeIntoBitFlipCode(data, auxiliaryQubits);
147147
Adjoint Rx(PI() / 3.0, data);
148148
Assert([PauliZ], [data], Zero, "Didn't return to |0〉!");
149149
}
@@ -185,9 +185,9 @@ namespace Microsoft.Quantum.Samples.BitFlipCode {
185185
// We start by proceeding the same way as above
186186
// in order to obtain the code block state |̅ψ〉.
187187
let data = register[0];
188-
let auxillaryQubits = register[1 .. 2];
188+
let auxiliaryQubits = register[1 .. 2];
189189
Rx(PI() / 3.0, data);
190-
EncodeIntoBitFlipCode(data, auxillaryQubits);
190+
EncodeIntoBitFlipCode(data, auxiliaryQubits);
191191

192192
// Next, we apply the error that we've been given to the
193193
// entire register.
@@ -222,7 +222,7 @@ namespace Microsoft.Quantum.Samples.BitFlipCode {
222222

223223
// To check that we have not disturbed the state, we decode,
224224
// rotate back, and assert once more.
225-
Adjoint EncodeIntoBitFlipCode(data, auxillaryQubits);
225+
Adjoint EncodeIntoBitFlipCode(data, auxiliaryQubits);
226226
Adjoint Rx(PI() / 3.0, data);
227227
Assert([PauliZ], [data], Zero, "Didn't return to |0〉!");
228228
}
@@ -311,14 +311,14 @@ namespace Microsoft.Quantum.Samples.BitFlipCode {
311311
operation CheckCodeCorrectsError (code : QECC, nScratch : Int, fn : RecoveryFn, error : (Qubit[] => Unit)) : Unit {
312312

313313
// We once again begin by allocating some qubits to use as data
314-
// and auxillary qubits, and by preparing a test state on the
314+
// and auxiliary qubits, and by preparing a test state on the
315315
// data qubit.
316316
using (register = Qubit[1 + nScratch]) {
317317

318318
// We start by proceeding the same way as above
319319
// in order to obtain the code block state |̅ψ〉.
320320
let data = register[0];
321-
let auxillaryQubits = register[1 .. nScratch];
321+
let auxiliaryQubits = register[1 .. nScratch];
322322
Rx(PI() / 3.0, data);
323323

324324
// We differ this time, however, in how we perform the
@@ -336,7 +336,7 @@ namespace Microsoft.Quantum.Samples.BitFlipCode {
336336
// blocks.
337337
// Note that we also pass data as an array of qubits, to
338338
// allow for codes which protect multiple qubits in one block.
339-
let codeBlock = encode!([data], auxillaryQubits);
339+
let codeBlock = encode!([data], auxiliaryQubits);
340340

341341
// Next, we cause an error as usual.
342342
error(codeBlock!);
@@ -347,8 +347,8 @@ namespace Microsoft.Quantum.Samples.BitFlipCode {
347347
Recover(code, fn, codeBlock);
348348

349349
// Having recovered, we can decode to obtain new qubit arrays
350-
// pointing to the decoded data and auxillary qubits.
351-
let (decodedData, decodedAuxillary) = decode!(codeBlock);
350+
// pointing to the decoded data and auxiliary qubits.
351+
let (decodedData, decodedauxiliary) = decode!(codeBlock);
352352

353353
// Finally, we test that our test state was protected.
354354
Adjoint Rx(PI() / 3.0, data);

Samples/src/DatabaseSearch/DatabaseSearch.qs

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ namespace Microsoft.Quantum.Samples.DatabaseSearch {
3434

3535
// First, we work out an example of how to construct and apply D without
3636
// using the canon. We then implement all the steps of Grover search
37-
// manually using this databse oracle. Second, we show the amplitude
38-
// amplication libraries provided with the canon can make this task
37+
// manually using this database oracle. Second, we show the amplitude
38+
// amplification libraries provided with the canon can make this task
3939
// significantly easier.
4040

4141
//////////////////////////////////////////////////////////////////////////
@@ -142,7 +142,7 @@ namespace Microsoft.Quantum.Samples.DatabaseSearch {
142142
///
143143
/// # Input
144144
/// ## markedQubit
145-
/// Qubit that indicats whether database element is marked.
145+
/// Qubit that indicates whether database element is marked.
146146
/// ## databaseRegister
147147
/// A register of n qubits initially in the |00…0〉 state.
148148
operation StatePreparationOracle (markedQubit : Qubit, databaseRegister : Qubit[]) : Unit {
@@ -416,7 +416,7 @@ namespace Microsoft.Quantum.Samples.DatabaseSearch {
416416
// defined above with one major difference -- Its arguments have signature
417417
// the signature (Int, Qubit[]). Rather than directly passing the marked
418418
// qubit to the operation, we instead pass an integer than indexes The
419-
// location of the marked qubit in the qubit arrary, which now encompasses
419+
// location of the marked qubit in the qubit array, which now encompasses
420420
// all qubits.
421421

422422
// Our goal is thus to construct this `StateOracle` oracle type and pass it

Samples/src/DatabaseSearch/Program.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static void Main(string[] args)
7272

7373
successCount += markedQubit == Result.One ? 1 : 0;
7474

75-
// Print the results of the search every 100 attemps
75+
// Print the results of the search every 100 attempts
7676
if ((idxAttempt + 1) % 100 == 0)
7777
{
7878

@@ -93,7 +93,7 @@ static void Main(string[] args)
9393

9494
// Let us investigate the success probability of the quantum search.
9595

96-
// Wedefine the size `N` = 2^n of the database to searched in terms of
96+
// We define the size `N` = 2^n of the database to searched in terms of
9797
// number of qubits `n`.
9898
nDatabaseQubits = 6;
9999
databaseSize = Math.Pow(2.0, nDatabaseQubits);
@@ -135,7 +135,7 @@ static void Main(string[] args)
135135

136136
successCount += markedQubit == Result.One ? 1 : 0;
137137

138-
// Print the results of the search every 10 attemps
138+
// Print the results of the search every 10 attempts
139139
if ((idxAttempt + 1) % 10 == 0)
140140
{
141141
var empiricalSuccessProbability = Math.Round((double)successCount / ((double)idxAttempt + 1), 3);
@@ -213,7 +213,7 @@ static void Main(string[] args)
213213

214214
successCount += markedQubit == Result.One ? 1 : 0;
215215

216-
// Print the results of the search every 1 attemps
216+
// Print the results of the search every 1 attempt
217217
if ((idxAttempt + 1) % 1 == 0)
218218
{
219219
var empiricalSuccessProbability = Math.Round((double)successCount / ((double)idxAttempt + 1), 3);

Samples/src/H2SimulationCmdLine/Operation.qs

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ namespace Microsoft.Quantum.Samples.H2Simulation {
9595

9696

9797
/// # Summary
98-
/// Given an index, returns a description of the correponding
98+
/// Given an index, returns a description of the corresponding
9999
/// term in the Hamiltonian for H₂. Each term is described by
100100
/// a pair of integer arrays representing a sparse Pauli operator.
101101
///
@@ -216,7 +216,7 @@ namespace Microsoft.Quantum.Samples.H2Simulation {
216216

217217
/// # Summary
218218
/// We now provide Canon's Hamiltonian simulation
219-
/// functions with the above representaiton to automatically
219+
/// functions with the above representation to automatically
220220
/// decompose the H₂ Hamiltonian into an appropriate operation
221221
/// that we can apply to qubits as we please.
222222
operation H2TrotterStep (idxBondLength : Int, trotterOrder : Int, trotterStepSize : Double, qubits : Qubit[]) : Unit {

Samples/src/H2SimulationCmdLine/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static void Main(string[] args)
4545
// step size of 1.
4646
//
4747
// The result of calling H2EstimateEnergyRPE is a Double, so we can minimize over
48-
// that to deal with the possibility that we accidently entered into the excited
48+
// that to deal with the possibility that we accidentally entered into the excited
4949
// state instead of the ground state of interest.
5050
Func<int, Double> estAtBondLength = (idx) => Enumerable.Min(
5151
from idxRep in Enumerable.Range(0, 3)

Samples/src/H2SimulationGUI/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ private static void SendPlotPoints(NetworkStream stream)
5858
// step size of 1.
5959
//
6060
// The result of calling H2EstimateEnergyRPE is a Double, so we can minimize over
61-
// that to deal with the possibility that we accidently entered into the excited
61+
// that to deal with the possibility that we accidentally entered into the excited
6262
// state instead of the ground state of interest.
6363
Func<int, Double> estAtBondLength = (idx) => Enumerable.Min(
6464
from idxRep in Enumerable.Range(0, 3)

Samples/src/HubbardSimulation/HubbardSimulation.qs

+12-12
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ namespace Microsoft.Quantum.Samples.Hubbard {
1212
//////////////////////////////////////////////////////////////////////////
1313

1414
// In this example, we will show how to simulate the time evolution of
15-
// a 1D Hubbard model with `n` sitess. Let `i` be the site index,
16-
// `s` = 1,0 be the spin index, where 0 is up and 1 is down. t be the
17-
// hopping coefficient, U the repulsion coefficient, and aᵢₛ the fermionic
18-
// annihilation operator on the fermion indexed by {i,s}. The Hamiltonian
15+
// a 1D Hubbard model with `n` sites. Let `i` be the site index,
16+
// `s` = 1,0 be the spin index, where 0 is up and 1 is down. t be the
17+
// hopping coefficient, U the repulsion coefficient, and aᵢₛ the fermionic
18+
// annihilation operator on the fermion indexed by {i,s}. The Hamiltonian
1919
// of this model is
2020

2121
// H ≔ - t Σᵢ (a†ᵢₛ aᵢ₊₁ₛ + a†ᵢ₊₁ₛ aᵢₛ) + u Σᵢ a†ᵢ₁ aᵢ₁ a†ᵢ₀ aᵢ₀
@@ -28,14 +28,14 @@ namespace Microsoft.Quantum.Samples.Hubbard {
2828
// Trotter–Suzuki control sequence to approximate time-evolution by this
2929
// Hamiltonian. This time-evolution is used to estimate the ground state
3030
// energy at half-filling.
31-
32-
// Energy estimation requires an input state with non-zero overlap with
33-
// the ground state, and we use the anti-ferromagnetic state with
34-
// alternating spins for this purpuse.
35-
31+
32+
// Energy estimation requires an input state with non-zero overlap with
33+
// the ground state, and we use the anti-ferromagnetic state with
34+
// alternating spins for this purpose.
35+
3636
// The Hubbard Hamiltonian is composed of Fermionic operators which act on
37-
// Fermions and satify anti-commutation rules
38-
37+
// Fermions and satisfy anti-commutation rules
38+
//
3939
// {aⱼ, aₖ} = 0, {a†ⱼ, aₖ†} = 0, {aⱼ, aₖ†} = δⱼₖ.
4040

4141
// In the above, the subscript indexes both the site and spin.
@@ -57,7 +57,7 @@ namespace Microsoft.Quantum.Samples.Hubbard {
5757
// assuming that j > k.
5858

5959
// Other possible mapping exist, but we do not consider them further here.
60-
// Implementing the Jodan-Wigner transform requires us to define a
60+
// Implementing the Jordan-Wigner transform requires us to define a
6161
// canonical ordering between the Fermion indices {is} and
6262
// the qubit index. Let the fermion site be indexed by the qubit i + n*s
6363

Samples/src/IntegerFactorization/Shor.qs

+7-7
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,14 @@ namespace Microsoft.Quantum.Samples.IntegerFactorization {
199199

200200
// Allocate qubits for the superposition of eigenstates of
201201
// the oracle that is used in period finding
202-
using (eignestateRegister = Qubit[bitsize]) {
202+
using (eigenstateRegister = Qubit[bitsize]) {
203203

204-
// Initialize eignestateRegister to 1 which is a superposition of
204+
// Initialize eigenstateRegister to 1 which is a superposition of
205205
// the eigenstates we are estimating the phases of.
206206
// We first interpret the register as encoding unsigned integer
207207
// in little endian encoding.
208-
let eignestateRegisterLE = LittleEndian(eignestateRegister);
209-
InPlaceXorLE(1, eignestateRegisterLE);
208+
let eigenstateRegisterLE = LittleEndian(eigenstateRegister);
209+
InPlaceXorLE(1, eigenstateRegisterLE);
210210

211211
// An oracle of type Microsoft.Quantum.Canon.DiscreteOracle
212212
// that we are going to use with phase estimation methods below.
@@ -219,7 +219,7 @@ namespace Microsoft.Quantum.Samples.IntegerFactorization {
219219
// Use Microsoft.Quantum.Canon.RobustPhaseEstimation to estimate s/r.
220220
// RobustPhaseEstimation needs only one extra qubit, but requires
221221
// several calls to the oracle
222-
let phase = RobustPhaseEstimation(bitsPrecision, oracle, eignestateRegisterLE!);
222+
let phase = RobustPhaseEstimation(bitsPrecision, oracle, eigenstateRegisterLE!);
223223

224224
// Compute the numerator k of dyadic fraction k/2^bitsPrecision
225225
// approximating s/r. Note that phase estimation project on the eigenstate
@@ -238,7 +238,7 @@ namespace Microsoft.Quantum.Samples.IntegerFactorization {
238238
// integer encoded in big-endian format. This is indicated by
239239
// use of Microsoft.Quantum.Canon.BigEndian type.
240240
let dyadicFractionNumeratorBE = BigEndian(dyadicFractionNumerator);
241-
QuantumPhaseEstimation(oracle, eignestateRegisterLE!, dyadicFractionNumeratorBE);
241+
QuantumPhaseEstimation(oracle, eigenstateRegisterLE!, dyadicFractionNumeratorBE);
242242

243243
// Directly measure the numerator k of dyadic fraction k/2^bitsPrecision
244244
// approximating s/r. Note that phase estimation project on
@@ -249,7 +249,7 @@ namespace Microsoft.Quantum.Samples.IntegerFactorization {
249249

250250
// Return all the qubits used for oracle's eigenstate back to 0 state
251251
// using Microsoft.Quantum.Canon.ResetAll
252-
ResetAll(eignestateRegister);
252+
ResetAll(eigenstateRegister);
253253
}
254254

255255
// Sometimes we might measure all zeros state in Phase Estimation.

0 commit comments

Comments
 (0)