cuStateVec Ex (cuquantum.bindings.custatevecEx)#

Python objects & constants#

Objects#

SVUpdaterConfigItem(int name, int32_t value)

One SVUpdater configuration name and its int32 value.

Enums and constants#

CommunicatorStatus(value)

Status code returned by communicator method functions.

StateVectorCapability(value)

Bitmask that specifies state vector capability.

StateVectorDistributionType(value)

Enum that specifies the distribution type of state vector.

IndexBitDomain(value)

Specifies a domain that an index bit belongs to.

WireInitMode(value)

Specifies the initialization mode of newly added wires.

GlobalIndexBitClass(value)

Communication method for global index bit operations in multi-process distributions.

StateVectorProperty(value)

Specifies the name of state vector property.

PermutationType(value)

Specifies the permutation type.

ExposeResources(value)

Resource exposure type.

MatrixType(value)

Specifies the type of matrix.

SVUpdaterConfigName(value)

Specifies the configuration argument type of SVUpdater.

MemorySharingMethod(value)

Specifies the method to share device virtual memory among processes.

MemoryPlacement(value)

Memory placement type.

SynchronizationScope(value)

Specifies the scope of synchronization.

Python functions#

Dictionary API#

dictionary_destroy(intptr_t dictionary)

Destroy dictionary instance.

Communicator API#

cuquantum.bindings.custatevec.CommunicatorType (including MPI_ABI) is accepted by communicator_initialize().

communicator_initialize(...)

Initialize inter-process communication.

communicator_finalize()

Finalize inter-process communication library.

communicator_get_size_and_rank()

Get the global size and rank.

communicator_create()

Create communicator instance.

communicator_destroy(intptr_t ex_communicator)

Destroy communicator instance.

State vector API#

Configuration and lifecycle#

configure_state_vector_single_device(...)

Create configuration for single device state vector.

configure_state_vector_multi_device(...)

Create configuration for multi-device state vector.

configure_state_vector_multi_process(...)

Create configuration for multi-process distributed state vector.

state_vector_create_single_process(...)

Create state vector.

state_vector_create_multi_process(...)

Create multi-process distributed state vector.

state_vector_destroy(intptr_t state_vector)

Destroy state vector instance.

Properties and state management#

state_vector_get_property(...)

Retrieve state vector properties.

state_vector_set_math_mode(...)

Set the compute precision mode for a state vector instance.

state_vector_set_zero_state(...)

Set the zero state to state vector.

state_vector_get_state(...)

Copy state vector elements to host buffer.

state_vector_set_state(...)

Set complex value array on host to state vector.

state_vector_reassign_wire_ordering(...)

Reassign wire ordering to state vector.

state_vector_permute_index_bits(...)

Permute index bits and wires of state vector.

state_vector_add_wires(...)

Add wires to a state vector.

Resources and synchronization#

state_vector_stage_sub_sv(...)

Stage a sub state vector onto device memory.

state_vector_expose_resources(...)

Expose state vector resources for access.

state_vector_get_resources_from_device_sub_sv(...)

Get resources from device sub state vector.

state_vector_get_resources_from_device_sub_sv_view(...)

Get resources from device sub state vector (read-only view).

state_vector_get_resources_from_unstaged_sub_sv_slice(...)

Get resources from unstaged sub state vector slice.

state_vector_get_resources_from_unstaged_sub_sv_slice_view(...)

Get resources from unstaged sub state vector slice (read-only view).

state_vector_synchronize(intptr_t state_vector)

Flush all operations and synchronize.

state_vector_synchronize_scoped(...)

Flush all operations and synchronize within the specified scope.

Simulator API#

abs2sum_array(intptr_t state_vector, ...)

Calculate abs2sum array for a given set of wires.

measure(intptr_t state_vector, ...)

Perform qubit measurements.

sample(intptr_t state_vector, ...)

Sample bit strings from the state vector.

apply_matrix(intptr_t state_vector, ...)

Apply gate matrix.

apply_pauli_rotation(intptr_t state_vector, ...)

Apply the exponential of a multi-qubit Pauli operator.

compute_expectation_on_pauli_basis(...)

Compute expectation values for a batch of (multi-qubit) Pauli operators.

compute_expectation(intptr_t state_vector, ...)

Compute expectation values for a batch of matrix observables.

SVUpdater API#

configure_sv_updater(int data_type[, ...])

Configure an SVUpdater and return its configuration dictionary.

sv_updater_create(...)

Create SVUpdater.

sv_updater_destroy(intptr_t sv_updater)

Destroy SVUpdater instance.

sv_updater_clear(intptr_t sv_updater)

Clear operations queued in SVUpdater.

sv_updater_enqueue_matrix(...)

Enqueue matrix to SVUpdater.

sv_updater_enqueue_unitary_channel(...)

Enqueue mixed unitary channel.

sv_updater_enqueue_general_channel(...)

Enqueue general channel.

sv_updater_get_max_num_required_randnums(...)

Get the max number of required random numbers.

sv_updater_apply(intptr_t sv_updater, ...)

Apply queued operations.