MCPcopy Create free account
hub / github.com/NVIDIA/cuda-quantum / pyGetStateQPU

Function pyGetStateQPU

python/runtime/cudaq/algorithms/py_state.cpp:229–240  ·  view source on GitHub ↗

@brief Run `cudaq::get_state` for qpu targets on the provided kernel and args

Source from the content-addressed store, hash-verified

227/// @brief Run `cudaq::get_state` for qpu targets on the provided
228/// kernel and args
229state pyGetStateQPU(const std::string &kernelName, MlirModule kernelMod,
230 nanobind::args args) {
231 auto moduleOp = unwrap(kernelMod);
232 std::string mlirCode;
233 llvm::raw_string_ostream outStr(mlirCode);
234 mlir::OpPrintingFlags opf;
235 opf.enableDebugInfo(/*enable=*/true, /*pretty=*/false);
236 moduleOp.print(outStr, opf);
237 args = simplifiedValidateInputArguments(args);
238 auto *argData = toOpaqueArgs(args, kernelMod, kernelName);
239 return state(new PyQPUState(kernelName, mlirCode, argData));
240}
241
242state pyGetStateLibraryMode(nanobind::object kernel, nanobind::args args) {
243 return detail::extractState([&]() mutable {

Callers 1

bindPyStateMethod · 0.85

Calls 2

stateClass · 0.50
printMethod · 0.45

Tested by

no test coverage detected