cuquantum.custatevec.accessor_create

cuquantum.custatevec.accessor_create(intptr_t handle, intptr_t sv, int sv_data_type, uint32_t n_index_bits, bit_ordering, uint32_t bit_ordering_len, mask_bit_string, mask_ordering, uint32_t mask_len) -> (intptr_t, size_t)[source]

Create accessor to copy elements between the statevector and external buffers.

Parameters
  • handle (intptr_t) – The library handle.

  • sv (intptr_t) – The pointer address (as Python int) to the statevector (on device).

  • sv_data_type (cuquantum.cudaDataType) – The data type of the statevector.

  • n_index_bits (uint32_t) – The number of index bits.

  • bit_ordering

    A host array of basis bits for the external buffer. It can be

    • an int as the pointer address to the array

    • a Python sequence of basis bits

  • bit_ordering_len (uint32_t) – The length of bit_ordering.

  • mask_bit_string

    A host array for specifying mask values. It can be

    • an int as the pointer address to the array

    • a Python sequence of mask values

  • mask_ordering

    A host array of mask ordering. It can be

    • an int as the pointer address to the array

    • a Python sequence of index bit ordering

  • mask_len (uint32_t) – The length of mask_ordering.

Returns

A 2-tuple. The first element is the accessor descriptor (as Python int), and the second element is the required workspace size (in bytes).

Return type

tuple