@@ -56,24 +56,24 @@ namespace Microsoft.Quantum.Samples.BitFlipCode {
56
56
// Thus, we can write out our encoder in a very simple form:
57
57
58
58
/// # 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
60
60
/// qubits initially in the |0〉 state, encodes the state into the
61
61
/// three-qubit bit-flip code.
62
62
///
63
63
/// # Input
64
64
/// ## data
65
65
/// A qubit whose state is to be protected.
66
- /// ## auxillaryQubits
66
+ /// ## auxiliaryQubits
67
67
/// Two qubits, initially in the |00〉 state, to be used in protecting
68
68
/// the state of `data`.
69
- operation EncodeIntoBitFlipCode (data : Qubit , auxillaryQubits : Qubit []) : Unit {
69
+ operation EncodeIntoBitFlipCode (data : Qubit , auxiliaryQubits : Qubit []) : Unit {
70
70
71
71
body (... ) {
72
72
// We use the ApplyToEach operation from the canon,
73
73
// partially applied with the data qubit, to represent
74
74
// a "CNOT-ladder." In this case, the line below
75
75
// applies CNOT₀₁ · CNOT₀₂.
76
- ApplyToEachCA (CNOT (data , _ ), auxillaryQubits );
76
+ ApplyToEachCA (CNOT (data , _ ), auxiliaryQubits );
77
77
}
78
78
79
79
// Since decoding is the adjoint of encoding, we must
@@ -105,15 +105,15 @@ namespace Microsoft.Quantum.Samples.BitFlipCode {
105
105
operation CheckBitFlipCodeStateParity () : Unit {
106
106
107
107
// 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〉
109
109
// state that we can use to encode.
110
110
using (register = Qubit [3 ]) {
111
111
let data = register [0 ];
112
- let auxillaryQubits = register [1 .. 2 ];
112
+ let auxiliaryQubits = register [1 .. 2 ];
113
113
Rx (PI () / 3.0 , data );
114
114
115
115
// Next, we encode our test state.
116
- EncodeIntoBitFlipCode (data , auxillaryQubits );
116
+ EncodeIntoBitFlipCode (data , auxiliaryQubits );
117
117
118
118
// At this point, register represents a code block
119
119
// that protects the state R_x(π / 3) |0〉.
@@ -143,7 +143,7 @@ namespace Microsoft.Quantum.Samples.BitFlipCode {
143
143
144
144
// To check that we have not disturbed the state, we decode,
145
145
// rotate back, and assert once more.
146
- Adjoint EncodeIntoBitFlipCode (data , auxillaryQubits );
146
+ Adjoint EncodeIntoBitFlipCode (data , auxiliaryQubits );
147
147
Adjoint Rx (PI () / 3.0 , data );
148
148
Assert ([PauliZ ], [data ], Zero , "Didn't return to |0〉!" );
149
149
}
@@ -185,9 +185,9 @@ namespace Microsoft.Quantum.Samples.BitFlipCode {
185
185
// We start by proceeding the same way as above
186
186
// in order to obtain the code block state |̅ψ〉.
187
187
let data = register [0 ];
188
- let auxillaryQubits = register [1 .. 2 ];
188
+ let auxiliaryQubits = register [1 .. 2 ];
189
189
Rx (PI () / 3.0 , data );
190
- EncodeIntoBitFlipCode (data , auxillaryQubits );
190
+ EncodeIntoBitFlipCode (data , auxiliaryQubits );
191
191
192
192
// Next, we apply the error that we've been given to the
193
193
// entire register.
@@ -222,7 +222,7 @@ namespace Microsoft.Quantum.Samples.BitFlipCode {
222
222
223
223
// To check that we have not disturbed the state, we decode,
224
224
// rotate back, and assert once more.
225
- Adjoint EncodeIntoBitFlipCode (data , auxillaryQubits );
225
+ Adjoint EncodeIntoBitFlipCode (data , auxiliaryQubits );
226
226
Adjoint Rx (PI () / 3.0 , data );
227
227
Assert ([PauliZ ], [data ], Zero , "Didn't return to |0〉!" );
228
228
}
@@ -311,14 +311,14 @@ namespace Microsoft.Quantum.Samples.BitFlipCode {
311
311
operation CheckCodeCorrectsError (code : QECC , nScratch : Int , fn : RecoveryFn , error : (Qubit [] => Unit )) : Unit {
312
312
313
313
// 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
315
315
// data qubit.
316
316
using (register = Qubit [1 + nScratch ]) {
317
317
318
318
// We start by proceeding the same way as above
319
319
// in order to obtain the code block state |̅ψ〉.
320
320
let data = register [0 ];
321
- let auxillaryQubits = register [1 .. nScratch ];
321
+ let auxiliaryQubits = register [1 .. nScratch ];
322
322
Rx (PI () / 3.0 , data );
323
323
324
324
// We differ this time, however, in how we perform the
@@ -336,7 +336,7 @@ namespace Microsoft.Quantum.Samples.BitFlipCode {
336
336
// blocks.
337
337
// Note that we also pass data as an array of qubits, to
338
338
// allow for codes which protect multiple qubits in one block.
339
- let codeBlock = encode ! ([data ], auxillaryQubits );
339
+ let codeBlock = encode ! ([data ], auxiliaryQubits );
340
340
341
341
// Next, we cause an error as usual.
342
342
error (codeBlock ! );
@@ -347,8 +347,8 @@ namespace Microsoft.Quantum.Samples.BitFlipCode {
347
347
Recover (code , fn , codeBlock );
348
348
349
349
// 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 );
352
352
353
353
// Finally, we test that our test state was protected.
354
354
Adjoint Rx (PI () / 3.0 , data );
0 commit comments