Skip to content

[codex] Ignore explicit global_phase instructions during separation#804

Closed
TSS99 wants to merge 1 commit into
Qiskit:mainfrom
TSS99:codex/fix-global-phase-separation
Closed

[codex] Ignore explicit global_phase instructions during separation#804
TSS99 wants to merge 1 commit into
Qiskit:mainfrom
TSS99:codex/fix-global-phase-separation

Conversation

@TSS99

@TSS99 TSS99 commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • ignore explicit global_phase instructions when assigning operations to circuit partitions
  • add regression tests for separate_circuit() and partition_problem()

Root cause

Qiskit can materialize a circuit-level global phase as a zero-qubit global_phase instruction. separate_circuit() assumed every instruction touched exactly one partition, so these zero-qubit instructions left partitions_spanned empty and triggered an assertion.

Fix

  • skip explicit global_phase instructions while partitioning operations into subcircuits
  • keep the change local to _separate_instructions_by_partition() so the public APIs inherit the fix without broader refactoring

Tests

  • tox -e lint
  • tox -e py311 -- test\\utils\\test_transforms.py test\\test_cutting_decomposition.py test\\test_cutting_workflows.py

Notes or limitations

Fixes #762

@TSS99 TSS99 marked this pull request as ready for review April 30, 2026 17:08
@TSS99

TSS99 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favor of #817, a cleaner version with a more idiomatic regression test (using GlobalPhaseGate).

@TSS99 TSS99 closed this Jun 9, 2026
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.

Global phase circuit instruction causes partition_problem to error.

1 participant