Various RE models and some API enhancements#2963
Conversation
| ) | ||
|
|
||
|
|
||
| class MagicUpToClifford(ISATransform): |
There was a problem hiding this comment.
Hmmm.... This is essentially type coersion. It's not clear that we want push type coersion out to each component. Since we're only looking at T and CCZ at this point, this is not too cumbersome. But I can see things getting out of control quickly. An alternative would be do define a type for T_LIKE and CCZ_LIKE, and set the fectories for providing these types, and then do coersion as we have done with (for instance) ONE_QUBIT_UNITARY.
There was a problem hiding this comment.
I think there is a difference between coercion, where we can say that T is a ONE_QUBIT_UNITARY, and this case. Here we say, e.g., that we want to use CCZ magic state factories to produce CCX magic states required by our algorithm, and explicitly mark that we assume that turning the CCZ magic state factory into a CCX factory would have the same cost.
This PR adds various models:
It also makes some updates to the surface code model and improves documentation. Further, it adds a large test suite for all the models. Some of these tests are very detailed but they will help us to spot if we introduce inconsistencies with future code changes.
Besides that there are some fixes to the Python API: