cuTensorNet

cuTensorNet.jl wraps NVIDIA's cuTensorNet library, part of cuQuantum, for contracting and decomposing tensor networks and simulating quantum circuits. It has no integration with Base or LinearAlgebra functions; it offers two levels:

  • The functions and types documented below wrap cuTensorNet's routines and objects. They fall into three groups:
  • The generated bindings in libcutensornet.jl follow NVIDIA's C API, and change with the cuQuantum release. Use them together with handle.

The wrappers use snake-case names, and share these conventions:

  • Modes are labeled with integers (or, for the decompositions, characters). Modes with the same label are contracted. The modes of a state are numbered from 0, as in NVIDIA's API.
  • Objects keep the arrays they are given alive, and the library uses their memory directly: change their contents only where a function says that is supported.
  • Settings that NVIDIA exposes as attributes are passed as keyword structs (OptimizerConfig, SVDConfig, NetworkAutotunePreferences), or with attribute! and configure!, which take NVIDIA's attribute enums and values of the type NVIDIA documents for them. The same goes for the enum-typed keywords of the wrappers, such as algo of gate_split!.
  • Functions that launch work take a stream keyword, which defaults to the task's stream. The computations on states wait for their result; the others don't.

CuTensorNetwork, perform_contraction!, AutoTune, NoAutoTune and AutotunePreferences wrap NVIDIA's deprecated network descriptors and contraction plans, and are deprecated in favor of CuNetwork.

Public

cuTensorNet.CUTENSORNETError — Type
CUTENSORNETError(code::cutensornetStatus_t)

The exception thrown when a cuTensorNet call fails, with the status code it returned.

source
cuTensorNet.CuNetwork — Type
CuNetwork{T}()

An empty tensor network with elements of type T, to be contracted on the GPU. Add input tensors with append_tensor! and the output tensor with set_output!. Then find a contraction path with rehearse_contraction (or reuse one with set_optimizer_info!), allocate the workspace with prepare_contraction!, and contract the network with contract! as often as needed. The network keeps its tensors alive and uses their memory directly: their contents can change between contractions, but call purge_cache! when that of a constant input does.

net = CuNetwork{Float64}()append_tensor!(net, A, [1, 2])  # C[i,k] = A[i,j] B[j,k]append_tensor!(net, B, [2, 3])set_output!(net, C, [1, 3])rehearse_contraction(net, 2^30)prepare_contraction!(net)contract!(net)

Wraps cutensornetNetworkDescriptor_t, as created by cutensornetCreateNetwork.

source
cuTensorNet.CuNetworkOperator — Type
CuNetworkOperator{T}(extents)

An operator on a state with modes of the given extents, as a sum of terms that are added with append_product! and append_mpo!. Apply it to a CuNetworkState with apply!, or compute its expectation value with CuStateExpectation.

The tensors of an operator have the state modes they act on as their first modes, in order, followed by the corresponding dual modes. This differs from the layout of the operators that apply! takes.

Wraps cutensornetNetworkOperator_t.

source
cuTensorNet.CuNetworkState — Type
CuNetworkState{T}(extents; purity=CUTENSORNET_STATE_PURITY_PURE)

A quantum state, or other tensor network state, of modes with the given extents, starting as the vacuum state (all modes 0). Apply operators to it with apply! and the other apply_*! functions, or start from an MPS with initialize_mps!. Then compute the state itself with prepare! and compute!, or properties of it with CuStateAccessor, CuStateExpectation, CuStateMarginal, CuStateSampler and CuStateProjectionMPS. With purity = CUTENSORNET_STATE_PURITY_MIXED, it is a density matrix.

State modes are numbered from 0. The state keeps what it is given alive, but uses the memory of operators directly: register changes to an operator with update!. That memory must be device memory.

Wraps cutensornetState_t.

source
cuTensorNet.CuStateAccessor — Method
CuStateAccessor(state::CuNetworkState, projected_modes=Int32[])

A computation of amplitudes of the state, for the projected_modes having values that are given to compute!. The amplitudes have the remaining modes in order; for a mixed state, these are the modes of the density matrix, with the dual modes numbered after the others. Prepare it with prepare!.

Wraps cutensornetCreateAccessor.

source
cuTensorNet.CuStateMarginal — Method
CuStateMarginal(state::CuNetworkState, modes; projected_modes=Int32[], diagonal=false)

