EigenDecomposition#

class cuquantum.densitymat.EigenDecomposition(
operator,
which='SA',
is_hermitian=True,
scope='full',
approach='krylov',
scope_config=None,
approach_config=None,
)[source]#

Eigen-decomposition of a quantum operator.

Parameters:
  • operator – The Operator whose 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.EigenDecompositionSpectrumKind enum value is also accepted.

  • is_hermitian – Whether the operator is Hermitian. Currently only Hermitian operators are supported.

  • scope – Decomposition scope. Accepts "full", "split", or a cudm.EigenDecompositionScopeKind enum value.

  • approach – Decomposition approach. Accepts "krylov" or a cudm.EigenDecompositionApproachKind enum 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,
) None[source]#
compute(
t: float,
params: ndarray | ndarray | Sequence[float] | None,
states: Sequence[State],
tol: float | ndarray | None = None,
) EigenDecompositionResult[source]#

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:

EigenDecompositionResult

configure(
scope_config: DMRGConfig | None = None,
approach_config: EigenDecompositionApproachKrylovConfig | None = None,
) None[source]#

Update the eigen-decomposition configuration.

prepare() must be invoked before the next compute() call.

Parameters:
prepare(
ctx: WorkStream,
repr_state: State,
max_num_eigvals: int = 1,
compute_type: str | None = None,
) None[source]#

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 to ctx.compute_type when set, otherwise to the operator’s dtype.

Attributes

is_hermitian#

Whether the operator is Hermitian.

which#

Which eigenvalues this solver computes.