qml.templates.core.AbstractArray

class AbstractArray(shape, dtype=dtype('int64'))[source]

Bases: object

An abstract representation of an array that contains the shape and dtype attributes necessary for resource calculations.

This class is used with subroutine_resource_rep() for specifying abstract information about a Subroutine for purposes of resource calculations used with graph decompositions.

Parameters:
  • shape (tuple(int)) – the dimensions of the array. () corresponds to a scalar.

  • dtype (type) – the data type of the array. Defaults to np.dtype(int) for easier use in specifying

  • wires.

dtype

shape

dtype = dtype('int64')
shape