A computation of the reduced density matrix of the state on modes. With diagonal = true, only its diagonal is computed, i.e. the probabilities of the basis states. The projected_modes take the values given to compute!. Prepare it with prepare!.

Wraps cutensornetCreateMarginal and cutensornetCreateMarginalDiagonal.

source
cuTensorNet.CuStateProjectionMPS — Method
CuStateProjectionMPS(state::CuNetworkState{T}, dual_tensors::Vector{<:CuArray{T}},
                     envs::Vector{<:Pair}; coefficient=1, symmetric=false, ortho=nothing,
                     boundary_condition=CUTENSORNET_BOUNDARY_CONDITION_OPEN)

A projection of the state on the MPS with the given dual tensors, for example to compress it or to optimize the MPS site by site. Each environment is given as lower => upper, the sites left and right of the MPS tensors it excludes, where -1 and length(dual_tensors) are the boundaries; it cannot span the whole MPS. ortho gives the orthogonality center of the MPS, if it has one, in the same form: 0 => 2 for site 1. Prepare it with prepare!, then use tensor_info, compute_env!, extract_tensor! and insert_tensor!.

Wraps cutensornetCreateStateProjectionMPS.

source
cuTensorNet.CuTensorNetworkContractionOptimizerInfo — Type
CuTensorNetworkContractionOptimizerInfo(net::CuNetwork)
CuTensorNetworkContractionOptimizerInfo(net::CuNetwork, data::Vector{UInt8})

The contraction path of a network, with its slicing, as found by rehearse_contraction. The first form creates an empty one for net, to be filled with unpack! or attribute!; the second one recreates a path saved with pack, for a network with the same shape. Attach it to a network with set_optimizer_info!.

Query it with num_slices, num_sliced_modes and flop_count.

Wraps cutensornetContractionOptimizerInfo_t.

source
cuTensorNet.CuTensorNetworkSliceGroup — Type
CuTensorNetworkSliceGroup(start, stop, step)
CuTensorNetworkSliceGroup(ids::Vector{Int64})

A set of slices of a sliced contraction, given as the range from start up to but not including stop, or as a list of slice ids. Slice ids are 0-based and less than num_slices. Pass it to contract! or compute_gradients! to compute part of a contraction.

Wraps cutensornetSliceGroup_t.

source
cuTensorNet.NetworkAutotunePreferences — Type
NetworkAutotunePreferences(; max_iterations=3, intermediate_modes=2)

Settings for autotune!. max_iterations is the number of iterations to time the candidate kernels for, and intermediate_modes whether to also tune the mode order of intermediate tensors (0 off, 1 on, 2 lets cuTensorNet decide).

source
cuTensorNet.OptimizerConfig — Type
OptimizerConfig(; num_graph_partitions=8, graph_cutoff_size=8, ..., seed=0, ...)

Settings for the search for a contraction path by rehearse_contraction. Each keyword sets the CUTENSORNET_CONTRACTION_OPTIMIZER_CONFIG_* attribute with the corresponding name (e.g. graph_num_cuts sets GRAPH_NUM_CUTS, and num_graph_partitions GRAPH_NUM_PARTITIONS); see NVIDIA's documentation of these attributes. The defaults are those of the struct, which differ from NVIDIA's for some keywords, such as slicer_slice_factor and hyper_num_threads. hyper_num_samples > 0 makes the search try several paths, and seed makes it reproducible.

source
cuTensorNet.SVDConfig — Type
SVDConfig(; abs_cutoff=0.0, rel_cutoff=0.0,
          s_normalization=CUTENSORNET_TENSOR_SVD_NORMALIZATION_NONE,
          s_partition=CUTENSORNET_TENSOR_SVD_PARTITION_NONE)

Settings for the truncated SVD of tensor_svd! and gate_split!. Singular values below abs_cutoff, or below rel_cutoff times the largest one, are discarded. s_normalization (a cutensornetTensorSVDNormalization_t) normalizes the singular values that are kept, and s_partition (a cutensornetTensorSVDPartition_t) absorbs them into U, V or both.

source
cuTensorNet.append_mpo! — Method
append_mpo!(op::CuNetworkOperator{T}, coefficient, modes::Vector{<:Integer},
            tensors::Vector{<:CuArray{T}}; boundary_condition=CUTENSORNET_BOUNDARY_CONDITION_OPEN)
    -> Int64

Add a term to the operator: coefficient times a matrix product operator acting on the (0-based) state modes, with one tensor per mode. Each tensor has the modes (left bond, state mode, right bond, dual state mode), without the outer bonds at the boundaries of an open chain. Returns the id of the term.

