Skip to content

Update PreSamplex.add_combine_node() to avoid adding the trivial combination#311

Draft
ihincks wants to merge 2 commits intomainfrom
remove-useless-combine
Draft

Update PreSamplex.add_combine_node() to avoid adding the trivial combination#311
ihincks wants to merge 2 commits intomainfrom
remove-useless-combine

Conversation

@ihincks
Copy link
Collaborator

@ihincks ihincks commented Feb 23, 2026

Summary

Details and comments

AI tool use: claude opus 4.6

This branch timing:

image

main:
image


import numpy as np
from qiskit.quantum_info import PauliLindbladMap

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

unrelated to this PR, not sure how it got past pre-commit

joshuasn
joshuasn previously approved these changes Feb 23, 2026
Copy link
Collaborator

@joshuasn joshuasn left a comment

Choose a reason for hiding this comment

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

nice, lgtm

@joshuasn joshuasn dismissed their stale review February 23, 2026 21:35

didn't look at timings closely..

@ihincks
Copy link
Collaborator Author

ihincks commented Feb 23, 2026

so better, but not crazy

  ┌───────────────────────────┬───────────┬───────────┬─────────────────┐
  │          Metric           │   main    │  branch   │      delta      │
  ├───────────────────────────┼───────────┼───────────┼─────────────────┤
  │ Node counts               │           │           │                 │
  ├───────────────────────────┼───────────┼───────────┼─────────────────┤
  │ Total nodes               │ 1,565     │ 1,149     │ -416 (-27%)     │
  ├───────────────────────────┼───────────┼───────────┼─────────────────┤
  │ SliceRegisterNode         │ 626       │ 210       │ -416 (-66%)     │
  ├───────────────────────────┼───────────┼───────────┼─────────────────┤
  │ Evaluation nodes          │ 1,354     │ 938       │ -416 (-31%)     │
  ├───────────────────────────┼───────────┼───────────┼─────────────────┤
  │ Evaluation streams        │ 13        │ 9         │ -4 (-31%)       │
  ├───────────────────────────┼───────────┼───────────┼─────────────────┤
  │ Sampling/Collection/other │ unchanged │ unchanged │                 │
  ├───────────────────────────┼───────────┼───────────┼─────────────────┤
  │ Serialization             │           │           │                 │
  ├───────────────────────────┼───────────┼───────────┼─────────────────┤
  │ Serialized size           │ 5,288 KB  │ 5,187 KB  │ -101 KB (-1.9%) │
  ├───────────────────────────┼───────────┼───────────┼─────────────────┤
  │ Serialize time            │ 500 ms    │ 454 ms    │ -46 ms (-9%)    │
  ├───────────────────────────┼───────────┼───────────┼─────────────────┤
  │ Timings                   │           │           │                 │
  ├───────────────────────────┼───────────┼───────────┼─────────────────┤
  │ Build time                │ 4,488 ms  │ 4,556 ms  │ +68 ms (~noise) │
  ├───────────────────────────┼───────────┼───────────┼─────────────────┤
  │ Sample time (100 rand)    │ 225 ms    │ 212 ms    │ -13 ms (-6%)    │
  ├───────────────────────────┼───────────┼───────────┼─────────────────┤
  │ Per randomization         │ 2.25 ms   │ 2.12 ms   │ -0.13 ms (-6%)  │
  └───────────────────────────┴───────────┴───────────┴─────────────────┘

@joshuasn
Copy link
Collaborator

@ihincks still a good improvement, lgtm

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