Skip to content

Commit

Permalink
header spellcheck was not properly failing
Browse files Browse the repository at this point in the history
  • Loading branch information
bettinaheim committed Nov 27, 2023
1 parent 067c60c commit 7728aec
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 41 deletions.
8 changes: 4 additions & 4 deletions include/cudaq/Optimizer/Builder/Factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ inline mlir::Type getCharType(mlir::MLIRContext *ctx) {
return mlir::IntegerType::get(ctx, /*bits=*/8);
}

/// Return the LLVM-IR dialect ptr type.
/// Return the LLVM-IR dialect `ptr` type.
inline mlir::Type getPointerType(mlir::MLIRContext *ctx) {
return mlir::LLVM::LLVMPointerType::get(getCharType(ctx));
}
Expand Down Expand Up @@ -130,8 +130,8 @@ inline mlir::Block *addEntryBlock(mlir::LLVM::GlobalOp initVar) {
return entry;
}

/// Return an i64 array where the kth element is N if the kth
/// operand is veq<N> and 0 otherwise (e.g. is a ref).
/// Return an i64 array where element `k` is `N` if the
/// operand `k` is `veq<N>` and 0 otherwise.
mlir::Value packIsArrayAndLengthArray(mlir::Location loc,
mlir::ConversionPatternRewriter &rewriter,
mlir::ModuleOp parentModule,
Expand Down Expand Up @@ -170,7 +170,7 @@ mlir::FunctionType toCpuSideFuncType(mlir::FunctionType funcTy,

/// @brief Return true if the given type corresponds to a
/// std-vector type according to our convention. The convention
/// is a ptr<struct<ptr<T>, ptr<T>, ptr<T>>>.
/// is a `ptr<struct<ptr<T>, ptr<T>, ptr<T>>>`.
bool isStdVecArg(mlir::Type type);

} // namespace opt::factory
Expand Down
4 changes: 2 additions & 2 deletions include/cudaq/Optimizer/Builder/Intrinsics.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static constexpr const char stdvecBoolCtorFromInitList[] =
/// (QUAntum Kernel Execution) and CC (Classical Computation) dialects.
///
/// This builder also allows for the inclusion of predefined intrinsics into
/// the ModuleOp on demand. Intrinsics exist in a map accessed by a symbol name.
/// the `ModuleOp` on demand. Intrinsics exist in a map accessed by a symbol name.
class IRBuilder : public mlir::OpBuilder {
public:
using OpBuilder::OpBuilder;
Expand All @@ -36,7 +36,7 @@ class IRBuilder : public mlir::OpBuilder {
}

/// Create a global for a C-style string. (A pointer to a NUL terminated
/// sequence of bytes.) \p cstring must have the NUL character appended \b
/// sequence of bytes.) `cstring` must have the NUL character appended \b
/// prior to calling this builder function.
mlir::LLVM::GlobalOp genCStringLiteral(mlir::Location loc,
mlir::ModuleOp module,
Expand Down
2 changes: 1 addition & 1 deletion include/cudaq/Optimizer/CodeGen/Pipelines.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace cudaq::opt {
/// specified if `QIRProfile` is true.
/// @param QIRProfile whether or not this is lowering to a specific QIR profile
/// @param pm Pass manager to append passes to
/// @param convertTo String name of qir profile (e.g., qir-base, qir-adaptive)
/// @param convertTo String name of QIR profile (e.g., `qir-base`, `qir-adaptive`)
template <bool QIRProfile = false>
void addPipelineToQIR(mlir::PassManager &pm,
llvm::StringRef convertTo = "none") {
Expand Down
2 changes: 1 addition & 1 deletion include/cudaq/Optimizer/CodeGen/QIRFunctionNames.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ constexpr static const char NVQIRPackSingleQubitInArray[] =
constexpr static const char NVQIRReleasePackedQubitArray[] =
"releasePackedQubitArray";

/// QIR Array funciton name strings
/// QIR Array function name strings
constexpr static const char QIRArrayGetElementPtr1d[] =
"__quantum__rt__array_get_element_ptr_1d";
constexpr static const char QIRArrayQubitAllocateArray[] =
Expand Down
26 changes: 13 additions & 13 deletions runtime/cudaq/algorithms/sample.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ concept SampleCallValid =

namespace details {

/// @brief Take the input KernelFunctor (a lambda that captures runtime args and
/// @brief Take the input KernelFunctor (a lambda that captures runtime arguments and
/// invokes the quantum kernel) and invoke the sampling process.
template <typename KernelFunctor>
std::optional<sample_result>
Expand Down Expand Up @@ -138,7 +138,7 @@ runSampling(KernelFunctor &&wrappedKernel, quantum_platform &platform,
return ctx->result;
}

/// @brief Take the input KernelFunctor (a lambda that captures runtime args and
/// @brief Take the input KernelFunctor (a lambda that captures runtime arguments and
/// invokes the quantum kernel) and invoke the sampling process asynchronously.
/// Return a async_sample_result, clients can retrieve the results at a later
/// time via the `get()` call.
Expand Down Expand Up @@ -363,7 +363,7 @@ async_sample_result sample_async(std::size_t shots, std::size_t qpu_id,

/// \brief Sample the given kernel expression asynchronously and return
/// the mapping of observed bit strings to corresponding number of
/// times observed. Defaults to the 0th QPU id.
/// times observed. Defaults to QPU id 0.
///
/// \param kernel the kernel expression, must contain final measurements
/// \param args the variadic concrete arguments for evaluation of the kernel.
Expand All @@ -385,8 +385,8 @@ auto sample_async(QuantumKernel &&kernel, Args &&...args) {
/// argument packs. For a kernel with signature void(Args...), this
/// function takes as input a set of vector<Arg>..., a vector for
/// each argument type in the kernel signature. The vectors must be of
/// equal length, and the ith element of each vector is used ith
/// execution of the standard sample function. Results are collected
/// equal length, and element `i` of each vector is used in
/// execution `i` of the standard sample function. Results are collected
/// from the execution of every argument set and returned.
template <typename QuantumKernel, typename... Args>
requires SampleCallValid<QuantumKernel, Args...>
Expand Down Expand Up @@ -418,8 +418,8 @@ std::vector<sample_result> sample(QuantumKernel &&kernel,
}

/// @brief Run the standard sample functionality over a set of N
/// argument packs. For a kernel with signature void(Args...), this
/// function takes as input a set of vector<Arg>..., a vector for
/// argument packs. For a kernel with signature `void(Args...)`, this
/// function takes as input a set of `vector<Arg>...`, a vector for
/// each argument type in the kernel signature. The vectors must be of
/// equal length, and the ith element of each vector is used ith
/// execution of the standard sample function. Results are collected
Expand Down Expand Up @@ -454,8 +454,8 @@ std::vector<sample_result> sample(std::size_t shots, QuantumKernel &&kernel,
}

/// @brief Run the standard sample functionality over a set of N
/// argument packs. For a kernel with signature void(Args...), this
/// function takes as input a set of vector<Arg>..., a vector for
/// argument packs. For a kernel with signature `void(Args...)`, this
/// function takes as input a set of `vector<Arg>...`, a vector for
/// each argument type in the kernel signature. The vectors must be of
/// equal length, and the ith element of each vector is used ith
/// execution of the standard sample function. Results are collected
Expand Down Expand Up @@ -497,8 +497,8 @@ std::vector<sample_result> sample(const sample_options &options,
}

/// @brief Run the standard sample functionality over a set of N
/// argument packs. For a kernel with signature void(Args...), this
/// function takes as input a set of vector<Arg>..., a vector for
/// argument packs. For a kernel with signature `void(Args...)`, this
/// function takes as input a set of `vector<Arg>...`, a vector for
/// each argument type in the kernel signature. The vectors must be of
/// equal length, and the ith element of each vector is used ith
/// execution of the standard sample function. Results are collected
Expand Down Expand Up @@ -533,8 +533,8 @@ sample_n(QuantumKernel &&kernel, ArgumentSet<Args...> &&params) {
}

/// @brief Run the standard sample functionality over a set of N
/// argument packs. For a kernel with signature void(Args...), this
/// function takes as input a set of vector<Arg>..., a vector for
/// argument packs. For a kernel with signature `void(Args...)`, this
/// function takes as input a set of `vector<Arg>...`, a vector for
/// each argument type in the kernel signature. The vectors must be of
/// equal length, and the ith element of each vector is used ith
/// execution of the standard sample function. Results are collected
Expand Down
8 changes: 4 additions & 4 deletions runtime/cudaq/builder/kernel_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ std::string get_quake_by_name(const std::string &);
template <typename T>
concept NumericType = requires(T param) { std::is_floating_point_v<T>; };

/// @brief Define a Quake-constructable floating point value concept
/// @brief Define a Quake-constructible floating point value concept
// i.e., it could be a `QuakeValue` type or a floating point number (convertible
// to a `QuakeValue` with `ConstantFloatOp`).
template <typename T>
Expand Down Expand Up @@ -126,7 +126,7 @@ KernelBuilderType mapArgToType(cudaq::qubit &e);
/// @brief Map a `qreg` to a `KernelBuilderType`
KernelBuilderType mapArgToType(cudaq::qreg<> &e);

/// @brief Map a qvector to a `KernelBuilderType`
/// @brief Map a `qvector` to a `KernelBuilderType`
KernelBuilderType mapArgToType(cudaq::qvector<> &e);

/// @brief Initialize the `MLIRContext`, return the raw
Expand Down Expand Up @@ -596,7 +596,7 @@ class kernel_builder : public details::kernel_builder_base {
details::c_if(*opBuilder, result, thenFunctor);
}

/// @brief Apply a general pauli rotation, exp(i theta P),
/// @brief Apply a general Pauli rotation, exp(i theta P),
/// takes a QuakeValue representing a register of qubits.
template <QuakeValueOrNumericType ParamT>
void exp_pauli(const ParamT &theta, const QuakeValue &qubits,
Expand All @@ -609,7 +609,7 @@ class kernel_builder : public details::kernel_builder_base {
details::exp_pauli(*opBuilder, theta, qubitValues, pauliWord);
}

/// @brief Apply a general pauli rotation, exp(i theta P),
/// @brief Apply a general Pauli rotation, exp(i theta P),
/// takes a variadic list of QuakeValues representing a individual qubits.
template <QuakeValueOrNumericType ParamT, typename... QubitArgs>
void exp_pauli(const ParamT &theta, const std::string &pauliWord,
Expand Down
6 changes: 3 additions & 3 deletions runtime/cudaq/qis/execution_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ bool __nvqpp__MeasureResultBoolConversion(int);
/// @brief In library mode, we model the return type of
/// a qubit measurement result via the measure_result type.
/// This allows us to keep track of when the result is
/// implicitly casted to a bool (likely in the case of
/// implicitly cast to a boolean (likely in the case of
/// conditional feedback), and affect the simulation accordingly
class measure_result {
private:
Expand All @@ -66,7 +66,7 @@ using measure_result = bool;
/// The ExecutionManager provides a base class describing a
/// concrete sub-system for allocating qudits and executing quantum
/// instructions on those qudits. This type is templated on the concrete
/// qudit type (qubit, qmode, etc). It exposes an API for getting an
/// qudit type (`qubit`, `qmode`, etc). It exposes an API for getting an
/// available qudit id, returning that id, setting and resetting the
/// current execution context, and applying specific quantum instructions.
class ExecutionManager {
Expand Down Expand Up @@ -135,7 +135,7 @@ class ExecutionManager {
/// e.g. for qubits, this can return 0 or 1;
virtual int measure(const QuditInfo &target) = 0;

/// Measure the current state in the given pauli basis, return
/// Measure the current state in the given Pauli basis, return
/// the expectation value <term>.
virtual SpinMeasureResult measure(cudaq::spin_op &op) = 0;

Expand Down
8 changes: 4 additions & 4 deletions runtime/nvqir/cutensornet/external_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ namespace nvqir {
/// The backend shall look for that symbol to retrieve the extension.
///
/// (2) The extension library should be linked against the same (or compatible)
/// cutensornet library version.
/// `cutensornet` library version.
///
/// (3) Provide CMAKE flag:
/// `-DCUDAQ_CUTENSORNET_PLUGIN_LIB=<path to compiled extension lib>` when
/// building the tensornet backends.
/// building the `tensornet` backends.
struct CutensornetExecutor {
/// @brief Compute expectation values for a list of Pauli spin operators
/// @details Spin operators are expressed in binary symplectic form:
Expand All @@ -41,8 +41,8 @@ struct CutensornetExecutor {
/// which is equal to the number of spin qubits times 2. The number of spin
/// qubits in the operator is less than or equal to the number of qubits in
/// the state.
/// @param cutnHandle cutensornet handle that the plugin should be using when
/// calling any cutensornet APIs
/// @param cutnHandle `cutensornet` handle that the plugin should be using when
/// calling any `cutensornet` APIs
/// @param quantumState quantum input state
/// @param numQubits number of qubits in the quantum state
/// @param symplecticRepr symplectic representation of the spin operators
Expand Down
2 changes: 1 addition & 1 deletion runtime/nvqir/cutensornet/simulator_cutensornet.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "tensornet_state.h"

namespace nvqir {
/// @brief Base class of cutensornet simulator backends
/// @brief Base class of `cutensornet` simulator backends
class SimulatorTensorNetBase : public nvqir::CircuitSimulatorBase<double> {

public:
Expand Down
8 changes: 4 additions & 4 deletions runtime/nvqir/cutensornet/tensornet_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ class TensorNetState {

/// @brief Compute the reduce density matrix on a set of qubits
///
/// The order of the specified qubits (cutensornet open state modes) will be
/// The order of the specified qubits (`cutensornet` open state modes) will be
/// respected when computing the RDM.
std::vector<std::complex<double>>
computeRDM(const std::vector<int32_t> &qubits);

/// Factorize the cutensornetState_t into matrix product state form.
/// Factorize the `cutensornetState_t` into matrix product state form.
// Returns MPS tensors in GPU device memory.
// Note: the caller assumes the ownership of these pointers, thus needs to
// clean them up properly (with cudaFree).
Expand All @@ -63,9 +63,9 @@ class TensorNetState {
cutensornetTensorSVDAlgo_t algo = CUTENSORNET_TENSOR_SVD_ALGO_GESVDJ);

/// @brief Compute the expectation value w.r.t. a
/// cutensornetNetworkOperator_t
/// `cutensornetNetworkOperator_t`
///
/// The cutensornetNetworkOperator_t can be constructed from cudaq::spin_op,
/// The `cutensornetNetworkOperator_t` can be constructed from `cudaq::spin_op`,
/// i.e., representing a sum of Pauli products with different coefficients.
std::complex<double>
computeExpVal(cutensornetNetworkOperator_t tensorNetworkOperator);
Expand Down
8 changes: 4 additions & 4 deletions runtime/nvqir/cutensornet/tensornet_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ randomValues(uint64_t num_samples, double max_value,
return rs;
}

/// @brief Util struct to allocate and clean up device memory scratch space.
/// @brief Struct to allocate and clean up device memory scratch space.
struct ScratchDeviceMem {
void *d_scratch = nullptr;
std::size_t scratchSize = 0;
Expand All @@ -75,11 +75,11 @@ struct ScratchDeviceMem {
~ScratchDeviceMem() { HANDLE_CUDA_ERROR(cudaFree(d_scratch)); }
};

/// Initialize cutensornet MPI Comm
/// Initialize `cutensornet` MPI Comm
/// If MPI is not available, fallback to an empty implementation.
void initCuTensornetComm(cutensornetHandle_t cutnHandle);

/// Reset cutensornet MPI Comm, e.g., in preparation for shutdown.
/// Note: this will make sure no further MPI activities from cutensornet can
/// Reset `cutensornet` MPI Comm, e.g., in preparation for shutdown.
/// Note: this will make sure no further MPI activities from `cutensornet` can
/// occur once MPI has been finalized by CUDAQ.
void resetCuTensornetComm(cutensornetHandle_t cutnHandle);

0 comments on commit 7728aec

Please sign in to comment.