Commit ce4d60f8 authored by Mccaskey, Alex's avatar Mccaskey, Alex
Browse files

add head and tail methods to python qreg

parent 6b2833b1
Loading
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -524,8 +524,22 @@ PYBIND11_MODULE(_pyqcor, m) {
            return q.extract_range(r);
          },
          "")
      // .def("extract_qubits", &xacc::internal_compiler::qreg::extract_qubits,
      // "")
      .def(
          "head", [](xacc::internal_compiler::qreg &q) { return q.head(); }, "")
      .def(
          "head",
          [](xacc::internal_compiler::qreg &q, const std::size_t n) {
            return q.head(n);
          },
          "")
      .def(
          "tail", [](xacc::internal_compiler::qreg &q) { return q.tail(); }, "")
      .def(
          "tail",
          [](xacc::internal_compiler::qreg &q, const std::size_t n) {
            return q.tail(n);
          },
          "")
      .def("exp_val_z", &xacc::internal_compiler::qreg::exp_val_z, "")
      .def(
          "results",