EigenDecomposition#
-
class cuquantum.
densitymat. EigenDecomposition( - operator,
- which='SA',
- is_hermitian=True,
- scope='full',
- approach='krylov',
- scope_config=None,
- approach_config=None,
Eigen-decomposition of a quantum operator.
- Parameters:
operator – The
Operatorwhose eigenvalues and eigenstates are to be computed.which –
Specifies which eigenvalues to compute. Accepted values are:
"SA": Smallest Algebraic - eigenvalues with smallest real parts, ordered ascending"LA": Largest Algebraic - eigenvalues with largest real parts, ordered descending
A
cudm.EigenDecompositionSpectrumKindenum value is also accepted.is_hermitian – Whether the operator is Hermitian. Currently only Hermitian operators are supported.
scope – Decomposition scope. Accepts
"full","split", or acudm.EigenDecompositionScopeKindenum value.approach – Decomposition approach. Accepts
"krylov"or acudm.EigenDecompositionApproachKindenum value.scope_config – Optional scope-specific configuration (
DMRGConfig).approach_config – Optional approach-specific configuration (
EigenDecompositionApproachKrylovConfig).
Methods
- __init__(
- operator: Operator,
- which: str | EigenDecompositionSpectrumKind = 'SA',
- is_hermitian: bool = True,
- scope: str | EigenDecompositionScopeKind = 'full',
- approach: str | EigenDecompositionApproachKind = 'krylov',
- scope_config: DMRGConfig | None = None,
- approach_config: EigenDecompositionApproachKrylovConfig | None = None,
- compute(
- t: float,
- params: ndarray | ndarray | Sequence[float] | None,
- states: Sequence[State],
- tol: float | ndarray | None = None,
Compute eigenpairs of the operator.
- Parameters:
t – Current time value passed to all callback functions.
params – Additional callback parameters. Element type must be
float64.states – Block of linearly-independent initial states for Krylov iteration, which will be in-place updated with the final eigenstates. The number of requested eigenstates is equal to the number of provided initial states.
tol – Tolerance for residuals
||A*x - lambda*x||. Can be either scalar or array of shape [num_eigvals] or [num_eigvals, batch_size]. If None, square root of machine precision is used.
- Returns:
Dataclass holding the requested eigenvalues and eigenstates of the
Operator.- Return type:
- configure(
- scope_config: DMRGConfig | None = None,
- approach_config: EigenDecompositionApproachKrylovConfig | None = None,
Update the eigen-decomposition configuration.
prepare()must be invoked before the nextcompute()call.- Parameters:
scope_config – Scope-specific configuration (
DMRGConfig).approach_config – Approach-specific configuration (
EigenDecompositionApproachKrylovConfig).
- prepare(
- ctx: WorkStream,
- repr_state: State,
- max_num_eigvals: int = 1,
- compute_type: str | None = None,
Prepare the eigen-decomposition for computation.
- Parameters:
ctx – Library context containing workspace, stream and other configuration. See
WorkStream.repr_state – Representative quantum state used to size the plan.
max_num_eigvals – Maximum number of eigenpairs that subsequent
compute()calls may request.compute_type – CUDA compute type string (e.g.
"complex128"). Defaults toctx.compute_typewhen set, otherwise to the operator’s dtype.
Attributes
- is_hermitian#
Whether the operator is Hermitian.
- which#
Which eigenvalues this solver computes.