Skip to content

[codex] Fix ComplexF64 SimpleTT site tensor regression#25

Merged
shinaoka merged 2 commits intomainfrom
codex/quantics-rust-parity
Apr 6, 2026
Merged

[codex] Fix ComplexF64 SimpleTT site tensor regression#25
shinaoka merged 2 commits intomainfrom
codex/quantics-rust-parity

Conversation

@shinaoka
Copy link
Copy Markdown
Member

@shinaoka shinaoka commented Apr 6, 2026

Summary

This PR supersedes the conflict-heavy part of #22 with a clean branch from current main.

Changes:

  • fix t4a_simplett_c64_site_tensor buffer-length handling in the Julia C wrapper so it passes the number of doubles expected by the Rust C API
  • add test/test_conversions.jl coverage for SimpleTensorTrain <-> TreeTN round-trips, including a ComplexF64 regression that exercises the previously broken path

Root cause

Tensor4all.jl passed the complex site-tensor buffer length as the number of complex elements, but the Rust C API expects the number of interleaved Float64 values. That caused SimpleTT complex site-tensor extraction to fail with T4A_INVALID_ARGUMENT, which in turn broke the ComplexF64 SimpleTT and TreeTN conversion path.

Validation

Passed:

  • julia --startup-file=no --project=/home/shinaoka/tensor4all/Tensor4all.jl -e 'using Test, Tensor4all, Tensor4all.SimpleTT; include("/home/shinaoka/tensor4all/Tensor4all.jl/test/test_simplett.jl")'
  • julia --startup-file=no --project=/home/shinaoka/tensor4all/Tensor4all.jl -e 'using Test, Tensor4all, Tensor4all.SimpleTT, Tensor4all.TreeTN; include("/home/shinaoka/tensor4all/Tensor4all.jl/test/test_conversions.jl")'
  • T4A_SKIP_HDF5_TESTS=1 julia --startup-file=no --project=/home/shinaoka/tensor4all/Tensor4all.jl /home/shinaoka/tensor4all/Tensor4all.jl/test/runtests.jl

Result:

  • 293 passed
  • 0 failed
  • 0 broken

Related

@shinaoka shinaoka marked this pull request as ready for review April 6, 2026 08:24
@shinaoka shinaoka merged commit bb0a773 into main Apr 6, 2026
4 checks passed
@shinaoka shinaoka deleted the codex/quantics-rust-parity branch April 6, 2026 08:24
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.

1 participant