Skip to content

Fix simulated devices#199

Open
MathieuG-Colibri wants to merge 5 commits into
devfrom
fix-simulated-devices
Open

Fix simulated devices#199
MathieuG-Colibri wants to merge 5 commits into
devfrom
fix-simulated-devices

Conversation

@MathieuG-Colibri
Copy link
Copy Markdown
Collaborator

Reworked devices and added is_retired to simulated devices

@MathieuG-Colibri MathieuG-Colibri self-assigned this May 20, 2026
@github-actions github-actions Bot added the bug Something isn't working label May 20, 2026
Comment thread mpqp/core/circuit.py
Comment thread mpqp/core/circuit.py Outdated
Comment thread mpqp/execution/devices.py
pass

def incompatible_gate(self) -> set[type[Gate]]:
def compatible_gate(self, native_set: bool = False) -> set[type[Gate]]:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This means that each time we add a gate to MPQP (which is not that often I admit) we have to remember to update each time all the compatible gates ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

No because more often than not we're going to transpile the circuit so we won't have forbidden gates by themselves.
For the cases that it's really needed we can do a list product with the NATIVE_GATES constant.

Comment thread mpqp/execution/devices.py
Comment on lines +530 to +538
IBM_CHIPS_HERON = [IBMDevice.IBM_MIAMI, IBMDevice.IBM_BERLIN]
IBM_CHIPS_NIGHTHAWK = [
IBMDevice.IBM_BOSTON,
IBMDevice.IBM_KINGSTON,
IBMDevice.IBM_PITTSBURGH,
IBMDevice.IBM_FEZ,
IBMDevice.IBM_MARRAKESH,
IBMDevice.IBM_AACHEN,
]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A bit original to do it like this compared to the rest of devices?
Maybe a method to return that?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We could have a method but chips family like is more often done by IBM.
It felt bad adding a whole method for AvailableDevice only for an edge case of qiskit.

Copy link
Copy Markdown
Contributor

@hJaffaliColibritd hJaffaliColibritd May 26, 2026

Choose a reason for hiding this comment

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

The idea was to avoid instantiating a list the first time we import the file, but here it is not that a big deal

Comment thread mpqp/core/circuit.py Outdated
if len(gate_set) != 0:
if any(
type(i) not in gate_set
for i in self.without_measurements().instructions
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I agree with native/verbatim validation. I think we just guard it ? so device.compatible_gate() is only used in that path, instead of always validating the original instructions unconditionally before transpilation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants