cuquantum.cutensornet.create_network_descriptor

cuquantum.cutensornet.create_network_descriptor(intptr_t handle, int32_t n_inputs, n_modes_in, extents_in, strides_in, modes_in, qualifiers_in, int32_t n_modes_out, extents_out, strides_out, modes_out, int data_type, int compute_type) intptr_t[source]

Create a tensor network descriptor.

Parameters
  • handle (intptr_t) – The library handle.

  • n_inputs (int) – The number of input tensors.

  • n_modes_in

    A host array of the number of modes for each input tensor. It can be

    • an int as the pointer address to the array

    • a Python sequence of int

  • extents_in

    A host array of extents for each input tensor. It can be

    • an int as the pointer address to the nested sequence

    • a Python sequence of int, each of which is a pointer address to the corresponding tensor’s extents

    • a nested Python sequence of int

  • strides_in

    A host array of strides for each input tensor. It can be

    • an int as the pointer address to the nested sequence

    • a Python sequence of int, each of which is a pointer address to the corresponding tensor’s strides

    • a nested Python sequence of int

  • modes_in

    A host array of modes for each input tensor. It can be

    • an int as the pointer address to the nested sequence

    • a Python sequence of int, each of which is a pointer address to the corresponding tensor’s modes

    • a nested Python sequence of int

  • qualifiers_in

    A host array of qualifiers for each input tensor. It can be

    • an int as the pointer address to the numpy array with dtype tensor_qualifiers_dtype

    • a numpy array with dtype tensor_qualifiers_dtype

  • n_modes_out (int32_t) – The number of modes of the output tensor. If this is set to -1 and modes_out is set to 0 (not provided), the output modes will be inferred. If this is set to 0, the network is force reduced.

  • extents_out

    The extents of the output tensor (on host). It can be

    • an int as the pointer address to the array

    • a Python sequence of int

  • strides_out

    The strides of the output tensor (on host). It can be

    • an int as the pointer address to the array

    • a Python sequence of int

  • modes_out

    The modes of the output tensor (on host). It can be

    • an int as the pointer address to the array

    • a Python sequence of int

  • data_type (cuquantum.cudaDataType) – The data type of the input and output tensors.

  • compute_type (cuquantum.ComputeType) – The compute type of the tensor contraction.

Returns

An opaque descriptor handle (as Python int).

Return type

intptr_t

Note

If strides_in (strides_out) is set to 0 (NULL), it means the input tensors (output tensor) are in the Fortran layout (F-contiguous).