apply_matrix#

cuquantum.bindings.custatevecEx.apply_matrix(
intptr_t state_vector,
intptr_t matrix,
int matrix_data_type,
int ex_matrix_type,
int layout,
int32_t adjoint,
targets,
int32_t num_targets,
controls,
control_bit_values,
int32_t num_controls,
)[source]#

Apply gate matrix.

Parameters:
  • state_vector (intptr_t) – state vector instance.

  • matrix (intptr_t) – pointer to a buffer that holds matrix elements.

  • matrix_data_type (int) – data type of matrix.

  • ex_matrix_type (MatrixType) – enumerator specifying the matrix type and layout.

  • layout (int) – enumerator specifying the matrix layout.

  • adjoint (int32_t) – apply adjoint of matrix.

  • targets (object) –

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

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

    • a Python sequence of int32_t.

  • num_targets (int32_t) – the number of target wires.

  • controls (object) –

    pointer to a host array of control wires. 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.

  • num_controls (int32_t) – the number of control wires.