Wraps cutensornetNetworkOperatorAppendMPO.

source
cuTensorNet.append_product! — Method
append_product!(op::CuNetworkOperator{T}, coefficient, modes::Vector{<:Vector{<:Integer}},
                tensors::Vector{<:CuArray{T}}) -> Int64

Add a term to the operator: coefficient times the product of tensors, each acting on the (0-based) state modes in the corresponding element of modes. Returns the id of the term.

Wraps cutensornetNetworkOperatorAppendProduct.

source
cuTensorNet.append_tensor! — Method
append_tensor!(net::CuNetwork{T}, tensor::CuArray{T}, modes;
               conjugate=false, constant=false, requires_gradient=false) -> Int64

Add tensor as an input of the network, with an integer label for each of its modes, and return the id the network gives it. Modes with the same label are contracted. conjugate uses the complex conjugate of the tensor, constant promises that its contents don't change between contractions so that intermediate results can be cached, and requires_gradient makes compute_gradients! compute the gradient with respect to it.

Wraps cutensornetNetworkAppendTensor.

source
cuTensorNet.apply! — Method
apply!(state::CuNetworkState{T}, modes, operator::CuArray{T};
       immutable=true, adjoint=false, unitary=false) -> Int64
apply!(state::CuNetworkState{T}, operator::CuNetworkOperator{T}; ...) -> Int64

Apply an operator to the state, and return its id. A tensor operator acts on the 0-based state modes, and has twice as many dimensions: its elements are stored following the rows of its textbook definition, i.e. as reshape(permutedims(M), ...) of a matrix M. immutable = false allows changing it later with update!, adjoint applies its adjoint instead, and unitary promises that it is unitary, which saves work.

Wraps cutensornetStateApplyTensorOperator and cutensornetStateApplyNetworkOperator.

source
cuTensorNet.apply_controlled! — Method
apply_controlled!(state::CuNetworkState{T}, control_modes, target_modes, operator::CuArray{T};
                  control_values=nothing, immutable=true, adjoint=false, unitary=false)
    -> Int64

Apply operator to the target_modes of the state when the control_modes have the control_values, which default to the last basis state of each mode (1 for qubits), and return its id. operator only covers the target modes, laid out as for apply!.

Wraps cutensornetStateApplyControlledTensorOperator.

source
cuTensorNet.apply_diagonal! — Method
apply_diagonal!(state::CuNetworkState{T}, modes, diagonal::CuArray{T};
                immutable=true, adjoint=false, unitary=false) -> Int64

Apply a diagonal operator to the state, given by its diagonal as a tensor with one dimension per mode, and return its id. Afterwards, compute! can't compute the full state anymore, only properties of it.

Wraps cutensornetStateApplyDiagonalTensorOperator.

source
cuTensorNet.attribute! — Method
attribute!(net::CuNetwork, attr::cutensornetNetworkAttributes_t, value) -> net
attribute!(info::CuTensorNetworkContractionOptimizerInfo,
           attr::cutensornetContractionOptimizerInfoAttributes_t, value) -> info

Set an attribute of a network or of a contraction path, given by NVIDIA's attribute enum. value must have the type that NVIDIA documents for the attribute, e.g. attribute!(net, CUTENSORNET_NETWORK_COMPUTE_TYPE, CUTENSORNET_COMPUTE_64F). A changed contraction path must be attached again with set_optimizer_info!.

Wraps cutensornetNetworkSetAttribute and cutensornetContractionOptimizerInfoSetAttribute.

source
cuTensorNet.attribute — Method
attribute(net::CuNetwork, attr::cutensornetNetworkAttributes_t, R) -> R

Read an attribute of a network, given by NVIDIA's attribute enum (e.g. CUTENSORNET_NETWORK_COMPUTE_TYPE), as a value of type R, the type that NVIDIA documents for the attribute. This only works for attributes with a scalar value: use tensor_ids for the lists of input tensors.

Wraps cutensornetNetworkGetAttribute.

source
cuTensorNet.compute! — Method
compute!(state::CuNetworkState; stream=stream()) -> (; tensors, extents, strides)
compute!(acc::CuStateAccessor, projected_values=[]; stream=stream()) -> amplitudes, norm
compute!(x::CuStateExpectation; stream=stream()) -> value, norm
compute!(x::CuStateMarginal, projected_values=[]; stream=stream()) -> marginal

