Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions library/chemistry/src/JordanWigner/OptimizedBlockEncoding.qs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function OptimizedBEGeneratorSystemCoeff(optimizedBEGeneratorSystem : OptimizedB
/// `GeneratorIndex` representing a Z term.
///
/// # Output
/// `GeneratorIndex[]` expressing Z term as Pauli terms.
/// `OptimizedBETermIndex` expressing Z term as Pauli terms.
function ZTermToPauliMajIdx(term : GeneratorIndex) : OptimizedBETermIndex {
let (_, coeff) = term.Term;
let idxFermions = term.Subsystem;
Expand Down Expand Up @@ -143,7 +143,7 @@ function ZTermToPauliMajIdx(term : GeneratorIndex) : OptimizedBETermIndex {
/// `GeneratorIndex` representing a ZZ term.
///
/// # Output
/// `GeneratorIndex[]` expressing ZZ term as Pauli terms.
/// `OptimizedBETermIndex` expressing ZZ term as Pauli terms.
function ZZTermToPauliMajIdx(term : GeneratorIndex) : OptimizedBETermIndex {
let (_, coeff) = term.Term;
let idxFermions = term.Subsystem;
Expand Down Expand Up @@ -172,7 +172,7 @@ function ZZTermToPauliMajIdx(term : GeneratorIndex) : OptimizedBETermIndex {
/// `GeneratorIndex` representing a PQ term.
///
/// # Output
/// `GeneratorIndex[]` expressing PQ term as Pauli terms.
/// `OptimizedBETermIndex` expressing PQ term as Pauli terms.
function PQTermToPauliMajIdx(term : GeneratorIndex) : OptimizedBETermIndex {
let (_, coeff) = term.Term;
let idxFermions = term.Subsystem;
Expand Down Expand Up @@ -201,7 +201,7 @@ function PQTermToPauliMajIdx(term : GeneratorIndex) : OptimizedBETermIndex {
/// `GeneratorIndex` representing a PQ or PQQR term.
///
/// # Output
/// `GeneratorIndex[]` expressing PQ or PQQR term as Pauli terms.
/// `OptimizedBETermIndex` expressing PQ or PQQR term as Pauli terms.
function PQandPQQRTermToPauliMajIdx(term : GeneratorIndex) : OptimizedBETermIndex {
let (_, coeff) = term.Term;
let idxFermions = term.Subsystem;
Expand Down Expand Up @@ -238,7 +238,7 @@ function PQandPQQRTermToPauliMajIdx(term : GeneratorIndex) : OptimizedBETermInde
/// `GeneratorIndex` representing a PQRS term.
///
/// # Output
/// `GeneratorIndex[]` expressing PQRS term as Pauli terms.
/// `OptimizedBETermIndex[]` expressing PQRS term as Pauli terms.
function V0123TermToPauliMajIdx(term : GeneratorIndex) : OptimizedBETermIndex[] {
let (_, v0123) = term.Term;
let idxFermions = term.Subsystem;
Expand Down
14 changes: 7 additions & 7 deletions library/chemistry/src/MixedStatePreparation.qs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import Utils.RangeAsIntArray;
/// state.
/// ## Prepare
/// An operation that, given an index register, a data register, and a
/// garbage register initially in the $\ket{0}$, $\let{00\dots 0}$, and
/// garbage register initially in the $\ket{0}$, $\ket{00\dots 0}$, and
/// $\ket{00\dots 0}$ states (respectively),
/// prepares the state represented by this UDT value on those registers.
struct MixedStatePreparation {
Expand All @@ -42,13 +42,13 @@ struct MixedStatePreparation {
/// mixed state.
///
/// # Input
/// ## NTotalQubits
/// ## NumTotalQubits
/// The total number of qubits required by the represented state preparation
/// operation.
/// ## NIndexQubits
/// ## NumIndexQubits
/// The number of qubits required for the index register used by the
/// represented state preparation operation.
/// ## NGarbageQubits
/// ## NumGarbageQubits
/// The number of qubits required for the garbage register used by the
/// represented state preparation operation.
struct MixedStatePreparationRequirements {
Expand All @@ -58,7 +58,7 @@ struct MixedStatePreparationRequirements {
}

/// # Summary
/// Returns an operation that prepares a a purification of a given mixed state.
/// Returns an operation that prepares a purification of a given mixed state.
/// A "purified mixed state" refers to states of the form |ψ⟩ = Σᵢ √𝑝ᵢ |𝑖⟩ |garbageᵢ⟩ specified by a vector of
/// coefficients {𝑝ᵢ}. States of this form can be reduced to mixed states ρ ≔ 𝑝ᵢ |𝑖⟩⟨𝑖| by tracing over the "garbage"
/// register (that is, a mixed state that is diagonal in the computational basis).
Expand Down Expand Up @@ -128,8 +128,8 @@ struct MixedStatePreparationRequirements {
/// let coefficients = [1.0, 2.0, 3.0, 4.0, 5.0];
/// let targetError = 1e-3;
/// let purifiedState = PurifiedMixedState(targetError, coefficients);
/// using (indexRegister = Qubit[purifiedState.Requirements.NIndexQubits]) {
/// using (garbageRegister = Qubit[purifiedState.Requirements.NGarbageQubits]) {
/// using (indexRegister = Qubit[purifiedState.Requirements.NumIndexQubits]) {
/// using (garbageRegister = Qubit[purifiedState.Requirements.NumGarbageQubits]) {
/// purifiedState.Prepare(LittleEndian(indexRegister), [], garbageRegister);
/// }
/// }
Expand Down
4 changes: 2 additions & 2 deletions library/chemistry/src/Tests.qs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ operation OptimizedBEOperatorZeroTestHelper(pauliBasis : Pauli, targetRegisterSi
}
} else {

// Test Identitfy Pauli
// Test Identify Pauli
// |0> -> |0>
// |+> -> |+>
Message($"Test ZI Pauli on qubit {idxTest}");
Expand Down Expand Up @@ -175,7 +175,7 @@ operation OptimizedBEOperatorPlusTestHelper(pauliBasis : Pauli, targetRegisterSi
}

} else {
// Test Identitfy Pauli
// Test Identify Pauli
// |0> -> |0>
// |+> -> |+>
Message($"Test I Pauli on qubit {idxTest}");
Expand Down
2 changes: 1 addition & 1 deletion library/fixed_point/src/Operations.qs
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,4 @@ export
InvertFxP,
SubtractFxP,
MultiplyFxP,
SquareFxP;
SquareFxP;
4 changes: 2 additions & 2 deletions library/fixed_point/src/Tests.qs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ operation TestOperation(a : Double, b : Double, op : (FixedPoint, FixedPoint) =>

let expected = reference(a, b);
let difference = expected - measured;
Fact(difference < 0.001, $"Difference of {difference} is outside of the expected range. Expected {expected} and measured result was {measured}. (Inputs were {name}({a}, {b})");
Fact(difference < 0.001, $"Difference of {difference} is outside of the expected range. Expected {expected} and measured result was {measured}. (Inputs were {name}({a}, {b}))");
ResetAll(register1 + register2);
}

Expand All @@ -117,6 +117,6 @@ operation TestOperation3(a : Double, b : Double, op : (FixedPoint, FixedPoint, F

let expected = reference(a, b);
let difference = expected - measured;
Fact(difference < 0.001, $"Difference of {difference} is outside of the expected range. Expected {expected} and measured result was {measured}. (Inputs were {name}({a}, {b})");
Fact(difference < 0.001, $"Difference of {difference} is outside of the expected range. Expected {expected} and measured result was {measured}. (Inputs were {name}({a}, {b}))");
ResetAll(register1 + register2);
}
6 changes: 3 additions & 3 deletions library/qtest/src/Operations.qs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ operation CheckAllTestCases<'T : Eq + Show>(test_cases : (String, Int, Qubit[] =
/// This is a good alternative to `CheckAllTestCases` when you want custom output based on the results of your tests,
/// or more control over how test results are rendered.
/// # Input
/// Takes a list of test cases. A test case is a tuple of `(String, () => 'T, 'T)`, where
/// the first String is the name of the test, the function is the test case itself, and the
/// final element of the tuple is the expected return value from the test case.
/// Takes a list of test cases. A test case is a tuple of `(String, Int, Qubit[] => Unit, Qubit[] => 'T, 'T)`, where
/// the first String is the name of the test, the Int is the number of qubits, the first operation prepares the state,
/// the second operation is the test case itself, and the final element is the expected return value.
///
/// # Example
/// ```qsharp
Expand Down
2 changes: 1 addition & 1 deletion library/signed/src/Measurement.qs
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ operation MeasureSignedInteger(target : Qubit[], width : Int) : Int {
number * coefficient
}

export MeasureSignedInteger;
export MeasureSignedInteger;
2 changes: 1 addition & 1 deletion library/signed/src/Operations.qs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ operation Invert2sSI(xs : Qubit[]) : Unit is Adj + Ctl {
///
/// # Remarks
/// Uses a standard shift-and-subtract approach to implement the division.
/// The controlled version is specialized such the subtraction does not
/// The controlled version is specialized such that the subtraction does not
/// require additional controls.
operation DivideI(xs : Qubit[], ys : Qubit[], result : Qubit[]) : Unit is Adj + Ctl {
body (...) {
Expand Down
4 changes: 2 additions & 2 deletions library/std/src/Std/ArithmeticUtils.qs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import
/// Computation, Vol. 10, 2010.
/// https://arxiv.org/abs/0910.2530
operation ApplyOuterTTKAdder(xs : Qubit[], ys : Qubit[]) : Unit is Adj + Ctl {
Fact(Length(xs) <= Length(ys), "Input register ys must be at lease as long as xs.");
Fact(Length(xs) <= Length(ys), "Input register ys must be at least as long as xs.");
for i in 1..Length(xs) - 1 {
CNOT(xs[i], ys[i]);
}
Expand Down Expand Up @@ -106,7 +106,7 @@ operation ApplyInnerTTKAdderWithCarry(xs : Qubit[], ys : Qubit[]) : Unit is Adj
(Controlled ApplyInnerTTKAdderWithCarry)([], (xs, ys));
}
controlled (controls, ...) {
Fact(Length(xs) + 1 == Length(ys), "ys must be one qubit longer then xs.");
Fact(Length(xs) + 1 == Length(ys), "ys must be one qubit longer than xs.");
Fact(Length(xs) > 0, "Array should not be empty.");


Expand Down
4 changes: 2 additions & 2 deletions library/std/src/Std/TableLookup.qs
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ operation PhaseLookup(qs : Qubit[], data : Bool[]) : Unit {
let m2 = 1 <<< n2;
Fact(m1 * m2 == m, "Length of halves must match total length.");

// Allocate auxilliary qubits
// Allocate auxiliary qubits
use aux_qubits1 = Qubit[2^n1 - n1 - 1];
use aux_qubits2 = Qubit[2^n2 - n2 - 1];

Expand Down Expand Up @@ -361,7 +361,7 @@ operation ConstructPowerProducts(qubits : Qubit[], aux_qubits : Qubit[]) : Qubit
power_products += [next_power_product];
}
}
Fact(next_available == Length(aux_qubits), "All auxilliary qubits should be used.");
Fact(next_available == Length(aux_qubits), "All auxiliary qubits should be used.");
return power_products;
}

Expand Down
8 changes: 4 additions & 4 deletions library/table_lookup/src/Lookup.qs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ operation Lookup(
) : Unit is Adj + Ctl {
body (...) {
if (options.lookupAlgorithm == DoStdLookup()) {
// Don't do anthing beyond standard library select.
// Don't do anything beyond standard library select.
Std.TableLookup.Select(data, address, target);
return ();
}
Expand Down Expand Up @@ -181,7 +181,7 @@ operation Lookup(
}

if options.lookupAlgorithm == DoStdLookup() {
// Don't do anthing beyond standard library select.
// Don't do anything beyond standard library select.
Controlled Std.TableLookup.Select(controls, (data, address, target));
return ();
}
Expand Down Expand Up @@ -242,7 +242,7 @@ operation Lookup(

adjoint (...) {
if (options.unlookupAlgorithm == DoStdUnlookup()) {
// Don't do anthing beyond standard library select.
// Don't do anything beyond standard library select.
Adjoint Std.TableLookup.Select(data, address, target);
return ();
}
Expand Down Expand Up @@ -280,7 +280,7 @@ operation Lookup(

controlled adjoint (controls, ...) {
if options.unlookupAlgorithm == DoStdUnlookup() {
// Don't do anthing beyond standard library select.
// Don't do anything beyond standard library select.
Controlled Adjoint Std.TableLookup.Select(controls, (data, address, target));
return ();
}
Expand Down
4 changes: 2 additions & 2 deletions library/table_lookup/src/LookupViaPP.qs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ operation LookupViaPP(
data
};

// Allocate auxilliary qubits.
// Allocate auxiliary qubits.
use aux_qubits = Qubit[GetAuxCountForPP(address_size)];

// Construct power products.
Expand Down Expand Up @@ -91,7 +91,7 @@ operation LookupViaSplitPP(
let m2 = 1 <<< n2;
Fact(m1 * m2 == m, "Length of halves must match total length.");

// Allocate auxilliary qubits.
// Allocate auxiliary qubits.
use aux_qubits1 = Qubit[2^n1 - n1 - 1];
use aux_qubits2 = Qubit[2^n2 - n2 - 1];

Expand Down
2 changes: 1 addition & 1 deletion library/table_lookup/src/PhaseLookup.qs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ operation PhaseLookupViaSplitPP(address : Qubit[], data : Bool[]) : Unit {
let m2 = 1 <<< n2;
Fact(m1 * m2 == addressable_space, "Length of halves must match total length.");

// Allocate auxilliary qubits.
// Allocate auxiliary qubits.
use aux_qubits1 = Qubit[GetAuxCountForPP(n1)];
use aux_qubits2 = Qubit[GetAuxCountForPP(n2)];

Expand Down
4 changes: 2 additions & 2 deletions library/table_lookup/src/PowerProducts.qs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ operation ConstructPowerProducts(qubits : Qubit[], aux_qubits : Qubit[]) : Qubit
power_products += [next_power_product];
}
}
Fact(next_available == Length(aux_qubits), "ConstructPowerProducts: All auxilliary qubits should be used.");
Fact(next_available == Length(aux_qubits), "ConstructPowerProducts: All auxiliary qubits should be used.");
return power_products;
}

Expand Down Expand Up @@ -102,7 +102,7 @@ function GetAuxCountForPP(nQubits : Int) : Int {
// Tests

internal operation ConstructDestructPowerProducts(qs : Qubit[]) : Unit {
// For monomials with more than one variable we need auxilliary qubits.
// For monomials with more than one variable we need auxiliary qubits.
use aux_qubits = Qubit[GetAuxCountForPP(Length(qs))];

// Construct/destruct should leave qs unchanged.
Expand Down
Loading