Skip to content

Switch Tensor to use ArcArray instead of Array#16256

Open
ihincks wants to merge 2 commits into
Qiskit:mainfrom
ihincks:tensor-arc
Open

Switch Tensor to use ArcArray instead of Array#16256
ihincks wants to merge 2 commits into
Qiskit:mainfrom
ihincks:tensor-arc

Conversation

@ihincks
Copy link
Copy Markdown
Contributor

@ihincks ihincks commented May 23, 2026

The motivation for this change in what's stored by a tensor is to allow a cheap cloning mechanism that, in particular, a QuantumProgram can exploit. Since some arrays it deals with may be large, we don't want to force it to clone entire arrays when it needs to do things like fan out a tensor to multiple descendent nodes when evaluating the graph.

See this one commit for the diff being introduced here: 257cd56

PR Stack

AI/LLM disclosure

  • I didn't use LLM tooling, or only used it privately.
  • I used the following tool to help write this PR description:
  • I used the following tool to generate or modify code: Claude 4.7

@ihincks ihincks requested a review from a team as a code owner May 23, 2026 21:15
@ihincks ihincks requested a review from mtreinish May 23, 2026 21:15
@qiskit-bot
Copy link
Copy Markdown
Collaborator

One or more of the following people are relevant to this code:

  • @Qiskit/terra-core

@ihincks ihincks mentioned this pull request May 23, 2026
@coveralls
Copy link
Copy Markdown

coveralls commented May 24, 2026

Coverage Report for CI Build 26910624413

Coverage decreased (-0.006%) to 87.465%

Details

  • Coverage decreased (-0.006%) from the base build.
  • Patch coverage: 3 uncovered changes across 1 file (68 of 71 lines covered, 95.77%).
  • 12 coverage regressions across 6 files.

Uncovered Changes

File Changed Covered %
crates/providers/src/tensor.rs 68 65 95.59%
Total (2 files) 71 68 95.77%

Coverage Regressions

12 previously-covered lines in 6 files lost coverage.

File Lines Losing Coverage Coverage
crates/qasm2/src/parse.rs 6 97.63%
crates/providers/src/tensor.rs 2 94.8%
crates/circuit/src/parameter/parameter_expression.rs 1 91.03%
crates/circuit/src/parameter/symbol_expr.rs 1 73.88%
crates/qasm2/src/expr.rs 1 93.82%
crates/qasm2/src/lex.rs 1 92.29%

Coverage Stats

Coverage Status
Relevant Lines: 124528
Covered Lines: 108918
Line Coverage: 87.46%
Coverage Strength: 961673.64 hits per line

💛 - Coveralls

@ihincks ihincks added mod: providers Related to the backend and job abstractions Rust This PR or issue is related to Rust code in the repository labels May 28, 2026
@ihincks ihincks added this to the 2.5.0 milestone May 28, 2026
@ihincks ihincks added the on hold Can not fix yet label Jun 3, 2026
@ihincks ihincks removed the on hold Can not fix yet label Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod: providers Related to the backend and job abstractions Rust This PR or issue is related to Rust code in the repository

Projects

Status: Ready

Development

Successfully merging this pull request may close these issues.

4 participants