Skip to content

Conversation

ElePT
Copy link
Collaborator

@ElePT ElePT commented Jul 9, 2025

Summary

This PR contains a preliminary implementation of the MidCircuitMeasure instruction, an alternative measurement that can be added to a Target and used for circuit building and transpilation.

To use this gate, you can do:

from qiskit import QuantumCircuit
from qiskit_ibm_runtime.circuit import MidCircuitMeasure
from qiskit.circuit import Measure

circ = QuantumCircuit(2, 2)
circ.x(0)
circ.append(MidCircuitMeasure(), [0], [0])
circ.append(MidCircuitMeasure("measure_3"), [0], [1])
circ.measure([0], [0])
circ.measure_all()
print(circ.draw())

Details and comments

This is part of the implementation of #2287

@ElePT ElePT changed the title Add new gate library with MidCircuitMeasure instruction [MCM-1] Add new gate library with MidCircuitMeasure instruction Jul 9, 2025
@ElePT ElePT added the Changelog: New Feature Include in the Added section of the changelog label Jul 16, 2025
@ElePT ElePT had a problem deploying to ibm-cloud-production July 29, 2025 14:03 — with GitHub Actions Failure
* Add MidCircuitMeasure(Instruction) to new circuit library

* Add unit tests

* Add release note

* Modify convert_to_target to support additional instructions through "instruction_signatures", add arguments supported in original implementation. Allow to provide a custom_name_mapping, which was referenced in the error messages but not actually enabled. Update typing style.
@kt474 kt474 added this to the 0.43.0 milestone Sep 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: New Feature Include in the Added section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants