Fix simulated devices#199
Conversation
| pass | ||
|
|
||
| def incompatible_gate(self) -> set[type[Gate]]: | ||
| def compatible_gate(self, native_set: bool = False) -> set[type[Gate]]: |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
| 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, | ||
| ] |
There was a problem hiding this comment.
A bit original to do it like this compared to the rest of devices?
Maybe a method to return that?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
The idea was to avoid instantiating a list the first time we import the file, but here it is not that a big deal
| if len(gate_set) != 0: | ||
| if any( | ||
| type(i) not in gate_set | ||
| for i in self.without_measurements().instructions |
There was a problem hiding this comment.
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.
Reworked devices and added is_retired to simulated devices