Compute a prepared state, or a property of it, and wait for the result.

  • For a state, the result is the tensor of the full state, or the tensors of its MPS after finalize_mps!. MPS tensors can be truncated: the returned extents and strides say which part of each tensor holds the data. The full state can't be computed after apply_diagonal!. Wraps cutensornetStateCompute.
  • For an accessor, the amplitudes of the modes that are not projected, for the projected modes having the given values, and the squared norm of the state. Wraps cutensornetAccessorCompute.
  • For an expectation value, the expectation value of the operator, not divided by the squared norm of the state, which is also returned. Wraps cutensornetExpectationCompute.
  • For a marginal, the reduced density matrix of its modes (or its diagonal), for the projected modes having the given values. Wraps cutensornetMarginalCompute.
source
cuTensorNet.compute_env! — Method
compute_env!(x::CuStateProjectionMPS{T}, env::Pair, input, output::CuArray{T};
             apply_inv_metric=false, re_resolve_channels=false, stream=stream()) -> output

Compute the environment env of the projection into output, contracted with the MPS tensor input if it isn't nothing.

Wraps cutensornetStateProjectionMPSComputeTensorEnv.

source
cuTensorNet.compute_gradients! — Method
compute_gradients!(net::CuNetwork; accumulate=false, slices=nothing, stream=stream())
    -> Dict{Int64,CuArray}

Compute the gradients of the contraction with respect to the inputs added with requires_gradient = true, after a call to contract!. They are written to the arrays set with set_gradient!, for the adjoint set with set_adjoint!, and returned by input id. The network must have been prepared with gradients = true.

Wraps cutensornetNetworkComputeGradientsBackward.

source
cuTensorNet.compute_with_gradients! — Method
compute_with_gradients!(x::CuStateExpectation; expectation_adjoint=1, norm_adjoint=0,
                        accumulate=false, stream=stream()) -> value, norm

Compute the expectation value as compute! does, and write the gradients with respect to the operators applied with apply_with_gradient!. The adjoints are the derivatives of the end result of the computation with respect to the two return values. With accumulate, the gradients are added to the arrays.

Wraps cutensornetExpectationComputeWithGradientsBackward.

source
cuTensorNet.configure! — Function
configure!(x, attr, value) -> x

Set a configuration attribute of a state or a computation on it. The attribute is given by NVIDIA's enum for the type of x (cutensornetStateAttributes_t, cutensornetAccessorAttributes_t, ...), e.g. CUTENSORNET_EXPECTATION_CONFIG_NUM_HYPER_SAMPLES, and value must have the type that NVIDIA documents for it. Call it before prepare!.

Wraps cutensornetStateConfigure, cutensornetAccessorConfigure and the like.

source
cuTensorNet.contract! — Method
contract!(net::CuNetwork; accumulate=false, slices=nothing, stream=stream()) -> output

Contract the prepared network into its output tensor, which is returned. With accumulate, the result is added to the output. slices, a CuTensorNetworkSliceGroup, limits the contraction to some of the slices, e.g. to distribute it.

Wraps cutensornetNetworkContract.

source
cuTensorNet.enable_logging — Function
cuTensorNet.enable_logging(enable::Bool=true)

Forward log messages from cuTensorNet to Julia's logging system. API and kernel traces are reported at Debug level, performance hints at Info level, and problems at Error level. Starting Julia with JULIA_DEBUG=cuTensorNet enables this automatically, and also shows the Debug-level messages.

source
cuTensorNet.finalize_mps! — Method
finalize_mps!(state::CuNetworkState, extents::Vector{<:Vector{<:Integer}};
              boundary_condition=CUTENSORNET_BOUNDARY_CONDITION_OPEN,
              svd_algorithm=CUTENSORNET_TENSOR_SVD_ALGO_GESVDJ) -> state

Have compute! compute the state as a matrix product state, with tensors of at most the given extents, laid out as for initialize_mps!. The SVD used to truncate it can be configured with configure! and CUTENSORNET_STATE_CONFIG_MPS_SVD_*; the algorithm defaults to Jacobi (gesvdj), as NVIDIA's default fails for some states.

Wraps cutensornetStateFinalizeMPS.

source
cuTensorNet.flops — Function
flops(x) -> Float64

The estimated number of floating-point operations of the prepared state or computation.

source
cuTensorNet.gate_split! — Method
gate_split!(A, modes_a, B, modes_b, G, modes_g, U, modes_u, S, V, modes_v;
            algo=CUTENSORNET_GATE_SPLIT_ALGO_DIRECT, svd_config=SVDConfig(), stream, ...)
    -> U, S, V, info
