FIXME(OperatorCpp): Remove this when the operator class is implemented in C++
| 18 | // FIXME(OperatorCpp): Remove this when the operator class is implemented in |
| 19 | // C++ |
| 20 | cudaq::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 | } |
| 25 | cudaq::spin_op to_spin_op_term(nanobind::object &obj) { |
| 26 | auto op = cudaq::spin_op::empty(); |
| 27 | if (nanobind::hasattr(obj, "_to_spinop")) |