Function Pennylane::allocateAlignedArray

Function Documentation

auto Pennylane::allocateAlignedArray(std::size_t size, const py::dtype &dt, bool zeroInit = false) -> py::array

Create a numpy array whose underlying data is allocated by lightning.

See https://github.com/pybind/pybind11/issues/1042#issuecomment-325941022 for capsule usage.

Parameters
  • size – Size of the array to create

  • dt – Pybind11’s datatype object