gate_split!(A::CuTensor, B::CuTensor, G::CuTensor, U::CuTensor, S, V::CuTensor; ...)
    -> U, S, V, info

Apply the two-site gate G to the tensors A and B, and split the result again. This is how a gate is applied to a matrix product state: A and B share a bond, and the result is split with a truncated SVD into U and V, with singular values S. algo (a cutensornetGateSplitAlgo_t) selects whether the full tensor is decomposed (DIRECT) or A and B are first reduced by QR (REDUCED), and svd_config the truncation, as in tensor_svd!.

Wraps cutensornetGateSplit.

source
cuTensorNet.handle — Method
cuTensorNet.handle()

The cuTensorNet handle of the current task, for its active context, for calling the C API of cuTensorNet (cuTensorNet.cutensornet*) directly. It converts to a cutensornetHandle_t. The handle is borrowed: don't destroy it or change its settings, and don't keep it across tasks. Its fields are not part of the API.

source
cuTensorNet.info — Function
info(x, attr, R) -> R

Read an information attribute of a prepared state or computation on it, such as CUTENSORNET_EXPECTATION_INFO_FLOPS, as a value of type R.

Wraps cutensornetStateGetInfo, cutensornetAccessorGetInfo and the like.

source
cuTensorNet.initialize_mps! — Method
initialize_mps!(state::CuNetworkState{T}, tensors::Vector{<:CuArray{T}};
                boundary_condition=CUTENSORNET_BOUNDARY_CONDITION_OPEN) -> state

Start the state from a matrix product state with one tensor per state mode, instead of from the vacuum state. Each tensor has the modes (left bond, state mode, right bond), without the outer bonds at the boundaries of an open chain.

Wraps cutensornetStateInitializeMPS.

source
cuTensorNet.insert_tensor! — Method
insert_tensor!(x::CuStateProjectionMPS{T}, env::Pair, input::CuArray{T}; ortho=nothing,
               stream=stream()) -> x

Insert input as the MPS tensor excluded by the environment env, moving the orthogonality center to ortho, given as for CuStateProjectionMPS (0 => 2 for site 1). It is the site of a one-site environment (the default), one of the sites of a two-site environment, or a site next to the bond of a zero-site environment.

Wraps cutensornetStateProjectionMPSInsertTensor.

source
cuTensorNet.prepare! — Function
prepare!(x; max_workspace=2^30, preference=CUTENSORNET_WORKSIZE_PREF_RECOMMENDED,
         stream=stream()) -> x

Prepare a state, or a computation on it, for compute! (or sample!, compute_env! and the like), using at most max_workspace bytes of workspace, which this allocates. Prepare a state again after applying more operators to it, or changing whether one is unitary. Applying an operator to a state invalidates the computations created on it before (accessors, expectations, marginals, samplers): create those again.

Wraps cutensornetStatePrepare, cutensornetAccessorPrepare and the like.

source
cuTensorNet.prepare_contraction! — Method
prepare_contraction!(net::CuNetwork; gradients=false,
                     preference=CUTENSORNET_WORKSIZE_PREF_RECOMMENDED) -> net

Allocate the workspace for contracting the network along its contraction path, and prepare the contraction. This is needed before autotune! and contract!, and with gradients = true before compute_gradients!. preference (a cutensornetWorksizePref_t) selects how much workspace to allocate.

Wraps cutensornetNetworkPrepareContraction and cutensornetNetworkPrepareGradientsBackward.

source
cuTensorNet.purge_cache! — Function
purge_cache!(net::CuNetwork) -> net

Drop the intermediate results cached because of inputs added with constant = true. Call this after changing the contents of such an input.

Wraps cutensornetWorkspacePurgeCache.

source
cuTensorNet.reduced_extent — Method
reduced_extent(info::CuTensorSVDInfo) -> Int64

The number of singular values kept after truncation, k. Only the first k singular values are valid. When k is smaller than the extent of the mode that U and V share, the factors are stored packed, as arrays with extent k for that mode in the first elements of U and V: for a kmax×n matrix V, the factor is reshape(view(V, 1:k*n), k, n), not V[1:k, :].

source
cuTensorNet.rehearse_contraction — Function
rehearse_contraction(net::CuNetwork, max_workspace_size, config=OptimizerConfig())
    -> CuTensorNetworkContractionOptimizerInfo

