Skip to content

[Feature request] Option to specify algorithm "flavor" without restricting data storage type #176

@leburgel

Description

@leburgel

Currently, MatrixAlgebraKit.jl allows users to select a specific algorithm to be used when computing a decomposition, say for example an SVD, through the alg keyword argument. However, right now specifying an algorithm in this way always requires some knowledge of the data storage types that will be used.

For example, if we want to compute an SVD using the divide-and-conquer algorithm, we have currently have to choose either alg = :LAPACK_DivideAndConquer, alg = :CUSOLVER_DivideAndConquer or alg = :ROCSOLVER_DivideAndConquer (or similar calls with the corresponding algorithm instances). So we have to specify what type of matrix is being decomposed, even though all of these algorithms are essentially identical in implementation and take the same keyword arguments. The same goes for any of the other SVD or eig algorithms which have both CPU and GPU implementations.

It would be nice to be able to specify the algorithm "flavor" by setting something like alg = :DivideAndConquer, without having to know beforehand what the data type will be. The selection of the appropriate implementation would then be handled by MatrixAlgebraKit.select_algorithm based on the storage type at runtime. This came up in QuantumKitHub/PEPSKit.jl#335, where we would like to set up specific algorithm choices during an initialization stage, while not imposing any restrictions on the storage type beforehand.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions