CirqGateAsBloq#
qualtran.cirq_interop.CirqGateAsBloq
View source on GitHub
|
An adapter that fulfils the Bloq API by delegating to cirq.Gate methods.
Inherits From: CirqGateAsBloqBase, Bloq
qualtran.cirq_interop.CirqGateAsBloq(
gate
)
The bloq’s signature is one register named “q” of type QBit() with shape (n_qubits,) as determined by
cirq.num_qubits.Decomposition will go via
cirq.decompose_once.Tensor data is derived from
cirq.unitary.as_cirq_opwill use the adapted cirq gate directlyAdjoint and exponentiation go via
cirq.inverseandcirq.pow, respectively.The string representation is “cirq.{gate}”.
If you’d rather bootstrap your own bloq based on an existing cirq.Gate, you can inherit
from CirqGateAsBloqBase.
Attributes
Methods#
my_static_costs
my_static_costs(
cost_key: 'CostKey'
)
Override this method to provide static costs.
The system will query a particular cost by asking for a cost_key. This method
can optionally provide a value, which will be preferred over a computed cost.
Static costs can be provided if the particular cost cannot be easily computed or as a performance optimization.
This method must return NotImplemented if a value cannot be provided for the specified
CostKey.
__ne__
__ne__(
other
)
Check equality and either forward a NotImplemented or return the result negated.
__eq__
__eq__(
other
)
Method generated by attrs for class CirqGateAsBloq.
View source on GitHub