Find a contraction path for the network that needs at most max_workspace_size bytes of workspace, slicing the contraction if needed, and attach it to the network. The search is configured with OptimizerConfig.

Wraps cutensornetContractionOptimize.

source
cuTensorNet.sample! — Method
sample!(x::CuStateSampler, num_shots; stream=stream()) -> Matrix{Int64}

Draw num_shots samples of the sampler's modes, as a matrix with a column of mode values for each sample. Configure CUTENSORNET_SAMPLER_CONFIG_DETERMINISTIC with configure! for reproducible samples.

Wraps cutensornetSamplerSample.

source
cuTensorNet.set_adjoint! — Method
set_adjoint!(net::CuNetwork{T}, adjoint::CuArray{T}) -> net

Set the adjoint of the output, which seeds the backward pass of compute_gradients!. It is the derivative of the final result with respect to the output tensor, and has the size of the output.

Wraps cutensornetNetworkSetAdjointTensorMemory.

source
cuTensorNet.set_gradient! — Method
set_gradient!(net::CuNetwork{T}, id, gradient::CuArray{T}) -> net

Set the array that compute_gradients! writes the gradient with respect to input id to. It has the size of that input, which must have been added with requires_gradient = true.

Wraps cutensornetNetworkSetGradientTensorMemory.

source
cuTensorNet.set_output! — Method
set_output!(net::CuNetwork{T}, tensor::CuArray{T}, modes) -> net

Set tensor as the output of the network, with an integer label for each of its modes. Modes of the inputs that are not in modes are summed over.

Wraps cutensornetNetworkSetOutputTensor.

source
cuTensorNet.tensor_ids — Method
tensor_ids(net::CuNetwork, num_attr, list_attr) -> Vector{Int32}

The ids of the input tensors with a qualifier, given by the network attributes for their number and their list, e.g. CUTENSORNET_NETWORK_INPUT_TENSORS_NUM_CONSTANT and CUTENSORNET_NETWORK_INPUT_TENSORS_CONSTANT.

source
cuTensorNet.tensor_info — Method
tensor_info(x::CuStateProjectionMPS, env::Pair) -> (; extents, strides)

The extents of the MPS tensor excluded by the environment env, and the strides NVIDIA recommends for it.

Wraps cutensornetStateProjectionMPSGetTensorInfo.

source
cuTensorNet.tensor_qr! — Method
tensor_qr!(A, modes_a, Q, modes_q, R, modes_r; stream, workspace_preference, memspace)
    -> Q, R
tensor_qr!(A::CuTensor, Q::CuTensor, R::CuTensor; ...) -> Q, R

Compute the QR decomposition of the tensor A, writing the factors to Q and R. The modes of A are split between Q and R by their labels: Q and R share one new mode, the modes of Q are rows and those of R are columns of the matrix being decomposed. Mode labels can be integers or characters. A is not modified.

Wraps cutensornetTensorQR. workspace_preference is a cutensornetWorksizePref_t, and memspace a cutensornetMemspace_t.

source
cuTensorNet.tensor_svd! — Method
tensor_svd!(A, modes_a, U, modes_u, S, V, modes_v; svd_config=SVDConfig(), stream, ...)
    -> U, S, V, info
tensor_svd!(A::CuTensor, U::CuTensor, S, V::CuTensor; ...) -> U, S, V, info

Compute the (truncated) singular value decomposition of the tensor A, writing the factors to U and V, and the singular values to the real vector S. The modes of A are split between U and V as in tensor_qr!. The truncation is configured with SVDConfig, and its result described by the returned CuTensorSVDInfo. When it reduces the shared mode, the factors are stored packed, as described at reduced_extent.

Wraps cutensornetTensorSVD.

source
cuTensorNet.update! — Method
update!(state::CuNetworkState{T}, id, operator::CuArray{T}; unitary=false) -> state

Use new data for the operator id, which must have been applied with immutable = false. Also call this after changing the operator in place.

Wraps cutensornetStateUpdateTensorOperator.

source
cuTensorNet.update_gradient! — Method
update_gradient!(state::CuNetworkState{T}, id, gradient::CuArray{T}) -> state

Write the gradient with respect to the operator id to a different array.

Wraps cutensornetStateUpdateTensorOperatorGradient.

source
cuTensorNet.version — Method
cuTensorNet.version() -> VersionNumber

The version of the cuTensorNet library in use, not that of the CUDA toolkit.

source

Private