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

[ITensors] Make tr preserve element type of input #1448

Merged
merged 7 commits into from
May 17, 2024

Conversation

kmp5VT
Copy link
Collaborator

@kmp5VT kmp5VT commented May 17, 2024

Description

The delta constructor has a default eltype of Float64

delta(is...) = delta(Float64, is...)

to preserve the eltype in trace feed eltype(T) into the constructor of delta. Addresses the issue 1444

Co-authored-by: Matt Fishman <mtfishman@users.noreply.github.com>
@mtfishman
Copy link
Member

Thanks for the quick fix, could you add a test? Ideally we could find an existing test for tr and add a loop over element types.

@kmp5VT
Copy link
Collaborator Author

kmp5VT commented May 17, 2024

I added tests over 4 different eltypes in the tr tests in test_itensors.jl

kmp5VT and others added 2 commits May 17, 2024 10:16
Co-authored-by: Matt Fishman <mtfishman@users.noreply.github.com>
Co-authored-by: Matt Fishman <mtfishman@users.noreply.github.com>
@mtfishman
Copy link
Member

@kmp5VT there are a few mistakes in the tests, my suggestions weren't meant as complete fixes.

@kmp5VT
Copy link
Collaborator Author

kmp5VT commented May 17, 2024

@mtfishman Sorry about that I wasn't paying attention. Thanks!

@mtfishman mtfishman merged commit ce24a30 into ITensor:main May 17, 2024
14 of 15 checks passed
@mtfishman mtfishman changed the title [NDTensors] Fix issue where trace promotes F32 to F64 [ITensors] Make tr preserve element type of input May 17, 2024
@mtfishman mtfishman added the ITensors Issues or pull requests related to the `ITensors` package. label May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ITensors Issues or pull requests related to the `ITensors` package.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants