Skip to content

Add a disamgiguating conversion#47

Open
kshyatt wants to merge 6 commits intolkdvos:mainfrom
kshyatt:ksh/conversion
Open

Add a disamgiguating conversion#47
kshyatt wants to merge 6 commits intolkdvos:mainfrom
kshyatt:ksh/conversion

Conversation

@kshyatt
Copy link
Contributor

@kshyatt kshyatt commented Feb 17, 2026

This seems to be needed for conversion of BlockTensorMaps backed by GPU arrays to CuTensorMap -- otherwise an ambiguity error arises.

@codecov
Copy link

codecov bot commented Feb 17, 2026

Codecov Report

❌ Patch coverage is 0% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 4.43%. Comparing base (0b3278f) to head (880e610).

Files with missing lines Patch % Lines
src/tensors/abstractblocktensor/conversion.jl 0.00% 24 Missing ⚠️
src/tensors/tensoroperations.jl 0.00% 6 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (0b3278f) and HEAD (880e610). Click for more details.

HEAD has 12 uploads less than BASE
Flag BASE (0b3278f) HEAD (880e610)
24 12
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #47       +/-   ##
==========================================
- Coverage   55.43%   4.43%   -51.01%     
==========================================
  Files          18      18               
  Lines        1407    1420       +13     
==========================================
- Hits          780      63      -717     
- Misses        627    1357      +730     

☔ 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.

@lkdvos
Copy link
Owner

lkdvos commented Feb 17, 2026

Is this not showing up in Aqua because the ambiguity only is there if CUDA is loaded?

@kshyatt
Copy link
Contributor Author

kshyatt commented Feb 17, 2026

Yes basically exactly that.

@kshyatt
Copy link
Contributor Author

kshyatt commented Feb 17, 2026

lol "amgiguating"

@kshyatt
Copy link
Contributor Author

kshyatt commented Feb 20, 2026

Annoying, more ambiguities to fix.

@kshyatt
Copy link
Contributor Author

kshyatt commented Feb 20, 2026

OK, I think this is ok to go (but we'll want to fix Project.toml) after QuantumKitHub/TensorKit.jl#375 gets into shape

@kshyatt
Copy link
Contributor Author

kshyatt commented Feb 20, 2026

OK, created a more specific TensorMap conversion and moved some common logic into a new function. Also got the storage type thing seemingly resolved...

@kshyatt
Copy link
Contributor Author

kshyatt commented Feb 24, 2026

I think everything got resolved here?

inds = findall(!iszero ∘ last, B_ends)
isempty(inds) && return zero(TKscalartype(t))
return only(last(B_ends[only(inds)]))
end
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
end
function TO.tensorscalar(t::AbstractBlockTensorMap{T, S, 0, 0}) where {T, S}
return prod(TO.tensorscalar, nonzero_values(t))

Do you know if this would work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me try it locally and get back to you

kshyatt and others added 2 commits February 25, 2026 16:19
Co-authored-by: Lukas Devos <ldevos98@gmail.com>
Co-authored-by: Lukas Devos <ldevos98@gmail.com>
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.

2 participants