Function Pennylane::NanoBindings::allocateAlignedArray

Function Documentation

auto Pennylane::NanoBindings::allocateAlignedArray(std::size_t size, const nb::object &dtype, bool zeroInit = false) -> nb::object

Allocate aligned array with specified dtype.

Parameters
  • size – Size of the array to create

  • dtype – Python dtype object to create the array with

  • zeroInit – Whether to initialize the array with zeros

Returns

nb::object a general nanobind object that can assume any of the types in the method.