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

Function kwargs_to_param_map

python/runtime/cudaq/operators/py_helpers.cpp:18–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16namespace cudaq::detail {
17
18cudaq::parameter_map kwargs_to_param_map(const nanobind::kwargs &kwargs) {
19 cudaq::parameter_map params;
20 for (auto [keyPy, valuePy] : kwargs) {
21 std::string key = nanobind::str(keyPy).c_str();
22 std::complex<double> value = nanobind::cast<std::complex<double>>(valuePy);
23 params.insert(params.end(),
24 std::pair<std::string, std::complex<double>>(key, value));
25 }
26 return params;
27}
28
29cudaq::parameter_map kwargs_to_param_map(nanobind::kwargs &kwargs,
30 bool &invert_order) {

Callers 6

bindBosonOperatorFunction · 0.85
bindSpinOperatorFunction · 0.85
bindMatrixOperatorFunction · 0.85
bindFermionOperatorFunction · 0.85
bindScalarOperatorFunction · 0.85
bindOperatorHandlersFunction · 0.85

Calls 2

insertMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected