Skip to content

Conversation

@ogauthe
Copy link
Collaborator

@ogauthe ogauthe commented Jul 1, 2025

This PR defines real and imag for a FusionTensor.

The default implementation relies on Broadcast and errors on some axis convention.

@codecov
Copy link

codecov bot commented Jul 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.52%. Comparing base (3e9ee17) to head (063a4c3).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #62      +/-   ##
==========================================
+ Coverage   91.47%   91.52%   +0.04%     
==========================================
  Files          11       11              
  Lines         575      578       +3     
==========================================
+ Hits          526      529       +3     
  Misses         49       49              
Flag Coverage Δ
docs 0.00% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@lkdvos lkdvos left a comment

Choose a reason for hiding this comment

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

Just double checking since I might be misunderstanding this:

There are a couple lines that look to me like you are returning the same object in cases where I would expect this to not be possible. Note that the Base behavior is to return an array with a real eltype as well, therefore it is never possible to have an in-place operation for complex arrays:

julia> A = rand(ComplexF64, 2, 2)
2×2 Matrix{ComplexF64}:
   0.374141+0.728543im  0.531899+0.0731709im
 0.00277646+0.134685im  0.501756+0.906939im

julia> real(A)
2×2 Matrix{Float64}:
 0.374141    0.531899
 0.00277646  0.501756

julia> imag(A)
2×2 Matrix{Float64}:
 0.728543  0.0731709
 0.134685  0.906939

@mtfishman mtfishman merged commit c8f3ad5 into ITensor:main Jul 1, 2025
13 checks passed
@ogauthe ogauthe deleted the real branch July 1, 2025 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants