cuquantum.custatevec.SVSwapParameters

class cuquantum.custatevec.SVSwapParameters[source]

一个包装类,用于保存一组数据传输参数。

可以手动构造此类的实例(不带任何参数,或使用 from_data() 工厂方法)。参数可以通过实例属性的 getter/setter 获取/设置。

swap_batch_index

参见 custatevecSVSwapParameters_t::swapBatchIndex

类型

int32_t

org_sub_sv_index

参见 custatevecSVSwapParameters_t::orgSubSVIndex

类型

int32_t

dst_sub_sv_index

参见 custatevecSVSwapParameters_t::dstSubSVIndex

类型

int32_t

org_segment_mask_string

应为 dtype numpy.int32 的 1D 数组,大小为 custatevec.MAX_SEGMENT_MASK_SIZE。参见 custatevecSVSwapParameters_t::orgSegmentMaskString

类型

numpy.ndarray

dst_segment_mask_string

应为 dtype numpy.int32 的 1D 数组,大小为 custatevec.MAX_SEGMENT_MASK_SIZE。参见 custatevecSVSwapParameters_t::dstSegmentMaskString

类型

numpy.ndarray

segment_mask_ordering

应为 dtype numpy.int32 的 1D 数组,大小为 custatevec.MAX_SEGMENT_MASK_SIZE。参见 custatevecSVSwapParameters_t::segmentMaskOrdering

类型

numpy.ndarray

segment_mask_len

参见 custatevecSVSwapParameters_t::segmentMaskLen

类型

uint32_t

n_segment_bits

参见 custatevecSVSwapParameters_t::nSegmentBits

类型

uint32_t

data_transfer_type

参见 custatevecSVSwapParameters_t::dataTransferType

类型

DataTransferType

transfer_size

参见 custatevecSVSwapParameters_t::transferSize

类型

int64_t

方法

__init__(*args, **kwargs)
static from_data(data)[source]

从现有的 NumPy ndarray 构造 SVSwapParameters 实例。

参数

data (numpy.ndarray) – 必须是 dtype sv_swap_parameters_dtype 的大小为 1 的 NumPy ndarray。

属性

data

底层存储。

类型

data (numpy.ndarray)

ptr

底层存储的指针地址(作为 Python int)。

类型

ptr (intptr_t)