Skip to content

Accelerate PBC layer commutation with symplectic bases - #3095

Open
jk20342 wants to merge 4 commits into
PennyLaneAI:mainfrom
jk20342:perf
Open

Accelerate PBC layer commutation with symplectic bases#3095
jk20342 wants to merge 4 commits into
PennyLaneAI:mainfrom
jk20342:perf

Conversation

@jk20342

@jk20342 jk20342 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Context:

PBCLayer checked a candidate against every operation already in the layer
this repeated Pauli normalization and became quadratic for large commuting layers

Description of the Change:

  • store Pauli operators as packed X and Z bit vectors
  • maintain a lazy row echelon basis over GF(2)
  • test commutation with XOR and popcount against independent basis rows
  • invalidate the basis when an operation is removed
  • add an MLIR regression test for dependent commuting operators

Benefits:

  • preserves layer membership and operation order
  • bounds basis rank by the number of qubits
  • avoids basis construction for disjoint only layers
  • reached 26.7x speedup for 16000 dependent terms on 64 qubits

Possible Drawbacks:

None off the top of my head

Related GitHub Issues:

None

@zsb-xqc

zsb-xqc commented Aug 10, 2026

Copy link
Copy Markdown

Thanks @jk20342, this looks like an efficient representation for the PBC layer, leading to a significant speedup. We will review shortly and get back to you.

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