Skip to content

rmul!/lmul! are incorrect with complex scalars #24

@mikmoore

Description

@mikmoore

Using RectangularFullPacked v0.2.1 on Julia v1.11.5.

The functions rmul! and lmul! do not apply a complex scalar correctly. One of the blocks of the receives the incorrect conjugation.

julia> TriangularRFP(fill(complex(1f0), 3, 3), :U) # initial matrix
3×3 TriangularRFP{ComplexF32}:
 1.0+0.0im  1.0+0.0im  1.0+0.0im
 0.0+0.0im  1.0+0.0im  1.0+0.0im
 0.0+0.0im  0.0+0.0im  1.0+0.0im

julia> rmul!(TriangularRFP(fill(complex(1f0), 3, 3), :U), 1f0im)
3×3 TriangularRFP{ComplexF32}:
 0.0-1.0im  0.0+1.0im  0.0+1.0im
 0.0+0.0im  0.0+1.0im  0.0+1.0im
 0.0+0.0im  0.0+0.0im  0.0+1.0im

julia> lmul!(1f0im, TriangularRFP(fill(complex(1f0), 3, 3), :U))
3×3 TriangularRFP{ComplexF32}:
 0.0-1.0im  0.0+1.0im  0.0+1.0im
 0.0+0.0im  0.0+1.0im  0.0+1.0im
 0.0+0.0im  0.0+0.0im  0.0+1.0im

Notice that the (1,1) entry is incorrectly conjugated in the above examples.

Originally added in #8. @dmbates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions