Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tensor-number multiplication #290

Merged
merged 4 commits into from
Jan 17, 2025
Merged

Conversation

Todorbsc
Copy link
Contributor

@Todorbsc Todorbsc commented Jan 16, 2025

This PR resolves a bug where the type T does NOT exist but it should be type Tensor in multiplication operation.

@Todorbsc Todorbsc self-assigned this Jan 16, 2025
@Todorbsc Todorbsc changed the title Replace type T for type Tensor Fix tensor-number multiplication Jan 16, 2025
@Todorbsc Todorbsc added the bug Something isn't working label Jan 16, 2025
Comment on lines 19 to 28
@testset "tensor-number multiplication" begin
data = rand(2, 3, 4)
realnum = 2
complexnum = 2 + 2im

A = Tensor(data, (:i, :j, :k))
@test data * realnum ≈ parent(A * realnum) ≈ parent(realnum * A)
@test data * complexnum ≈ parent(A * complexnum) ≈ parent(complexnum * A)
end

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is just an alias to contract, can you put it inside the contract testset? name the testset "* alias"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! check it out

@mofeing mofeing merged commit a5321ab into master Jan 17, 2025
5 of 7 checks passed
@mofeing mofeing deleted the fix/tensor-number-multiplication branch January 17, 2025 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants