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

Function to_spin_op

python/runtime/common/py_ObserveResult.cpp:20–24  ·  view source on GitHub ↗

FIXME(OperatorCpp): Remove this when the operator class is implemented in C++

Source from the content-addressed store, hash-verified

18// FIXME(OperatorCpp): Remove this when the operator class is implemented in
19// C++
20cudaq::spin_op to_spin_op(nanobind::object &obj) {
21 if (nanobind::hasattr(obj, "_to_spinop"))
22 return nanobind::cast<cudaq::spin_op>(obj.attr("_to_spinop")());
23 return nanobind::cast<cudaq::spin_op>(obj);
24}
25cudaq::spin_op to_spin_op_term(nanobind::object &obj) {
26 auto op = cudaq::spin_op::empty();
27 if (nanobind::hasattr(obj, "_to_spinop"))

Callers 1

bindObserveResultFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected