From a1767c0e1ef1b1ed3213bb262677a659ab7f2e21 Mon Sep 17 00:00:00 2001 From: Conrad Johnston Date: Fri, 3 Oct 2025 08:31:15 -0700 Subject: [PATCH] Housekeeping: Tidy up spelling Tidying up some spelling errors in comments, error messages, etc. --- .../algorithms/DotProductViaPhaseEstimation.qs | 2 +- samples/algorithms/PhaseEstimation.qs | 2 +- samples/algorithms/PhaseFlipCode.qs | 4 ++-- samples/algorithms/SimpleVQE.qs | 4 ++-- samples/algorithms/SuperdenseCoding.qs | 2 +- samples/language/CustomMeasurements.qs | 2 +- samples/language/Qubit.qs | 2 +- samples/language/Range.qs | 2 +- samples/language/Specializations.qs | 2 +- source/compiler/qsc/src/incremental.rs | 2 +- .../compiler/qsc/src/interpret/circuit_tests.rs | 2 +- source/compiler/qsc/src/qasm.rs | 4 ++-- source/compiler/qsc_ast/src/ast.rs | 2 +- .../compiler/qsc_circuit/src/json_to_circuit.rs | 2 +- source/compiler/qsc_codegen/src/qir.rs | 2 +- .../qsc_data_structures/src/line_column/tests.rs | 4 ++-- source/compiler/qsc_eval/src/intrinsic/tests.rs | 2 +- source/compiler/qsc_fir/src/fir.rs | 2 +- source/compiler/qsc_fir/src/ty.rs | 2 +- source/compiler/qsc_linter/src/linter.rs | 8 ++++---- source/compiler/qsc_lowerer/src/lib.rs | 4 ++-- .../qsc_partial_eval/src/evaluation_context.rs | 2 +- source/compiler/qsc_partial_eval/src/lib.rs | 4 ++-- source/compiler/qsc_qasm/README.md | 2 +- source/compiler/qsc_qasm/src/compiler.rs | 2 +- source/compiler/qsc_qasm/src/display_utils.rs | 4 ++-- source/compiler/qsc_qasm/src/lex/raw.rs | 2 +- source/compiler/qsc_qasm/src/lib.rs | 2 +- source/compiler/qsc_qasm/src/parser/stmt.rs | 2 +- .../compiler/qsc_qasm/src/semantic/const_eval.rs | 2 +- source/compiler/qsc_qasm/src/semantic/error.rs | 2 +- source/compiler/qsc_qasm/src/semantic/lowerer.rs | 16 ++++++++-------- .../resources/openqasm_compiler_errors_test.qasm | 4 ++-- .../resources/openqasm_lowerer_errors_test.qasm | 2 +- source/compiler/qsc_qasm/src/semantic/symbols.rs | 2 +- .../tests/expression/builtin_functions/sizeof.rs | 2 +- .../src/semantic/tests/lowerer_errors.rs | 2 +- source/compiler/qsc_qasm/src/semantic/types.rs | 4 ++-- source/compiler/qsc_qasm/src/stdlib/angle.rs | 2 +- .../qsc_qasm/src/stdlib/builtin_functions.rs | 2 +- source/compiler/qsc_qasm/src/tests/fuzz.rs | 2 +- .../qsc_qasm/src/tests/statement/switch.rs | 2 +- source/compiler/qsc_rca/src/applications.rs | 4 ++-- source/compiler/qsc_rca/src/common.rs | 2 +- source/compiler/qsc_rca/src/core.rs | 4 ++-- source/compiler/qsc_rca/src/lib.rs | 4 ++-- .../qsc_rir/src/passes/remap_block_ids.rs | 2 +- .../qsc_rir/src/passes/unreachable_code_check.rs | 2 +- .../src/completion/ast_context.rs | 2 +- source/language_service/src/completion/qsharp.rs | 2 +- source/noisy_simulator/src/instrument.rs | 2 +- source/noisy_simulator/src/lib.rs | 2 +- source/npm/qsharp/generate_katas_content.js | 4 ++-- source/npm/qsharp/markdown_latex_plugin.js | 4 ++-- source/npm/qsharp/src/log.ts | 2 +- source/npm/qsharp/src/workers/common.ts | 2 +- source/npm/qsharp/ux/circuit-vis/utils.ts | 2 +- source/npm/qsharp/ux/histogram.tsx | 4 ++-- source/npm/qsharp/ux/qsharp-ux.css | 2 +- source/npm/qsharp/ux/scatterChart.tsx | 2 +- source/pip/qsharp/_native.pyi | 2 +- source/pip/qsharp/_qsharp.py | 10 +++++----- source/pip/qsharp/estimator/_estimator.py | 2 +- .../qsharp/interop/qiskit/backends/qirtarget.py | 2 +- .../interop/qiskit/backends/qsharp_backend.py | 2 +- source/pip/qsharp/telemetry.py | 2 +- source/pip/src/generic_estimator/factory.rs | 6 +++--- source/pip/src/generic_estimator/utils.rs | 2 +- source/pip/src/interpreter.rs | 2 +- source/pip/src/noisy_simulator.rs | 2 +- .../adaptive_ri/input/DeutschJozsaNISQ.qs | 2 +- .../input/IntrinsicRotationsWithPeriod.qs | 2 +- .../adaptive_ri/input/SuperdenseCoding.qs | 2 +- .../input/ThreeQubitRepetitionCode.qs | 2 +- source/playground/public/katas.html | 2 +- source/resource_estimator/README.md | 2 +- .../src/estimates/error_correction.rs | 4 ++-- .../src/estimates/factory/round_based.rs | 2 +- source/resource_estimator/src/lib.rs | 2 +- source/resource_estimator/src/system.rs | 2 +- .../src/system/data/job_params.rs | 2 +- .../resource_estimator/src/system/data/report.rs | 2 +- source/resource_estimator/src/system/error.rs | 2 +- .../src/system/modeling/physical_qubit.rs | 2 +- .../src/system/modeling/tfactory/tests.rs | 2 +- .../code_distance_iterators/tests.rs | 2 +- .../src/system/test_report.json | 2 +- source/vscode/src/azure/workspaceActions.ts | 2 +- source/vscode/src/debugger/session.ts | 4 ++-- .../vscode/src/language-service/testExplorer.ts | 2 +- source/vscode/src/notebookTemplate.ts | 2 +- source/widgets/js/index.tsx | 2 +- source/widgets/src/qsharp_widgets/__init__.py | 2 +- 93 files changed, 126 insertions(+), 126 deletions(-) diff --git a/samples/algorithms/DotProductViaPhaseEstimation.qs b/samples/algorithms/DotProductViaPhaseEstimation.qs index 2c10db9382..344567bd99 100644 --- a/samples/algorithms/DotProductViaPhaseEstimation.qs +++ b/samples/algorithms/DotProductViaPhaseEstimation.qs @@ -124,7 +124,7 @@ operation IterativePhaseEstimation( } /// # Summary -/// This is state preperation operator A for encoding the 2D vector (page 7) +/// This is state preparation operator A for encoding the 2D vector (page 7) operation StateInitialisation( TargetReg : Qubit, AncilReg : Qubit, diff --git a/samples/algorithms/PhaseEstimation.qs b/samples/algorithms/PhaseEstimation.qs index 8075946933..7006d90859 100644 --- a/samples/algorithms/PhaseEstimation.qs +++ b/samples/algorithms/PhaseEstimation.qs @@ -59,7 +59,7 @@ operation EstimateEigenvalue( /// # Summary /// Given a qubit register `qs` measure each qubit in the register -/// assume reults represent a binary fraction in little-endian order +/// assume results represent a binary fraction in little-endian order /// and return the fraction as a `Double` value. operation MeasureBinaryFractionLE(qs : Qubit[]) : Double { mutable result = 0.0; diff --git a/samples/algorithms/PhaseFlipCode.qs b/samples/algorithms/PhaseFlipCode.qs index cf4ea9cb31..3a1e45ecea 100644 --- a/samples/algorithms/PhaseFlipCode.qs +++ b/samples/algorithms/PhaseFlipCode.qs @@ -121,7 +121,7 @@ operation ChangeBasis(qs : Qubit[]) : Unit is Adj { operation CorrectError(logicalQubit : Qubit[]) : Unit { Fact(Length(logicalQubit) == 3, "`logicalQubit` must be length 3"); - // Entangle the parity of the physical qubits into two auxillary qubits. + // Entangle the parity of the physical qubits into two auxiliary qubits. use aux = Qubit[2]; ChangeBasis(logicalQubit); CNOT(logicalQubit[0], aux[0]); @@ -130,7 +130,7 @@ operation CorrectError(logicalQubit : Qubit[]) : Unit { CNOT(logicalQubit[2], aux[1]); ChangeBasis(logicalQubit); - // Measure the parity information from the auxillary qubits. + // Measure the parity information from the auxiliary qubits. let (parity01, parity12) = (M(aux[0]), M(aux[1])); ResetAll(aux); diff --git a/samples/algorithms/SimpleVQE.qs b/samples/algorithms/SimpleVQE.qs index 08212dd77d..2954d85d8b 100644 --- a/samples/algorithms/SimpleVQE.qs +++ b/samples/algorithms/SimpleVQE.qs @@ -101,7 +101,7 @@ operation PrepareAnsatzState(qs : Qubit[], thetas : Double[]) : Unit { } /// # Summary -/// Bosonic exitation circuit from the referenced paper. +/// Bosonic excitation circuit from the referenced paper. operation BosonicExitationTerm( theta : Double, moX : Qubit, @@ -117,7 +117,7 @@ operation BosonicExitationTerm( } /// # Summary -/// Non-bosonic exitation circuit from the referenced paper. +/// Non-bosonic excitation circuit from the referenced paper. operation NonBosonicExitataionTerm( theta : Double, moXsoX : Qubit, diff --git a/samples/algorithms/SuperdenseCoding.qs b/samples/algorithms/SuperdenseCoding.qs index 1ca263a2fb..eb4a8e735b 100644 --- a/samples/algorithms/SuperdenseCoding.qs +++ b/samples/algorithms/SuperdenseCoding.qs @@ -27,7 +27,7 @@ operation Main() : ((Bool, Bool), (Bool, Bool)) { return ((sourceBit1, sourceBit2), (decodedBit1, decodedBit2)); } -// Generates random bit using an auxilliary qubit +// Generates random bit using an auxiliary qubit operation DrawRandomBit() : Bool { use q = Qubit(); H(q); diff --git a/samples/language/CustomMeasurements.qs b/samples/language/CustomMeasurements.qs index 8addd2d654..d669b1e0a2 100644 --- a/samples/language/CustomMeasurements.qs +++ b/samples/language/CustomMeasurements.qs @@ -5,7 +5,7 @@ // The @Measurement attribute in Q# allows you to define custom measurements // that are lowered to QIR in the same way the `M` measurement in the standard // library is lowered. That means an `"irreversible"` attribute is added to -// the callable declaration and the output results are moved to the paramaters +// the callable declaration and the output results are moved to the parameters // and treated as result registers. // // # Who is this for? diff --git a/samples/language/Qubit.qs b/samples/language/Qubit.qs index 9f4badf6f9..9049fa0eb8 100644 --- a/samples/language/Qubit.qs +++ b/samples/language/Qubit.qs @@ -11,7 +11,7 @@ import Std.Diagnostics.DumpMachine; -/// In the below code, all varibles have type annotations to showcase their type. +/// In the below code, all variables have type annotations to showcase their type. operation Main() : Unit { // The following statement allocates three qubits. use qs = Qubit[3]; diff --git a/samples/language/Range.qs b/samples/language/Range.qs index 5dbbd4b819..f9157ba5c2 100644 --- a/samples/language/Range.qs +++ b/samples/language/Range.qs @@ -5,7 +5,7 @@ // Value literals for the Range type are expressions of the form `start..step..stop`, where `start`, `step`, // and `end` are expressions of type `Int`. If the step size is one, it may be omitted. For example, // `start..stop` is a valid `Range` literal and the same as `start..1..stop`. Closed ranges specify the -// `start` and `end` are provied, but open ranges may be expressed by omitting either or both of these +// `start` and `end` are provided, but open ranges may be expressed by omitting either or both of these // using the `...` syntax in one of the following forms: `start...`, `...end`, `...`. Open ranges may only // be used in array slices. diff --git a/samples/language/Specializations.qs b/samples/language/Specializations.qs index 834a1cf2c6..c761be8975 100644 --- a/samples/language/Specializations.qs +++ b/samples/language/Specializations.qs @@ -14,7 +14,7 @@ /// specializations (`Adj + Ctl`). operation DoNothing() : Unit is Adj + Ctl {} -/// Here, the specializations hvae been explicitly defined. +/// Here, the specializations have been explicitly defined. /// In the following example, the declaration for an operation SWAP, /// which exchanges the state of two qubits q1 and q2, declares an /// explicit specialization for its adjoint version and its controlled diff --git a/source/compiler/qsc/src/incremental.rs b/source/compiler/qsc/src/incremental.rs index 91d39ca8bd..d959df8c07 100644 --- a/source/compiler/qsc/src/incremental.rs +++ b/source/compiler/qsc/src/incremental.rs @@ -286,7 +286,7 @@ impl Compiler { } /// Returns the ID of the source package created from the sources - /// passed in during inital creation. + /// passed in during initial creation. #[must_use] pub fn source_package_id(&self) -> PackageId { self.source_package_id diff --git a/source/compiler/qsc/src/interpret/circuit_tests.rs b/source/compiler/qsc/src/interpret/circuit_tests.rs index ea0c475c91..e875f61e58 100644 --- a/source/compiler/qsc/src/interpret/circuit_tests.rs +++ b/source/compiler/qsc/src/interpret/circuit_tests.rs @@ -999,7 +999,7 @@ fn operation_with_subsequent_qubits_no_added_rows() { .assert_eq(&circ.to_string()); } -/// Tests that invoke circuit generation throught the debugger. +/// Tests that invoke circuit generation through the debugger. mod debugger_stepping { use super::Debugger; use crate::target::Profile; diff --git a/source/compiler/qsc/src/qasm.rs b/source/compiler/qsc/src/qasm.rs index 773a48108a..006455e60e 100644 --- a/source/compiler/qsc/src/qasm.rs +++ b/source/compiler/qsc/src/qasm.rs @@ -74,10 +74,10 @@ pub fn compile_openqasm(unit: QasmCompileUnit, package_type: PackageType) -> Com // We allow the best effort compilation, but for errors we only // want to provide OpenQASM OR Q# errors. Otherwise we get confusing - // error reporting and duplicate errors (like undeclared idenfifier and + // error reporting and duplicate errors (like undeclared identifier and // type errors) let surfaced_errors = if openqasm_errors.is_empty() { - // we have no OpenQASM errors, surface the Q# compliation errors + // we have no OpenQASM errors, surface the Q# compilation errors compile_errors } else { // We have OpenQASM errors, convert them to the same type as as the Q# diff --git a/source/compiler/qsc_ast/src/ast.rs b/source/compiler/qsc_ast/src/ast.rs index 2a740ba03b..bb90611a40 100644 --- a/source/compiler/qsc_ast/src/ast.rs +++ b/source/compiler/qsc_ast/src/ast.rs @@ -334,7 +334,7 @@ pub struct TyDef { } impl TyDef { - /// Returns true if the tye definition satisfies the conditions for a struct. + /// Returns true if the type definition satisfies the conditions for a struct. /// Conditions for a struct are that the `TyDef` is a tuple with all its top-level fields named. /// Otherwise, returns false. #[must_use] diff --git a/source/compiler/qsc_circuit/src/json_to_circuit.rs b/source/compiler/qsc_circuit/src/json_to_circuit.rs index e5200127ff..c37be61b09 100644 --- a/source/compiler/qsc_circuit/src/json_to_circuit.rs +++ b/source/compiler/qsc_circuit/src/json_to_circuit.rs @@ -160,7 +160,7 @@ fn map_register_field(field: Option<&Value>) -> Vec { register.insert("result".to_string(), c_id.clone()); } // Note: if "qId" is missing, the json deserialization later on - // will fail and produce the approprate error + // will fail and produce the appropriate error if let Some(q_id) = item.get("qId") { register.insert("qubit".to_string(), q_id.clone()); } diff --git a/source/compiler/qsc_codegen/src/qir.rs b/source/compiler/qsc_codegen/src/qir.rs index 71f307cb8f..5787dfa905 100644 --- a/source/compiler/qsc_codegen/src/qir.rs +++ b/source/compiler/qsc_codegen/src/qir.rs @@ -649,7 +649,7 @@ impl ToQir for rir::Callable { self.call_type, rir::CallableType::Measurement | rir::CallableType::Reset ) { - // These callables are a special case that need the irreversable attribute. + // These callables are a special case that need the irreversible attribute. " #1" } else { "" diff --git a/source/compiler/qsc_data_structures/src/line_column/tests.rs b/source/compiler/qsc_data_structures/src/line_column/tests.rs index 4cde3288c9..2b016edb78 100644 --- a/source/compiler/qsc_data_structures/src/line_column/tests.rs +++ b/source/compiler/qsc_data_structures/src/line_column/tests.rs @@ -24,7 +24,7 @@ fn empty_string() { fn offset_out_of_bounds() { let contents = "hello"; let pos = Position::from_utf8_byte_offset(Encoding::Utf8, contents, 10); - // Sould return the position + // Should return the position expect![[r" Position { line: 0, @@ -44,7 +44,7 @@ fn position_out_of_bounds() { column: 10, }; let offset = pos.to_utf8_byte_offset(Encoding::Utf8, contents); - // Sould return the offset + // Should return the offset assert!(offset == contents.len() as u32); } diff --git a/source/compiler/qsc_eval/src/intrinsic/tests.rs b/source/compiler/qsc_eval/src/intrinsic/tests.rs index 3730ed57e8..12447d882d 100644 --- a/source/compiler/qsc_eval/src/intrinsic/tests.rs +++ b/source/compiler/qsc_eval/src/intrinsic/tests.rs @@ -215,7 +215,7 @@ fn check_intrinsic_output(file: &str, expr: &str, expect: &Expect) { let mut out = GenericReceiver::new(&mut stdout); match check_intrinsic(file, expr, &mut out) { Ok(..) => expect.assert_eq( - &String::from_utf8(stdout).expect("content should be convertable to string"), + &String::from_utf8(stdout).expect("content should be convertible to string"), ), Err(e) => expect.assert_eq(&e.to_string()), } diff --git a/source/compiler/qsc_fir/src/fir.rs b/source/compiler/qsc_fir/src/fir.rs index 01cc02fb05..5a60ead082 100644 --- a/source/compiler/qsc_fir/src/fir.rs +++ b/source/compiler/qsc_fir/src/fir.rs @@ -33,7 +33,7 @@ fn set_indentation<'a, 'b>( 0 => indent.with_str(""), 1 => indent.with_str(" "), 2 => indent.with_str(" "), - _ => unimplemented!("intentation level not supported"), + _ => unimplemented!("indentation level not supported"), } } diff --git a/source/compiler/qsc_fir/src/ty.rs b/source/compiler/qsc_fir/src/ty.rs index f128e8aa41..23ea72ee6f 100644 --- a/source/compiler/qsc_fir/src/ty.rs +++ b/source/compiler/qsc_fir/src/ty.rs @@ -19,7 +19,7 @@ fn set_indentation<'a, 'b>( 0 => indent.with_str(""), 1 => indent.with_str(" "), 2 => indent.with_str(" "), - _ => unimplemented!("intentation level not supported"), + _ => unimplemented!("indentation level not supported"), } } diff --git a/source/compiler/qsc_linter/src/linter.rs b/source/compiler/qsc_linter/src/linter.rs index 80b9691981..91e19722fc 100644 --- a/source/compiler/qsc_linter/src/linter.rs +++ b/source/compiler/qsc_linter/src/linter.rs @@ -31,7 +31,7 @@ pub fn run_lints( } /// This function is used by our unit tests, to make sure lints aren't duplicated under -/// normal circunstances. The `run_lints` functions deduplicates the lints to take care +/// normal circumstances. The `run_lints` functions deduplicates the lints to take care /// of a few special cases where the same expression (referring to the same span in the /// source code) appears referenced in multiple places in the HIR. pub(crate) fn run_lints_without_deduplication( @@ -225,7 +225,7 @@ impl Diagnostic for Lint { } /// A lint level. This defines if a lint will be treated as a warning or an error, -/// and if the lint level can be overriden by the user. +/// and if the lint level can be overridden by the user. #[derive(Debug, Clone, Copy, Default, Deserialize, Serialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub enum LintLevel { @@ -234,11 +234,11 @@ pub enum LintLevel { Allow, /// The lint will be treated as a warning. Warn, - /// The lint will be treated as a warning and cannot be overriden by the user. + /// The lint will be treated as a warning and cannot be overridden by the user. ForceWarn, /// The lint will be treated as an error. Error, - /// The lint will be treated as an error and cannot be overriden by the user. + /// The lint will be treated as an error and cannot be overridden by the user. ForceError, } diff --git a/source/compiler/qsc_lowerer/src/lib.rs b/source/compiler/qsc_lowerer/src/lib.rs index 148fa38aec..df61f24d3f 100644 --- a/source/compiler/qsc_lowerer/src/lib.rs +++ b/source/compiler/qsc_lowerer/src/lib.rs @@ -464,7 +464,7 @@ impl Lowerer { hir::ExprKind::Assign(lhs, rhs) => { let idx = self.exec_graph.len(); let lhs = self.lower_expr(lhs); - // The left-hand side of an assigment is not really an expression to be executed, + // The left-hand side of an assignment is not really an expression to be executed, // so remove any added nodes from the execution graph. self.exec_graph.drain(idx..); fir::ExprKind::Assign(lhs, self.lower_expr(rhs)) @@ -521,7 +521,7 @@ impl Lowerer { let idx = self.exec_graph.len(); let container = self.lower_expr(container); // The left-hand side of an array index assignment is not really an expression to be - // executed, so remove any added nodes from the exection graph. + // executed, so remove any added nodes from the execution graph. self.exec_graph.drain(idx..); fir::ExprKind::AssignIndex(container, index, replace) } diff --git a/source/compiler/qsc_partial_eval/src/evaluation_context.rs b/source/compiler/qsc_partial_eval/src/evaluation_context.rs index 797e473a6f..bcd6aeab3e 100644 --- a/source/compiler/qsc_partial_eval/src/evaluation_context.rs +++ b/source/compiler/qsc_partial_eval/src/evaluation_context.rs @@ -85,7 +85,7 @@ impl EvaluationContext { } } -/// Struct that represents a block node when we intepret an RIR program as a graph. +/// Struct that represents a block node when we interpret an RIR program as a graph. pub struct BlockNode { /// The ID of the block. pub id: BlockId, diff --git a/source/compiler/qsc_partial_eval/src/lib.rs b/source/compiler/qsc_partial_eval/src/lib.rs index 8fc557b149..577a3c27fd 100644 --- a/source/compiler/qsc_partial_eval/src/lib.rs +++ b/source/compiler/qsc_partial_eval/src/lib.rs @@ -1307,7 +1307,7 @@ impl<'a> PartialEvaluator<'a> { rhs_expr_id: ExprId, bin_op_expr_span: PackageSpan, // For diagnostic purposes only. ) -> Result { - // Consider optimization of array in-place operations instead of re-using the general binary operation + // Consider optimization of array in-place operations instead of reusing the general binary operation // evaluation. let lhs_expr = self.get_expr(lhs_expr_id); let lhs_expr_package_span = self.get_expr_package_span(lhs_expr_id); @@ -1705,7 +1705,7 @@ impl<'a> PartialEvaluator<'a> { let callable_id = self.get_or_insert_callable(callable); - // Resove the call arguments, create the call instruction and insert it to the current block. + // Resolve the call arguments, create the call instruction and insert it to the current block. let (args, ctls_arg) = self .resolve_args( (store_item_id.package, callable_decl.input).into(), diff --git a/source/compiler/qsc_qasm/README.md b/source/compiler/qsc_qasm/README.md index d03c5cc069..bbb4e2769f 100644 --- a/source/compiler/qsc_qasm/README.md +++ b/source/compiler/qsc_qasm/README.md @@ -31,7 +31,7 @@ The two languages have many differences, and insofar as possible, the compilatio QIR specific semantic constraints: -- OpenQASM ouput registers are declared with a fixed size and not all of the indexes may be populated with measurements. In QIR, `Result`s can only ever be acquired through measurement. So if all entries in an output register aren't measured into, a code generation error will occur. +- OpenQASM output registers are declared with a fixed size and not all of the indexes may be populated with measurements. In QIR, `Result`s can only ever be acquired through measurement. So if all entries in an output register aren't measured into, a code generation error will occur. Semantic details diff --git a/source/compiler/qsc_qasm/src/compiler.rs b/source/compiler/qsc_qasm/src/compiler.rs index c1f810e3b3..442a46c86e 100644 --- a/source/compiler/qsc_qasm/src/compiler.rs +++ b/source/compiler/qsc_qasm/src/compiler.rs @@ -160,7 +160,7 @@ pub struct QasmCompiler { /// The output semantics to follow when compiling to Q# AST. /// The program type to compile to. pub config: CompilerConfig, - /// The compiled statments accumulated during compilation. + /// The compiled statements accumulated during compilation. pub stmts: Vec, pub symbols: SymbolTable, pub errors: Vec>, diff --git a/source/compiler/qsc_qasm/src/display_utils.rs b/source/compiler/qsc_qasm/src/display_utils.rs index 0e3177cbb8..79b7127df2 100644 --- a/source/compiler/qsc_qasm/src/display_utils.rs +++ b/source/compiler/qsc_qasm/src/display_utils.rs @@ -4,7 +4,7 @@ use std::fmt::{self, Display, Write}; /// Takes a unicode buffer or stream and wraps it with -/// `indenter::Idented`. Which applies an indentation of 1 +/// `indenter::Indented`. Which applies an indentation of 1 /// each time you insert a new line. fn with_indentation(f: &mut T) -> indenter::Indented<'_, T> where @@ -14,7 +14,7 @@ where set_indentation(indent, 1) } -/// Takes an `indenter::Idented` and changes its indentation level. +/// Takes an `indenter::Indented` and changes its indentation level. fn set_indentation(indent: indenter::Indented<'_, T>, level: usize) -> indenter::Indented<'_, T> where T: fmt::Write, diff --git a/source/compiler/qsc_qasm/src/lex/raw.rs b/source/compiler/qsc_qasm/src/lex/raw.rs index 4e0be3285d..891f53f08e 100644 --- a/source/compiler/qsc_qasm/src/lex/raw.rs +++ b/source/compiler/qsc_qasm/src/lex/raw.rs @@ -28,7 +28,7 @@ use std::{ enum NumberLexError { /// A number ending in an underscore. EndsInUnderscore, - /// An incomplete binary, octal, or hex numer. + /// An incomplete binary, octal, or hex number. Incomplete, /// The token wasn't parsed and no characters were consumed /// when trying to parse the token. diff --git a/source/compiler/qsc_qasm/src/lib.rs b/source/compiler/qsc_qasm/src/lib.rs index cb2653c9e8..7b9b507e0e 100644 --- a/source/compiler/qsc_qasm/src/lib.rs +++ b/source/compiler/qsc_qasm/src/lib.rs @@ -87,7 +87,7 @@ pub enum ErrorKind { /// Q# requires qubits to be in the 0 state before and after use. /// Qiskit makes no assumptions about the state of qubits before or after use. /// -/// During compliation, if Qiskit semantics are used, the compiler will insert +/// During compilation, if Qiskit semantics are used, the compiler will insert /// calls to create qubits instead of `use` bindings. This means that later /// compiler passes won't generate the Q# code that would check the qubits. /// diff --git a/source/compiler/qsc_qasm/src/parser/stmt.rs b/source/compiler/qsc_qasm/src/parser/stmt.rs index 28c804ca96..e1fcafb3a6 100644 --- a/source/compiler/qsc_qasm/src/parser/stmt.rs +++ b/source/compiler/qsc_qasm/src/parser/stmt.rs @@ -1555,7 +1555,7 @@ fn parse_many_boxable_stmt(s: &mut ParserContext) -> Result> { /// 8. `Ident q;` /// /// (1) is a quantum-gate-call, (2) is a binary operation, (3) is a function call, and -/// (4) is an identifer. We don't know for sure until we see the what is beyond the gate +/// (4) is an identifier. We don't know for sure until we see the what is beyond the gate /// name and its potential classical parameters. /// /// Therefore, we parse the gate name and its potential parameters using the expr parser. diff --git a/source/compiler/qsc_qasm/src/semantic/const_eval.rs b/source/compiler/qsc_qasm/src/semantic/const_eval.rs index 702eeff6af..59536f6dcb 100644 --- a/source/compiler/qsc_qasm/src/semantic/const_eval.rs +++ b/source/compiler/qsc_qasm/src/semantic/const_eval.rs @@ -123,7 +123,7 @@ impl Expr { } ExprKind::SizeofCall(_) => { // We only lower SizeofCall expressions that should be evaluated - // at runtime. The ones that can be const evaluated are hanlded + // at runtime. The ones that can be const evaluated are handled // in [`Lowerer::lower_sizeof_call_expr`]. None } diff --git a/source/compiler/qsc_qasm/src/semantic/error.rs b/source/compiler/qsc_qasm/src/semantic/error.rs index 73a6c558e8..d63ba3362c 100644 --- a/source/compiler/qsc_qasm/src/semantic/error.rs +++ b/source/compiler/qsc_qasm/src/semantic/error.rs @@ -222,7 +222,7 @@ pub enum SemanticErrorKind { #[error("return statements on a non-void subroutine should have a target expression")] #[diagnostic(code("Qasm.Lowerer.MissingTargetExpressionInReturnStmt"))] MissingTargetExpressionInReturnStmt(#[label] Span), - #[error("control counts must be postitive integers")] + #[error("control counts must be positive integers")] #[diagnostic(code("Qasm.Lowerer.NegativeControlCount"))] NegativeControlCount(#[label] Span), #[error("non-void def should always return")] diff --git a/source/compiler/qsc_qasm/src/semantic/lowerer.rs b/source/compiler/qsc_qasm/src/semantic/lowerer.rs index c9a408acd5..949edd0219 100644 --- a/source/compiler/qsc_qasm/src/semantic/lowerer.rs +++ b/source/compiler/qsc_qasm/src/semantic/lowerer.rs @@ -498,7 +498,7 @@ impl Lowerer { // rxx, ryy, rzz; // Remaining gates that are not in the qasm std library, but are standard gates in Qiskit - // that Qiskit wont emit correctly. + // that Qiskit won't emit correctly. // dcx, ecr, r, rzx, cs, csdg, sxdg, csx, cu1, cu3, rccx, c3sqrtx, c3x, rc3x, xx_minus_yy, xx_plus_yy, ccz; let gates = FxHashMap::from_iter([ ("rxx", gate_symbol("rxx", 1, 2)), @@ -1447,7 +1447,7 @@ impl Lowerer { /// The "boxable" stmts were taken from the reference parser at /// . /// Search for the definition of `Box` there, and then for all the classes - /// inhereting from `QuantumStatement`. + /// inheriting from `QuantumStatement`. fn lower_box(&mut self, stmt: &syntax::BoxStmt) -> semantic::StmtKind { self.symbols.push_scope(ScopeKind::Block); let stmts = stmt @@ -1810,7 +1810,7 @@ impl Lowerer { } all_cases_return } - // We don't know if the iterable of the loop is empty at compiletime. + // We don't know if the iterable of the loop is empty at compile time. // We take a best effort approach and check if the body always returns. semantic::StmtKind::For(stmt) => Self::stmt_always_returns(&stmt.body), semantic::StmtKind::WhileLoop(stmt) => Self::stmt_always_returns(&stmt.body), @@ -2171,7 +2171,7 @@ impl Lowerer { // The behavior of `sizeof` changes depending on the type of the first argument, the array. match &first_arg.ty { // If the first argument is an array or an static reference. We can compute the length - // of the requested dimension at lowering time, and the ouput is of type `const uint`. + // of the requested dimension at lowering time, and the output is of type `const uint`. Type::Array(ArrayType { base_ty: _, dims }) | Type::StaticArrayRef(StaticArrayRefType { base_ty: _, @@ -2198,7 +2198,7 @@ impl Lowerer { Expr::uint(i64::from(dims_vec[second_arg]), expr.span) } // If the first argument is a dynamic reference. We can only compute the length - // of the requested dimension at runtime, and the ouput is of type `uint`. + // of the requested dimension at runtime, and the output is of type `uint`. Type::DynArrayRef(ref_ty) => { let array_dims = ref_ty.dims; let kind = semantic::ExprKind::SizeofCall(semantic::SizeofCallExpr { @@ -2251,7 +2251,7 @@ impl Lowerer { (params_ty.clone(), (**return_ty).clone()) } Type::Gate(..) => { - // The parser thinks that the gate call is a function call due to mising qubits. + // The parser thinks that the gate call is a function call due to missing qubits. // We provide a better error message for gates that are called like functions. self.push_semantic_error(SemanticErrorKind::GateCalledLikeFunc( symbol.ty.to_string(), @@ -2356,7 +2356,7 @@ impl Lowerer { // 3. Check that the gate_name actually refers to a gate in the symbol table // and get its symbol_id & symbol. Make sure to use the name that could've - // been overriden by the Q# name and the span of the original name. + // been overridden by the Q# name and the span of the original name. if self.symbols.get_symbol_by_name(&name).is_err() { if let Some(include) = self.get_include_file_defining_standard_gate(&name) { // The symbol is not defined, but the name is a standard gate name @@ -4846,7 +4846,7 @@ impl Lowerer { } else { Expr::bin_op( semantic::BinOp::Sub, - // Instead of building two nested bin_ops, we just substract 1 from width. + // Instead of building two nested bin_ops, we just subtract 1 from width. Expr::int(width - 1, expr.span), expr, ) diff --git a/source/compiler/qsc_qasm/src/semantic/resources/openqasm_compiler_errors_test.qasm b/source/compiler/qsc_qasm/src/semantic/resources/openqasm_compiler_errors_test.qasm index 58341e8f8c..11ed4e10bd 100644 --- a/source/compiler/qsc_qasm/src/semantic/resources/openqasm_compiler_errors_test.qasm +++ b/source/compiler/qsc_qasm/src/semantic/resources/openqasm_compiler_errors_test.qasm @@ -55,13 +55,13 @@ def mut_subroutine_static(mutable array[int[8], 2, 3] arr_arg) { } -// curretly blocked by type checker +// currently blocked by type checker // unimplemented //bit[2] creg1; //bit[10] creg2; //let concatenated_creg = creg1 ++ creg2; -// curretly blocked by type checker +// currently blocked by type checker // unimplemented //qubit[2] one; //qubit[10] two; diff --git a/source/compiler/qsc_qasm/src/semantic/resources/openqasm_lowerer_errors_test.qasm b/source/compiler/qsc_qasm/src/semantic/resources/openqasm_lowerer_errors_test.qasm index 07bc8ac97b..ead951da2f 100644 --- a/source/compiler/qsc_qasm/src/semantic/resources/openqasm_lowerer_errors_test.qasm +++ b/source/compiler/qsc_qasm/src/semantic/resources/openqasm_lowerer_errors_test.qasm @@ -17,7 +17,7 @@ qubit[2] qreg_2; } // This error is currently in the resolver. We should move it to the -// lowerer, so that we can contruct the error with the right span. +// lowerer, so that we can construct the error with the right span. include "missing_file"; // StdGateCalledButNotIncluded diff --git a/source/compiler/qsc_qasm/src/semantic/symbols.rs b/source/compiler/qsc_qasm/src/semantic/symbols.rs index a46417e712..a6cd21f8d7 100644 --- a/source/compiler/qsc_qasm/src/semantic/symbols.rs +++ b/source/compiler/qsc_qasm/src/semantic/symbols.rs @@ -227,7 +227,7 @@ impl std::fmt::Display for IOKind { } /// A scope is a collection of symbols and a kind. The kind determines semantic -/// rules for compliation as shadowing and decl rules vary by scope kind. +/// rules for compilation as shadowing and decl rules vary by scope kind. #[derive(Debug, Clone)] pub(crate) struct Scope { /// A map from symbol name to symbol ID. diff --git a/source/compiler/qsc_qasm/src/semantic/tests/expression/builtin_functions/sizeof.rs b/source/compiler/qsc_qasm/src/semantic/tests/expression/builtin_functions/sizeof.rs index c0e00db4ad..4c41f817dc 100644 --- a/source/compiler/qsc_qasm/src/semantic/tests/expression/builtin_functions/sizeof.rs +++ b/source/compiler/qsc_qasm/src/semantic/tests/expression/builtin_functions/sizeof.rs @@ -472,7 +472,7 @@ fn sizeof_dyn_array_ref_omitted_dimension() { ); } -// This is a runtime failure, so it lowers and compiles wihtout errors. +// This is a runtime failure, so it lowers and compiles without errors. #[test] fn sizeof_dyn_array_ref_invalid_dimension_lowers_correctly() { let source = " diff --git a/source/compiler/qsc_qasm/src/semantic/tests/lowerer_errors.rs b/source/compiler/qsc_qasm/src/semantic/tests/lowerer_errors.rs index 661641a422..2c0cb3e554 100644 --- a/source/compiler/qsc_qasm/src/semantic/tests/lowerer_errors.rs +++ b/source/compiler/qsc_qasm/src/semantic/tests/lowerer_errors.rs @@ -14,7 +14,7 @@ fn check_lowerer_error_spans_are_correct() { &expect![[r#" x Not Found: Could not resolve include file: missing_file ,-[Test.qasm:21:1] - 20 | // lowerer, so that we can contruct the error with the right span. + 20 | // lowerer, so that we can construct the error with the right span. 21 | include "missing_file"; : ^^^^^^^^^^^^^^^^^^^^^^^ 22 | diff --git a/source/compiler/qsc_qasm/src/semantic/types.rs b/source/compiler/qsc_qasm/src/semantic/types.rs index ec070fd806..8b9c748d56 100644 --- a/source/compiler/qsc_qasm/src/semantic/types.rs +++ b/source/compiler/qsc_qasm/src/semantic/types.rs @@ -45,7 +45,7 @@ pub enum Type { DynArrayRef(DynArrayRefType), /// Static array references. - /// These are array references where all dimension lengths are declared explicitely. + /// These are array references where all dimension lengths are declared explicitly. /// E.g.: `readonly array[int, 2, 3, 4] arr`. StaticArrayRef(StaticArrayRefType), @@ -477,7 +477,7 @@ impl Type { Type::DynArrayRef(array) => { // In this case we only care about the number of dimensions and not about // the size of the dimensions. So, we create a dummy `ArrayDimensions` - // enconding the num_dims to be able to use the same infrastructure we + // encoding the num_dims to be able to use the same infrastructure we // use for the other array types. let dummy_dims: ArrayDimensions = array.dims.into(); indexed_type_builder( diff --git a/source/compiler/qsc_qasm/src/stdlib/angle.rs b/source/compiler/qsc_qasm/src/stdlib/angle.rs index d340207dd0..1db0e983a4 100644 --- a/source/compiler/qsc_qasm/src/stdlib/angle.rs +++ b/source/compiler/qsc_qasm/src/stdlib/angle.rs @@ -68,7 +68,7 @@ impl Angle { assert!(size > 0, "Size must be > 0"); // If the size is > f64::MANTISSA_DIGITS, the cast to f64 - // on the next lines will loose precission. + // on the next lines will loose precision. if size > f64::MANTISSA_DIGITS { return Self::from_f64_sized_edge_case(val, size); } diff --git a/source/compiler/qsc_qasm/src/stdlib/builtin_functions.rs b/source/compiler/qsc_qasm/src/stdlib/builtin_functions.rs index 11df1eabe2..1f8a2a8717 100644 --- a/source/compiler/qsc_qasm/src/stdlib/builtin_functions.rs +++ b/source/compiler/qsc_qasm/src/stdlib/builtin_functions.rs @@ -133,7 +133,7 @@ macro_rules! unwrap_lit { } /// Tries to implicitly cast all inputs to the signature of the overload being -/// considered in dispatch. Returns Some(_) if all the inputs can be succesfully +/// considered in dispatch. Returns Some(_) if all the inputs can be successfully /// cast to match the signature of the overload, and None otherwise. fn try_implicit_cast_inputs( inputs: &[Expr], diff --git a/source/compiler/qsc_qasm/src/tests/fuzz.rs b/source/compiler/qsc_qasm/src/tests/fuzz.rs index b7feec0b4b..de7cd7676f 100644 --- a/source/compiler/qsc_qasm/src/tests/fuzz.rs +++ b/source/compiler/qsc_qasm/src/tests/fuzz.rs @@ -45,7 +45,7 @@ fn fuzz_2297_def() { } /// We also had an issue where, in the same conditions as `fuzz_2297`, -/// a missing identifier in a comma separated list of formal paremeters +/// a missing identifier in a comma separated list of formal parameters /// would generate an empty string Identifier and forward it to Q#, /// which yields an invalid Q# AST. #[test] diff --git a/source/compiler/qsc_qasm/src/tests/statement/switch.rs b/source/compiler/qsc_qasm/src/tests/statement/switch.rs index b0448ca994..35eaa13a0f 100644 --- a/source/compiler/qsc_qasm/src/tests/statement/switch.rs +++ b/source/compiler/qsc_qasm/src/tests/statement/switch.rs @@ -165,7 +165,7 @@ fn spec_case_3() -> miette::Result<(), Vec> { include "stdgates.inc"; qubit q; bit[2] b; - // int(b) orginally, but we don't support that yet + // int(b) originally, but we don't support that yet switch (b) { case 0b00 { h q; diff --git a/source/compiler/qsc_rca/src/applications.rs b/source/compiler/qsc_rca/src/applications.rs index 8691f3ab2e..9b8297f682 100644 --- a/source/compiler/qsc_rca/src/applications.rs +++ b/source/compiler/qsc_rca/src/applications.rs @@ -118,7 +118,7 @@ impl GeneratorSetsBuilder { let current_application_instance = self.current_application_instance; self.flattened_application_instances() .nth(current_application_instance) - .expect("nth application instace does not exist") + .expect("nth application instance does not exist") } pub fn get_current_application_instance_mut(&mut self) -> &mut ApplicationInstance { @@ -275,7 +275,7 @@ impl GeneratorSetsBuilder { let compute_properties = application_instance.close(); ParamApplicationComputeProperties::Element(compute_properties) } else if variants.len() == DYNAMIC_ARRAY_PARAM_VARIANTS { - // IMPORTANT: the poisition of each application instance in the variants vector has a specific meaning, so + // IMPORTANT: the position of each application instance in the variants vector has a specific meaning, so // we need the order of pops is consequential. let dynamic_content_dynamic_size_application_instance = variants .pop() diff --git a/source/compiler/qsc_rca/src/common.rs b/source/compiler/qsc_rca/src/common.rs index a5bddb12d3..d5c34babdb 100644 --- a/source/compiler/qsc_rca/src/common.rs +++ b/source/compiler/qsc_rca/src/common.rs @@ -312,6 +312,6 @@ pub fn set_indentation<'a, 'b>( 0 => indent.with_str(""), 1 => indent.with_str(" "), 2 => indent.with_str(" "), - _ => unimplemented!("intentation level not supported"), + _ => unimplemented!("indentation level not supported"), } } diff --git a/source/compiler/qsc_rca/src/core.rs b/source/compiler/qsc_rca/src/core.rs index 659c985d1d..2960d6510b 100644 --- a/source/compiler/qsc_rca/src/core.rs +++ b/source/compiler/qsc_rca/src/core.rs @@ -631,7 +631,7 @@ impl<'a> Analyzer<'a> { self.visit_expr(msg_expr_id); // The compute kind of the expression is determined from the message expression runtime features plus an - // additional runtime feature if the message expresion is dynamic. + // additional runtime feature if the message expression is dynamic. let application_instance = self.get_current_application_instance(); let msg_expr_compute_kind = *application_instance.get_expr_compute_kind(msg_expr_id); let mut compute_kind = ComputeKind::Classical; @@ -1108,7 +1108,7 @@ impl<'a> Analyzer<'a> { // We analyze both the condition expression and the block N times, where N is the analysis stabilization limit. // The reason why we need a stabilization limit is because there can be up-to N levels of indirection for the - // condition due to variable assigments. + // condition due to variable assignments. // The number of statements with assignments in the condition expression and the loop block is a good proxy for // the worst case scenario regarding the propagation of properties throughout variables. Because of this, we use // it as the stabilization limit. diff --git a/source/compiler/qsc_rca/src/lib.rs b/source/compiler/qsc_rca/src/lib.rs index 9b3cbb2909..b19fecf58d 100644 --- a/source/compiler/qsc_rca/src/lib.rs +++ b/source/compiler/qsc_rca/src/lib.rs @@ -616,7 +616,7 @@ impl Display for QuantumProperties { pub enum ValueKind { /// The first runtime kind corresponds to the content of the array while the second corresponds to the size. Array(RuntimeKind, RuntimeKind), - /// Runtime kind correspondig to a single element. + /// Runtime kind corresponding to a single element. Element(RuntimeKind), } @@ -792,7 +792,7 @@ bitflags! { const MeasurementWithinDynamicScope = 1 << 17; /// Use of a dynamic index to access or update an array. const UseOfDynamicIndex = 1 << 18; - /// A return expression withing a dynamic scope. + /// A return expression within a dynamic scope. const ReturnWithinDynamicScope = 1 << 19; /// A loop with a dynamic condition. const LoopWithDynamicCondition = 1 << 20; diff --git a/source/compiler/qsc_rir/src/passes/remap_block_ids.rs b/source/compiler/qsc_rir/src/passes/remap_block_ids.rs index d4a4304f8f..64b663c03f 100644 --- a/source/compiler/qsc_rir/src/passes/remap_block_ids.rs +++ b/source/compiler/qsc_rir/src/passes/remap_block_ids.rs @@ -15,7 +15,7 @@ mod tests; /// Remaps block IDs in the given program to be contiguous, starting from 0, /// and in a topological ordering if the program is Directed Acyclic Graph (DAG). -/// Toplogical ordering is useful for passes that assume each block's successors +/// Topological ordering is useful for passes that assume each block's successors /// have higher IDs than the block itself. This is best effort; if the program has a cycle, /// the function will still remap block IDs but the ordering may not be topological. pub fn remap_block_ids(program: &mut Program) { diff --git a/source/compiler/qsc_rir/src/passes/unreachable_code_check.rs b/source/compiler/qsc_rir/src/passes/unreachable_code_check.rs index b44aa630f0..6b732b628d 100644 --- a/source/compiler/qsc_rir/src/passes/unreachable_code_check.rs +++ b/source/compiler/qsc_rir/src/passes/unreachable_code_check.rs @@ -73,7 +73,7 @@ pub fn check_unreachable_blocks(program: &Program) { /// Checks for unreachable callables in a program. /// Specifically, this function checks that all callables are reachable from the entry point of the program. -/// Note that calls from unreachable blocks are not included as only succesor blocks are considered. +/// Note that calls from unreachable blocks are not included as only successor blocks are considered. pub fn check_unreachable_callable(program: &Program) { let mut live_callables = FxHashSet::default(); let mut callables_to_check = Vec::new(); diff --git a/source/language_service/src/completion/ast_context.rs b/source/language_service/src/completion/ast_context.rs index 20b0e068a2..d5e107dff6 100644 --- a/source/language_service/src/completion/ast_context.rs +++ b/source/language_service/src/completion/ast_context.rs @@ -51,7 +51,7 @@ impl<'a> AstContext<'a> { } fn set_context(&mut self, context: Context<'a>) { - // Ignores update of contex if the cursor is in an attribute argument + // Ignores update of context if the cursor is in an attribute argument if matches!(self.context, Some(Context::AttrArg(_))) { return; } diff --git a/source/language_service/src/completion/qsharp.rs b/source/language_service/src/completion/qsharp.rs index aeedab1c30..26109aa89b 100644 --- a/source/language_service/src/completion/qsharp.rs +++ b/source/language_service/src/completion/qsharp.rs @@ -77,7 +77,7 @@ fn expected_word_kinds( source_contents: &str, cursor_offset: u32, ) -> WordKinds { - // We should not retun any completions in comments. + // We should not return any completions in comments. // This compensates for a bug in [`possible_words_at_offset_in_source`] . // Ideally, that function would be aware of the comment context and not // return any completions, however this is difficult to do today because diff --git a/source/noisy_simulator/src/instrument.rs b/source/noisy_simulator/src/instrument.rs index e9f67e6351..081fedc4a4 100644 --- a/source/noisy_simulator/src/instrument.rs +++ b/source/noisy_simulator/src/instrument.rs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -//! This module contains the `Instrument` struct, used to make measurments +//! This module contains the `Instrument` struct, used to make measurements //! in a quantum system. #[cfg(test)] diff --git a/source/noisy_simulator/src/lib.rs b/source/noisy_simulator/src/lib.rs index aec2b1d8d6..87c35d0033 100644 --- a/source/noisy_simulator/src/lib.rs +++ b/source/noisy_simulator/src/lib.rs @@ -119,7 +119,7 @@ pub enum Error { /// Failure when building a `DensityMatrix` from raw data. #[error("error when building `DensityMatrix` from raw_data: {0}")] DensityMatrixTryFromError(String), - /// Failure when buidling an instrument. + /// Failure when building an instrument. #[error("error when building instrument: {0}")] FailedToConstructInstrument(String), /// Failure when building an operation. diff --git a/source/npm/qsharp/generate_katas_content.js b/source/npm/qsharp/generate_katas_content.js index 990cda221a..a25b176b57 100644 --- a/source/npm/qsharp/generate_katas_content.js +++ b/source/npm/qsharp/generate_katas_content.js @@ -408,7 +408,7 @@ function createQuestion(kataPath, properties) { // Generate the object using the macro properties. const descriptionMarkdown = tryReadFile( join(kataPath, properties.descriptionPath), - `Could not read descripton for question ${properties.id}`, + `Could not read description for question ${properties.id}`, ); const description = createTextContent(descriptionMarkdown); const answer = createAnswer(join(kataPath, properties.answerPath)); @@ -599,7 +599,7 @@ function createKata( // Check if a valid section was created. if (section === null) { throw new Error( - `Unexpexted segment of type '${currentSegment.type}'\n` + + `Unexpected segment of type '${currentSegment.type}'\n` + `segment:\n` + `${JSON.stringify(currentSegment, undefined, 2)}\n` + `Hint: is the markdown missing a @[section] macro?`, diff --git a/source/npm/qsharp/markdown_latex_plugin.js b/source/npm/qsharp/markdown_latex_plugin.js index 7a725e8446..5971649150 100644 --- a/source/npm/qsharp/markdown_latex_plugin.js +++ b/source/npm/qsharp/markdown_latex_plugin.js @@ -169,7 +169,7 @@ function inlineMath(state, silent) { } match += 1; } - // No closing delimter found. Consume $ and continue. + // No closing delimiter found. Consume $ and continue. if (match === -1) { if (!silent) { state.pending += "$"; @@ -239,7 +239,7 @@ function inlineMathBlock(state, silent) { } match += 2; } - // No closing delimter found. Consume $$ and continue. + // No closing delimiter found. Consume $$ and continue. if (match === -1) { if (!silent) { state.pending += "$$"; diff --git a/source/npm/qsharp/src/log.ts b/source/npm/qsharp/src/log.ts index e3b9dbfcce..ab2f952db3 100644 --- a/source/npm/qsharp/src/log.ts +++ b/source/npm/qsharp/src/log.ts @@ -71,7 +71,7 @@ export const log = { }, /** * @param level - A number indicating severity: 1 = Error, 2 = Warn, 3 = Info, 4 = Debug, 5 = Trace - * @param target - The area or component sending the messsage, e.g. "parser" (useful for filtering) + * @param target - The area or component sending the message, e.g. "parser" (useful for filtering) * @param args - The format string and args to log, e.g. ["Index of %s is %i", str, index] */ logWithLevel(level: number, target: string, ...args: any) { diff --git a/source/npm/qsharp/src/workers/common.ts b/source/npm/qsharp/src/workers/common.ts index 2030033680..5c1efed89a 100644 --- a/source/npm/qsharp/src/workers/common.ts +++ b/source/npm/qsharp/src/workers/common.ts @@ -432,7 +432,7 @@ function createDispatcher< logAndPost({ // If this happens then the wasm code likely threw an exception/panicked rather than - // completing gracefully and fullfilling the promise. Communicate to the client + // completing gracefully and fulfilling the promise. Communicate to the client // that there was an error and it should reject the current request messageType: "response", type: req.type, diff --git a/source/npm/qsharp/ux/circuit-vis/utils.ts b/source/npm/qsharp/ux/circuit-vis/utils.ts index 85b0b44d81..5c5c87f48f 100644 --- a/source/npm/qsharp/ux/circuit-vis/utils.ts +++ b/source/npm/qsharp/ux/circuit-vis/utils.ts @@ -117,7 +117,7 @@ const _getStringWidth = ( /** * Find targets of an operation's children by recursively walking * through all of its children's controls and targets. - * Note that this intensionally ignores the direct targets of the + * Note that this intentionally ignores the direct targets of the * operation itself. * * Example: diff --git a/source/npm/qsharp/ux/histogram.tsx b/source/npm/qsharp/ux/histogram.tsx index b4dd4d175c..969837fb1a 100644 --- a/source/npm/qsharp/ux/histogram.tsx +++ b/source/npm/qsharp/ux/histogram.tsx @@ -200,7 +200,7 @@ export function Histogram(props: { const svgElem = e.currentTarget as SVGSVGElement; // Below gets the mouse location in the svg element coordinates. This stays - // consistent while the scroll is occuring (i.e. it is the point the mouse + // consistent while the scroll is occurring (i.e. it is the point the mouse // was at when scrolling started). const mousePoint = new DOMPoint(e.clientX, e.clientY).matrixTransform( svgElem.getScreenCTM()?.inverse(), @@ -211,7 +211,7 @@ export function Histogram(props: { that location on the screen. That means adjusting the scroll offset. SVG translation is used to pan left and right, but zooming is done manually (making the - bars wider or thinner) to keep the fonts from getting streched, which occurs with scaling. + bars wider or thinner) to keep the fonts from getting stretched, which occurs with scaling. deltaX and deltaY do not accumulate across events, they are a new delta each time. */ diff --git a/source/npm/qsharp/ux/qsharp-ux.css b/source/npm/qsharp/ux/qsharp-ux.css index d9245af360..721376dd2c 100644 --- a/source/npm/qsharp/ux/qsharp-ux.css +++ b/source/npm/qsharp/ux/qsharp-ux.css @@ -675,7 +675,7 @@ modern-normalize (see https://mattbrictson.com/blog/css-normalize-and-reset for padding: 4px; } -/* This rule adds the little triange pointer at the top */ +/* This rule adds the little triangle pointer at the top */ .qs-scatterChart-tooltip::after, .qs-scatterChart-selectedInfo::after { content: ""; diff --git a/source/npm/qsharp/ux/scatterChart.tsx b/source/npm/qsharp/ux/scatterChart.tsx index 1acb3be6f7..b29b25b7ad 100644 --- a/source/npm/qsharp/ux/scatterChart.tsx +++ b/source/npm/qsharp/ux/scatterChart.tsx @@ -179,7 +179,7 @@ export function ScatterChart(props: { } }); - // The mouse events (over, out, and click) bubble, so put the hanlders on the + // The mouse events (over, out, and click) bubble, so put the handlers on the // SVG element and check the target element in the handler. return (
diff --git a/source/pip/qsharp/_native.pyi b/source/pip/qsharp/_native.pyi index 541afc3cb6..df31eb94c6 100644 --- a/source/pip/qsharp/_native.pyi +++ b/source/pip/qsharp/_native.pyi @@ -684,7 +684,7 @@ class TypeKind(Enum): class PrimitiveKind(Enum): """ - A Q# primtive. + A Q# primitive. """ Bool: int diff --git a/source/pip/qsharp/_qsharp.py b/source/pip/qsharp/_qsharp.py index ed8bfd945d..11fd661a92 100644 --- a/source/pip/qsharp/_qsharp.py +++ b/source/pip/qsharp/_qsharp.py @@ -59,7 +59,7 @@ def lower_python_obj(obj: object, visited: Optional[Set[object]] = None) -> Any: if isinstance(obj, tuple): return tuple(lower_python_obj(elt, visited) for elt in obj) - # Recusive case: Dict + # Recursive case: Dict if isinstance(obj, dict): return {name: lower_python_obj(val, visited) for name, val in obj.items()} @@ -480,10 +480,10 @@ def callback(output: Output) -> None: # Helper function that knows how to create a function that invokes a callable. This will be # used by the underlying native code to create functions for callables on the fly that know -# how to get the currently intitialized global interpreter instance. +# how to get the currently initialized global interpreter instance. def _make_callable(callable: GlobalCallable, namespace: List[str], callable_name: str): module = code - # Create a name that will be used to collect the hierachy of namespace identifiers if they exist and use that + # Create a name that will be used to collect the hierarchy of namespace identifiers if they exist and use that # to register created modules with the system. accumulated_namespace = "qsharp.code" accumulated_namespace += "." @@ -579,7 +579,7 @@ def make_class_rec(qsharp_type: TypeIR) -> type: elif prim_kind == PrimitiveKind.Result: ty = Result else: - raise QSharpError(f"unknown primtive {prim_kind}") + raise QSharpError(f"unknown primitive {prim_kind}") elif kind == TypeKind.Tuple: # Special case Value::UNIT maps to None. if not field[1].unwrap_tuple(): @@ -608,7 +608,7 @@ def _make_class(qsharp_type: TypeIR, namespace: List[str], class_name: str): """ module = code - # Create a name that will be used to collect the hierachy of namespace identifiers if they exist and use that + # Create a name that will be used to collect the hierarchy of namespace identifiers if they exist and use that # to register created modules with the system. accumulated_namespace = "qsharp.code" accumulated_namespace += "." diff --git a/source/pip/qsharp/estimator/_estimator.py b/source/pip/qsharp/estimator/_estimator.py index f87020e4c5..5a1793bcfa 100644 --- a/source/pip/qsharp/estimator/_estimator.py +++ b/source/pip/qsharp/estimator/_estimator.py @@ -376,7 +376,7 @@ def at_least_one(name, value): def post_validation(self, result): if self.max_duration is not None and self.max_physical_qubits is not None: raise LookupError( - "Both duration and number of physical qubits constraints are provided, but only one is allowe at a time." + "Both duration and number of physical qubits constraints are provided, but only one is allowed at a time." ) diff --git a/source/pip/qsharp/interop/qiskit/backends/qirtarget.py b/source/pip/qsharp/interop/qiskit/backends/qirtarget.py index 545c699817..ddbd3795e8 100644 --- a/source/pip/qsharp/interop/qiskit/backends/qirtarget.py +++ b/source/pip/qsharp/interop/qiskit/backends/qirtarget.py @@ -135,7 +135,7 @@ def num_qubits(self): return self._num_qubits # NOTE: The follow property setter intentionally shadows the property on the parent class to allow it to be set, which - # maintains compatiblity with Qiskit versions before 1.3.0 where the property was settable. + # maintains compatibility with Qiskit versions before 1.3.0 where the property was settable. @num_qubits.setter def num_qubits(self, value): self._num_qubits = value diff --git a/source/pip/qsharp/interop/qiskit/backends/qsharp_backend.py b/source/pip/qsharp/interop/qiskit/backends/qsharp_backend.py index 2453ce8e5e..6f46cecf06 100644 --- a/source/pip/qsharp/interop/qiskit/backends/qsharp_backend.py +++ b/source/pip/qsharp/interop/qiskit/backends/qsharp_backend.py @@ -174,7 +174,7 @@ def _execute(self, programs: List[Compilation], **input_params) -> Dict[str, Any } job_results.append(job_result) - # All of theses fields are required by the Result object + # All of these fields are required by the Result object result_dict = { "results": job_results, "qobj_id": str(uuid4()), diff --git a/source/pip/qsharp/telemetry.py b/source/pip/qsharp/telemetry.py index 90968becaf..1b40303771 100644 --- a/source/pip/qsharp/telemetry.py +++ b/source/pip/qsharp/telemetry.py @@ -298,7 +298,7 @@ def _on_exit(): telemetry_thread.join(timeout=3) -# Mark the telemetry thread as a deamon thread, else it will keep the process alive when the main thread exits +# Mark the telemetry thread as a daemon thread, else it will keep the process alive when the main thread exits if TELEMETRY_ENABLED: telemetry_thread = Thread(target=_telemetry_thread_start, daemon=True) telemetry_thread.start() diff --git a/source/pip/src/generic_estimator/factory.rs b/source/pip/src/generic_estimator/factory.rs index 25db24095d..f455ec411d 100644 --- a/source/pip/src/generic_estimator/factory.rs +++ b/source/pip/src/generic_estimator/factory.rs @@ -59,7 +59,7 @@ enum FactoryImplementation<'py> { /// ... /// ``` /// -/// A factory object is simply a Phython dictionary, which _must_ contain +/// A factory object is simply a Python dictionary, which _must_ contain /// entries for `"physical_qubits"` and `"duration"` (in nano seconds). It may /// also contain `"num_output_states"`, which defaults to 1 if not specified. It /// may contain other entries, which will be included in the serialized resource @@ -67,7 +67,7 @@ enum FactoryImplementation<'py> { /// /// ## Creating factories based on multiple rounds of distillation /// -/// To create factories based on mulitple rounds of distillation, the class must +/// To create factories based on multiple rounds of distillation, the class must /// implement the function `distillation_units`, which returns a list of /// distillation unit objects (described below). Further, such a class may /// provide local variables `gate_error`, `max_rounds` and `max_extra_rounds` @@ -101,7 +101,7 @@ enum FactoryImplementation<'py> { /// `"code_parameter"`, and `"num_output_states"` are optional and default to /// `"distillation-unit"`, `None`, and `1`. The fields for `"physical_qubits"` /// and `"runtime"` must be callable (e.g., using a Python lambda) with the -/// 0-based round index as only paramter. The fields for `"output_error_rate"` +/// 0-based round index as only parameter. The fields for `"output_error_rate"` /// and `"failure_probability"` also must be callable with the input error rate /// (of the previous round or initial gate error rate) as the only parameter. pub struct PythonFactoryBuilder<'py> { diff --git a/source/pip/src/generic_estimator/utils.rs b/source/pip/src/generic_estimator/utils.rs index 5ecba0529f..371cc4f2e3 100644 --- a/source/pip/src/generic_estimator/utils.rs +++ b/source/pip/src/generic_estimator/utils.rs @@ -94,7 +94,7 @@ pub fn python_dict_to_json_map(value: &Bound<'_, PyDict>) -> Option(pub Bound<'py, PyAny>); diff --git a/source/pip/src/interpreter.rs b/source/pip/src/interpreter.rs index 00f51d6ffe..991be4f077 100644 --- a/source/pip/src/interpreter.rs +++ b/source/pip/src/interpreter.rs @@ -1071,7 +1071,7 @@ impl Output { } #[pyclass] -/// Captured simlation state dump. +/// Captured simulation state dump. pub(crate) struct StateDumpData(pub(crate) DisplayableState); #[pymethods] diff --git a/source/pip/src/noisy_simulator.rs b/source/pip/src/noisy_simulator.rs index e5e11f9047..df77a4705f 100644 --- a/source/pip/src/noisy_simulator.rs +++ b/source/pip/src/noisy_simulator.rs @@ -23,7 +23,7 @@ pub(crate) fn register_noisy_simulator_submodule<'a>( /// Performance Warning: /// nalgebra stores its matrices in column major order, and we want to send /// them from Python in row major order, this means that there will be lots of -/// cache-misses in the convertion from one format to another. +/// cache-misses in the conversion from one format to another. /// /// This function is only used on a non-critical path for performance. Namely, /// the input to the simulator to set it up, and getting the final output. diff --git a/source/pip/tests-integration/resources/adaptive_ri/input/DeutschJozsaNISQ.qs b/source/pip/tests-integration/resources/adaptive_ri/input/DeutschJozsaNISQ.qs index 715ac8b1a7..416f7b8263 100644 --- a/source/pip/tests-integration/resources/adaptive_ri/input/DeutschJozsaNISQ.qs +++ b/source/pip/tests-integration/resources/adaptive_ri/input/DeutschJozsaNISQ.qs @@ -48,7 +48,7 @@ namespace Test { /// The number of bits in the input register |𝑥〉. /// /// # Output - /// An array of measurement results for the query reguster. + /// An array of measurement results for the query register. /// All `Zero` measurement results indicate that the function is constant. /// At least one `One` measurement result in the array indicates that the /// function is balanced. diff --git a/source/pip/tests-integration/resources/adaptive_ri/input/IntrinsicRotationsWithPeriod.qs b/source/pip/tests-integration/resources/adaptive_ri/input/IntrinsicRotationsWithPeriod.qs index eca68a1ee5..e91e7364a5 100644 --- a/source/pip/tests-integration/resources/adaptive_ri/input/IntrinsicRotationsWithPeriod.qs +++ b/source/pip/tests-integration/resources/adaptive_ri/input/IntrinsicRotationsWithPeriod.qs @@ -22,7 +22,7 @@ namespace Test { let stepsInt = 8; let theta = rotationPeriod / stepsDouble; for _ in 1..stepsInt { - // Test both R and its correspoding axis rotation gate (Rx, Ry, Rz) using the same register. + // Test both R and its corresponding axis rotation gate (Rx, Ry, Rz) using the same register. Rx(theta, rxRegister[0]); R(PauliX, theta, rxRegister[1]); Ry(theta, ryRegister[0]); diff --git a/source/pip/tests-integration/resources/adaptive_ri/input/SuperdenseCoding.qs b/source/pip/tests-integration/resources/adaptive_ri/input/SuperdenseCoding.qs index a7f5794060..9e47b4921d 100644 --- a/source/pip/tests-integration/resources/adaptive_ri/input/SuperdenseCoding.qs +++ b/source/pip/tests-integration/resources/adaptive_ri/input/SuperdenseCoding.qs @@ -29,7 +29,7 @@ namespace Test { return ((sourceBit1, sourceBit2), (decodedBit1, decodedBit2)); } - // Generates random bit using an auxilliary qubit + // Generates random bit using an auxiliary qubit operation DrawRandomBit() : Bool { use q = Qubit(); H(q); diff --git a/source/pip/tests-integration/resources/adaptive_ri/input/ThreeQubitRepetitionCode.qs b/source/pip/tests-integration/resources/adaptive_ri/input/ThreeQubitRepetitionCode.qs index d1352322b7..08088bc1af 100644 --- a/source/pip/tests-integration/resources/adaptive_ri/input/ThreeQubitRepetitionCode.qs +++ b/source/pip/tests-integration/resources/adaptive_ri/input/ThreeQubitRepetitionCode.qs @@ -20,7 +20,7 @@ namespace Test { } apply { let iterations = 5; for _ in 1..iterations { - // Apply a unitary operatyion to the encoded register that shuold + // Apply a unitary operatyion to the encoded register that should // effectively perform an identity operation but may be noisy // on the quantum hardware and introduce errors. ApplyRotationalIdentity(encodedRegister); diff --git a/source/playground/public/katas.html b/source/playground/public/katas.html index bb6bd384bf..7a67c88571 100644 --- a/source/playground/public/katas.html +++ b/source/playground/public/katas.html @@ -25,7 +25,7 @@ --kata-background-selected: #ccc; --kata-row-highlight: #ddd; } - /* User has set OS preference for dark (explict theme will override) */ + /* User has set OS preference for dark (explicit theme will override) */ @media (prefers-color-scheme: dark) { :root { --kata-primay-color: #eee; diff --git a/source/resource_estimator/README.md b/source/resource_estimator/README.md index c9c27848f6..bea88ee625 100644 --- a/source/resource_estimator/README.md +++ b/source/resource_estimator/README.md @@ -12,7 +12,7 @@ The theoretical models used in Azure Quantum Resource Estimator are described in ## Using the resource estimator crate for customizable tasks In the [examples](./examples/) directory we show how to perform custom resource estimation tasks, by directly using the crate. Note however, that we do not guarantee that there are no breaking changes even among minor releases. -We advise to specify the depedency location to the resource estimator crate by pointing to a specific release tag or commit hash (see [The Cargo Book](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#specifying-dependencies-from-git-repositories) for more details): +We advise to specify the dependency location to the resource estimator crate by pointing to a specific release tag or commit hash (see [The Cargo Book](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#specifying-dependencies-from-git-repositories) for more details): ```toml resource_estimator = { git = "https://github.com/microsoft/qsharp.git", tag = "" } diff --git a/source/resource_estimator/src/estimates/error_correction.rs b/source/resource_estimator/src/estimates/error_correction.rs index 174dd99763..6a4658b193 100644 --- a/source/resource_estimator/src/estimates/error_correction.rs +++ b/source/resource_estimator/src/estimates/error_correction.rs @@ -13,7 +13,7 @@ pub use code_with_threshold_and_distance::{ /// This trait models one quantum error correction code that encodes k logical /// qubits using n physical qubits. The physical qubits are of type /// `Self::Qubit`. Each code is parameterized by assignments to parameters of -/// type `Self::Parameter`. Implementors of this trait need to specify values +/// type `Self::Parameter`. Implementers of this trait need to specify values /// for k, n, the logical cycle time, and the logical error rate, given an /// assignment to the code parameter. /// @@ -176,7 +176,7 @@ pub trait ErrorCorrection { /// Returns an iterator of all possible code parameters /// - /// Implementors of this method should sort the code parameters such that + /// Implementers of this method should sort the code parameters such that /// the least costly parameters appear first. Least costly may be defined /// in terms of physical qubits, the logical cycle time, or a combination of /// both. diff --git a/source/resource_estimator/src/estimates/factory/round_based.rs b/source/resource_estimator/src/estimates/factory/round_based.rs index b82a02fe70..039036bf85 100644 --- a/source/resource_estimator/src/estimates/factory/round_based.rs +++ b/source/resource_estimator/src/estimates/factory/round_based.rs @@ -106,7 +106,7 @@ impl DistillationRound

