Skip to content

Skip zero-qubit global_phase instructions during circuit separation#817

Merged
garrison merged 1 commit into
Qiskit:mainfrom
TSS99:fix-global-phase-separation
Jun 22, 2026
Merged

Skip zero-qubit global_phase instructions during circuit separation#817
garrison merged 1 commit into
Qiskit:mainfrom
TSS99:fix-global-phase-separation

Conversation

@TSS99

@TSS99 TSS99 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

separate_circuit() (and therefore partition_problem()) raised an AssertionError when the input circuit contained a zero-qubit global_phase instruction.

Details

A global_phase instruction acts on no qubits, so it spans no partition and cannot be assigned to a subcircuit. It is now skipped while assigning operations to subcircuits. Global phase does not affect the expectation values the cutting workflow reconstructs, so dropping it during separation is safe.

Tests

  • pytest test/utils/test_transforms.py test/test_cutting_decomposition.py
  • ruff check and black --check on the changed files

Fixes #762

@CLAassistant

CLAassistant commented Jun 9, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@TSS99 TSS99 force-pushed the fix-global-phase-separation branch from d708a80 to 696d140 Compare June 9, 2026 09:47
@TSS99 TSS99 force-pushed the fix-global-phase-separation branch from 696d140 to e233650 Compare June 9, 2026 09:48

@garrison garrison left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Thank you for this contribution.

@mergify

mergify Bot commented Jun 22, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@garrison garrison merged commit e889c61 into Qiskit:main Jun 22, 2026
12 checks passed
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.

3 participants