cuquantum.custatevec.apply_generalized_permutation_matrix

cuquantum.custatevec.apply_generalized_permutation_matrix(intptr_t handle, intptr_t sv, int sv_data_type, uint32_t n_index_bits, permutation, intptr_t diagonals, int diagonals_data_type, int32_t adjoint, targets, uint32_t n_targets, controls, control_bit_values, uint32_t n_controls, intptr_t extra_workspace, size_t extra_workspace_size_in_bytes)[source]

Apply generalized permutation matrix.

Parameters
  • handle (intptr_t) – the handle to the cuStateVec library.

  • sv (intptr_t) – state vector.

  • sv_data_type (int) – data type of the state vector.

  • n_index_bits (uint32_t) – the number of index bits of the state vector.

  • permutation (object) –

    host or device pointer to a permutation table. It can be:

    • an int as the pointer address to the array, or

    • a Python sequence of custatevecIndex_t.

  • diagonals (intptr_t) – host or device pointer to diagonal elements.

  • diagonals_data_type (int) – data type of diagonals.

  • adjoint (int32_t) – apply adjoint of generalized permutation matrix.

  • targets (object) –

    pointer to a host array of target bits. It can be:

    • an int as the pointer address to the array, or

    • a Python sequence of int32_t.

  • n_targets (uint32_t) – the number of target bits.

  • controls (object) –

    pointer to a host array of control bits. It can be:

    • an int as the pointer address to the array, or

    • a Python sequence of int32_t.

  • control_bit_values (object) –

    pointer to a host array of control bit values. It can be:

    • an int as the pointer address to the array, or

    • a Python sequence of int32_t.

  • n_controls (uint32_t) – the number of control bits.

  • extra_workspace (intptr_t) – extra workspace.

  • extra_workspace_size_in_bytes (size_t) – extra workspace size.