Skip to content

Wrong basis of vector space #40167

@PatrickNeumann93

Description

@PatrickNeumann93

Steps To Reproduce

from sage.all import *

M = Matrix(GF(2), [[1,1],[0,1]])
basis = [vector(GF(2), [0,1])]
vector_space = span(basis)
image_basis = [M * b for b in vector_space.basis()]
image = span(image_basis)
print(image.basis())
print(image_basis, image_basis[0] in image, image_basis[0] in image.basis())

Expected Behavior

[
(1, 1)
]
[(1, 1)] True True

Actual Behavior

[
(0, 1)
]
[(1, 1)] True False

Additional Information

Replacing the line image_basis = [M * b for b in vector_space.basis()] with image_basis = [M * b for b in basis] yields the correct result.

Environment

  • OS: Ubuntu 24.04.2 LTS
  • Sage Version: 10.6 (installed from conda-forge)
  • Python Version: 3.12.8

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions