cuquantum.cutensornet.tensor.SVDMethod

class cuquantum.cutensornet.tensor.SVDMethod(max_extent: Optional[int] = None, abs_cutoff: Optional[float] = 0.0, rel_cutoff: Optional[float] = 0.0, discarded_weight_cutoff: Optional[float] = 0.0, partition: Optional[str] = None, normalization: Optional[str] = None, algorithm: Optional[str] = 'gesvd', gesvdj_tol: Optional[float] = 0, gesvdj_max_sweeps: Optional[int] = 0, gesvdr_oversampling: Optional[int] = 0, gesvdr_niters: Optional[int] = 0)[source]

A data class for providing SVD options to the cuquantum.cutensornet.tensor.decompose() function.

max_extent

Keep no more than the largest max_extent singular values in the output operands (the rest will be truncated).

Type

Optional[int]

abs_cutoff

Singular values below this value will be trimmed in the output operands.

Type

Optional[float]

rel_cutoff

Singular values below the product of this value and the largest singular value will be trimmed in the output operands.

Type

Optional[float]

discarded_weight_cutoff

Singular values with discarded weight (square sum dividied by total square sum) below this value will be trimmed.

Type

Optional[float]

partition

Singular values S will be explictly returned by default (partition=None). Alternatively, singular values may be factorized onto output tensor U (partition="U"), output tensor V (partition="V") or equally onto output tensor U and output tensor V (partition="UV"). When any of these three partition schemes is selected, the returned S operand from cuquantum.cutensornet.tensor.decompose() and cuquantum.cutensornet.experimental.contract_decompose() will be None.

Type

Optional[str]

normalization

The specified norm of the singular values (after truncation) will be normalized to 1. Currently supports None, "L1", "L2" and "LInf".

Type

Optional[str]

algorithm

The SVD algorithm to use. Currently supports "gesvd" (default), "gesvdj", "gesvdp" and "gesvdr".

Type

Optional[str]

gesvdj_tol

The tolerance to use when algorithm is set to "gesvdj". Default 0 denotes machine precision.

Type

Optional[float]

gesvdj_max_sweeps

The maximal number of sweeps when algorithm is set to "gesvdj". Default 0 denotes 100.

Type

Optional[int]

gesvdr_oversampling

The size of oversampling when algorithm is set to "gesvdr". Default 0 denotes the lower of 4 times max_extent and the difference between full rank and max_extent.

Type

Optional[int]

gesvdr_niters

The number of iteration of power method when algorithm is set to "gesvdr" and the default (0) is 10.

Type

Optional[int]

Note

If multiple truncation paramters are set, e.g, max_extent and discarded_weight_cutoff, the truncated extent will be determined as the lowest among all.

Note

For detailed explanation on the different SVD algorithms and the corresponding parameters, please refer to cuSolver documentation page

Note

For truncated SVD, currently at least one singular value will be retained in the output even if the truncation parameters are set to trim out all singular values. This behavior may be subject to change in a future release.