{ pub fn compute_num_output_states(&self, failure_probability: f64) -> u64 { // special case when not necessary to run actual distillation: - // the physcial qubit error rate is already below the threshold + // the physical qubit error rate is already below the threshold if failure_probability == 0.0 && self.failure_probability_requirement == 0.0 { return self.num_units * self.num_output_states; } diff --git a/source/resource_estimator/src/lib.rs b/source/resource_estimator/src/lib.rs index a5d8ccd6d8..b1f95498de 100644 --- a/source/resource_estimator/src/lib.rs +++ b/source/resource_estimator/src/lib.rs @@ -4,7 +4,7 @@ //! A Q# backend to compute logical overheads to compute the overhead based on //! the PSSPC layout method. -// This crate uses lots of converstions between floating point numbers and integers, so this helps +// This crate uses lots of conversions between floating point numbers and integers, so this helps // avoid many needed allow statements. Comment out individual lines to see where they are needed. #![allow( clippy::cast_possible_truncation, diff --git a/source/resource_estimator/src/system.rs b/source/resource_estimator/src/system.rs index 25d749fa5f..9f49de6c10 100644 --- a/source/resource_estimator/src/system.rs +++ b/source/resource_estimator/src/system.rs @@ -118,7 +118,7 @@ fn estimate_single (&mut f64, &mut f64) { *self = match self { diff --git a/source/resource_estimator/src/system/modeling/tfactory/tests.rs b/source/resource_estimator/src/system/modeling/tfactory/tests.rs index df743af295..fc87ce6505 100644 --- a/source/resource_estimator/src/system/modeling/tfactory/tests.rs +++ b/source/resource_estimator/src/system/modeling/tfactory/tests.rs @@ -269,7 +269,7 @@ fn test_default_t_factory() { let physical_qubit = PhysicalQubit::default(); let ftp = surface_code_gate_based(); let logical_qubit = LogicalPatch::new(&ftp, 15, Rc::new(physical_qubit)) - .expect("logical qubit contruction should succeed"); + .expect("logical qubit construction should succeed"); let tfactory = default_t_factory(&logical_qubit); assert_eq!(tfactory.num_rounds(), 1); diff --git a/source/resource_estimator/src/system/optimization/code_distance_iterators/tests.rs b/source/resource_estimator/src/system/optimization/code_distance_iterators/tests.rs index 0352ad3fab..99d4772dc9 100644 --- a/source/resource_estimator/src/system/optimization/code_distance_iterators/tests.rs +++ b/source/resource_estimator/src/system/optimization/code_distance_iterators/tests.rs @@ -141,7 +141,7 @@ fn test_iterate_for_code_distances_1() { ); } -// always allow going right but start from left because it is greated than initial +// always allow going right but start from left because it is greater than initial #[test] fn test_iterate_for_code_distances_2() { let num_rounds = 2; diff --git a/source/resource_estimator/src/system/test_report.json b/source/resource_estimator/src/system/test_report.json index 3a1778f30a..6af37ad6ff 100644 --- a/source/resource_estimator/src/system/test_report.json +++ b/source/resource_estimator/src/system/test_report.json @@ -522,7 +522,7 @@ "path": "physicalCountsFormatted/maxDuration" }, { - "description": "The maximum number of physical qubits allowed for utilization to the algorith", + "description": "The maximum number of physical qubits allowed for utilization to the algorithm", "explanation": "This is the maximum number of physical qubits available to the algorithm. If specified, the estimator targets to minimize the runtime of the algorithm with number of physical qubits consumed not exceeding this maximum.", "label": "Maximum number of physical qubits", "path": "physicalCountsFormatted/maxPhysicalQubits" diff --git a/source/vscode/src/azure/workspaceActions.ts b/source/vscode/src/azure/workspaceActions.ts index e65969c6c2..0a2677169d 100644 --- a/source/vscode/src/azure/workspaceActions.ts +++ b/source/vscode/src/azure/workspaceActions.ts @@ -201,7 +201,7 @@ async function getWorkspaceWithConnectionString( } catch (e: any) { log.debug("Workspace connection error", e); // e.g. check for 401 (invalid key), 404 (invalid workspace), failed network requests (invalid endpoint), etc. - let errorText = "An unexpected error occured"; + let errorText = "An unexpected error occurred"; const message: string | undefined = e.message; if (message?.includes("status 401")) { errorText = diff --git a/source/vscode/src/debugger/session.ts b/source/vscode/src/debugger/session.ts index 4e38b39c15..c377e2d282 100644 --- a/source/vscode/src/debugger/session.ts +++ b/source/vscode/src/debugger/session.ts @@ -943,7 +943,7 @@ export class QscDebugSession extends LoggingDebugSession { } /** - * Attemps to resolve a DebugProtocol.Source.path to a URI. + * Attempts to resolve a DebugProtocol.Source.path to a URI. * * In Debug Protocol requests, the VS Code debug adapter client * will strip file URIs to just the filesystem path part. @@ -956,7 +956,7 @@ export class QscDebugSession extends LoggingDebugSession { * which one it is based on the input alone (the syntax is ambiguous). * But we do have a set of *known* filesystem paths that we * constructed at initialization, and we can use that to resolve - * any known fileystem paths back to the original URI. + * any known filesystem paths back to the original URI. * * Filesystem paths we don't know about *won't* be resolved, * and that's ok in this use case. diff --git a/source/vscode/src/language-service/testExplorer.ts b/source/vscode/src/language-service/testExplorer.ts index ea1391d6d3..2515b92653 100644 --- a/source/vscode/src/language-service/testExplorer.ts +++ b/source/vscode/src/language-service/testExplorer.ts @@ -190,7 +190,7 @@ export function startTestDiscovery( // so it should be the full path to the test item, not including the "friendly name" (since that isn't in the callable expr), // if and only if it is a "leaf" (an actual test case) // note that leaves are test cases and internal nodes are not test cases - // in teh above example, TestSuite would have the id `FriendlyName.TestSuite`, and Test1 would have the id `TestSuite.Test1` + // in the above example, TestSuite would have the id `FriendlyName.TestSuite`, and Test1 would have the id `TestSuite.Test1` const id = i === parts.length - 1 ? callableName diff --git a/source/vscode/src/notebookTemplate.ts b/source/vscode/src/notebookTemplate.ts index 59773cd373..9cf7ef1e13 100644 --- a/source/vscode/src/notebookTemplate.ts +++ b/source/vscode/src/notebookTemplate.ts @@ -47,7 +47,7 @@ import qsharp import Std.Diagnostics.*; operation RandomBit() : Result { - // Qubits are only accesible for the duration of the scope where they + // Qubits are only accessible for the duration of the scope where they // are allocated and are automatically released at the end of the scope. use qubit = Qubit(); diff --git a/source/widgets/js/index.tsx b/source/widgets/js/index.tsx index 6507f0db8a..d32d0bac17 100644 --- a/source/widgets/js/index.tsx +++ b/source/widgets/js/index.tsx @@ -43,7 +43,7 @@ export function render({ model, el }: RenderArgs) { // There is an existing issue where in VS Code it always shows the widget background as white. // (See https://github.com/microsoft/vscode-jupyter/issues/7161) - // We tried to fix this in CSS by overridding the style, but there is a race condition whereby + // We tried to fix this in CSS by overriding the style, but there is a race condition whereby // depending on which style gets injected first (ours or ipywidgets), it may or may not work. // The solution here is to force our own override to be last in the style list if not already. diff --git a/source/widgets/src/qsharp_widgets/__init__.py b/source/widgets/src/qsharp_widgets/__init__.py index 219f3aaffd..f4b658eec2 100644 --- a/source/widgets/src/qsharp_widgets/__init__.py +++ b/source/widgets/src/qsharp_widgets/__init__.py @@ -73,7 +73,7 @@ class EstimatesPanel(anywidget.AnyWidget): def __init__(self, estimates, colors=None, runNames=None): """ - This function generates the whole estimates panel with the summary results table, ther space-time chart, the space chart and the details report. + This function generates the whole estimates panel with the summary results table, the space-time chart, the space chart and the details report. Parameters: - estimates: data for all the tables and diagrams.