Closed Strilanc closed 5 years ago
Not immediately opposed, but I think we need to figure out the gate set story first. I don't like putting these gates into common core Cirq a priory since they are very specialized to Google hardware. Right now the gates are kind of adhoc and we need to figure out what goes where.
Here is a quick proposal that I haven't thought threw:
I also think we need to think through the naming of the gates a bit more. I think the Rot gates for single qubit are fine, but the Rot11 and two qubit SU(4) elements show some significant bias towards the xmon gate set. Two qubit gates are probably best thought of as exp of a two qubit Hamiltonian.
I definitely would be happy if we got rid of to_proto it feels like an over reliance on inheritance to me.
@dabacon I mostly agree with these suggestions but I am concerned about the particular suggestion that circuits always need to be written in one gate set. The reason I don't like that is because then you'd need to incorporate every gate you introduce into a particular gate set in order to use it in a circuit. Or maybe I misunderstand something.
I think we should be a bit more flexible about allowing people to stray outside their gate set in a limited way. This is why, for example, Device now has a decomposition method and this method is called as you add operations in the circuit. It allows people to use Hadamard gates even if they're technically not in the final gate set, and then you do an optimization pass specific to the device to clean up the resulting chaff.
I agree. I don't find any of the downsides @Strilanc listed to be compelling.
XmonGates no longer exist.
It has become increasingly clear that having the xmon gate set is just duplicating work and creating incompatibility errors for no benefit. I suggest that we merge or move all xmon gates down to the base level.
Here's the proposed plan:
to_proto
methods of the xmon gates are moved into a single utitlity methodBenefits:
Downsides:
What do people think?