Skip to content

[BUG] PowerMethod is not implemented right. #211

@paquiteau

Description

@paquiteau

Describe the bug
The PowerMethod algorithm implemented in math/matrix.py is not right, we are using the old norm to divide, and not the norm of the new estimate of the eigen vector.

see here

 x_old = self._set_initial_x()

        # Iterate until the L2 norm of x converges.
        for i_elem in range(max_iter):

            xp = get_array_module(x_old)

            x_old_norm = xp.linalg.norm(x_old)

            x_new = self._operator(x_old) / x_old_norm // <- should be x_new_norm

            x_new_norm = xp.linalg.norm(x_new)

The Pull Request is on the way.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions