CirqGateAsBloq#

qualtran.cirq_interop.CirqGateAsBloq

An adapter that fulfils the Bloq API by delegating to cirq.Gate methods.

Inherits From: CirqGateAsBloqBase, Bloq

  • 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_op will use the adapted cirq gate directly

  • Adjoint and exponentiation go via cirq.inverse and cirq.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.

cirq_gate

The cirq.Gate to use as the source of truth.

gate

 

signature

 

Methods#

my_static_costs

View source

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__

Check equality and either forward a NotImplemented or return the result negated.

__eq__

Method generated by attrs for class CirqGateAsBloq.