You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This class implements both the Bloq interface as well as the cirq.Gate interface (simultaneously). The factored way of doing this is to implement the Bloq interface and use the to-cirq functionality (including Bloq.on()) to explicitly access the cirq.Gate interface.
In theory, most places where algorithms descend from GateWithRegisters, it can be migrated to just Bloq as the superclass with minimal changes. These changes include:
if the gate overrides decompose_from_registers (i.e. cirq-style decomposition), you must add an explicit override
If the gate overrides circuit_diagram_info, you can use qualtran.cirq_interop._cirq_to_bloq._wire_symbol_from_gate or just implement the wire_symbol method (preferred)
The text was updated successfully, but these errors were encountered:
The name GateWithRegisters is somewhat unhelpful. History: I picked this name when it was literally just a cirq gate with names for the registers :) . A better name would indicate its true role as a cirq.gate/qualtran.bloq hybrid. But separating these concerns is the better medium+ term solution.
This class implements both the Bloq interface as well as the
cirq.Gate
interface (simultaneously). The factored way of doing this is to implement theBloq
interface and use the to-cirq functionality (includingBloq.on()
) to explicitly access the cirq.Gate interface.In theory, most places where algorithms descend from
GateWithRegisters
, it can be migrated to justBloq
as the superclass with minimal changes. These changes include:decompose_from_registers
(i.e. cirq-style decomposition), you must add an explicit overridecircuit_diagram_info
, you can usequaltran.cirq_interop._cirq_to_bloq._wire_symbol_from_gate
or just implement thewire_symbol
method (preferred)The text was updated successfully, but these errors were encountered: